1 /*
2 * Copyright (c) 2022 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 "daudio_handler_test.h"
17
18 #include <cstdint>
19 #include <memory>
20
21 using namespace testing::ext;
22
23 namespace OHOS {
24 namespace DistributedHardware {
SetUpTestCase(void)25 void DAudioHandlerTest::SetUpTestCase(void) {}
26
TearDownTestCase(void)27 void DAudioHandlerTest::TearDownTestCase(void) {}
28
SetUp(void)29 void DAudioHandlerTest::SetUp(void) {}
30
TearDown(void)31 void DAudioHandlerTest::TearDown(void) {}
32
33 /**
34 * @tc.name: Initialize_001
35 * @tc.desc: Verify the Initialize function.
36 * @tc.type: FUNC
37 * @tc.require: AR000H0E5F
38 */
39 HWTEST_F(DAudioHandlerTest, Initialize_001, TestSize.Level1)
40 {
41 int32_t actual = DAudioHandler::GetInstance().Initialize();
42 EXPECT_EQ(DH_SUCCESS, actual);
43 }
44
45 /**
46 * @tc.name: QueryAudioInfo_001
47 * @tc.desc: Verify the QueryAudioInfo function.
48 * @tc.type: FUNC
49 * @tc.require: AR000H0E5F
50 */
51 HWTEST_F(DAudioHandlerTest, QueryAudioInfo_001, TestSize.Level1)
52 {
53 int32_t actual = DAudioHandler::GetInstance().QueryAudioInfo();
54 EXPECT_EQ(DH_SUCCESS, actual);
55 }
56
57 /**
58 * @tc.name: Query_001
59 * @tc.desc: Verify the Query function.
60 * @tc.type: FUNC
61 * @tc.require: AR000H0E5F
62 */
63 HWTEST_F(DAudioHandlerTest, Query_001, TestSize.Level1)
64 {
65 int32_t actual = DAudioHandler::GetInstance().Query().size();
66 EXPECT_LE(DH_SUCCESS, actual);
67 }
68 } // namespace DistributedHardware
69 } // namespace OHOS