1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "audio_zone_interrupt_reporter_unit_test.h"
17 #include "audio_errors.h"
18 #include "audio_policy_log.h"
19
20 #include <thread>
21 #include <memory>
22 #include <vector>
23 using namespace testing::ext;
24
25 namespace OHOS {
26 namespace AudioStandard {
27
SetUpTestCase(void)28 void AudioZoneInterruptReporterUnitTest::SetUpTestCase(void) {}
TearDownTestCase(void)29 void AudioZoneInterruptReporterUnitTest::TearDownTestCase(void) {}
SetUp(void)30 void AudioZoneInterruptReporterUnitTest::SetUp(void) {}
TearDown(void)31 void AudioZoneInterruptReporterUnitTest::TearDown(void) {}
32
33 /**
34 * @tc.name : Test AudioZoneInterruptReporterUnitTest.
35 * @tc.number: AudioZoneInterruptReporter_001
36 * @tc.desc : Test AddAudioInterruptCallback interface.
37 */
38 HWTEST_F(AudioZoneInterruptReporterUnitTest, AudioZoneInterruptReporter_001, TestSize.Level1)
39 {
40 EXPECT_EQ(reporter_.EnableInterruptReport(0, 0, "", true), SUCCESS);
41 EXPECT_EQ(reporter_.EnableInterruptReport(0, 0, "", false), SUCCESS);
42 }
43
44 /**
45 * @tc.name : Test AudioZoneInterruptReporterUnitTest.
46 * @tc.number: AudioZoneInterruptReporter_002
47 * @tc.desc : Test AddAudioInterruptCallback interface.
48 */
49 HWTEST_F(AudioZoneInterruptReporterUnitTest, AudioZoneInterruptReporter_002, TestSize.Level1)
50 {
51 EXPECT_EQ(reporter_.RegisterInterruptReport(0, 0, ""), SUCCESS);
52 EXPECT_EQ(reporter_.RegisterInterruptReport(0, 0, ""), SUCCESS);
53 }
54 } // namespace AudioStandard
55 } // namespace OHOS
56