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 <thread> 17 #include "audio_errors.h" 18 #include "audio_info.h" 19 #include "audio_routing_manager_unit_test.h" 20 21 using namespace std; 22 using namespace testing::ext; 23 24 namespace OHOS { 25 namespace AudioStandard { 26 SetUpTestCase(void)27void AudioRoutingManagerUnitTest::SetUpTestCase(void) {} TearDownTestCase(void)28void AudioRoutingManagerUnitTest::TearDownTestCase(void) {} SetUp(void)29void AudioRoutingManagerUnitTest::SetUp(void) {} TearDown(void)30void AudioRoutingManagerUnitTest::TearDown(void) {} 31 32 /** 33 * @tc.name : Test Audio_Routing_Manager_SetMicStateChangeCallback_001 via legal state 34 * @tc.number: Audio_Routing_Manager_SetMicStateChangeCallback_001 35 * @tc.desc : Test SetMicStateChangeCallback interface. Returns success. 36 */ 37 HWTEST(AudioRoutingManagerUnitTest, Audio_Routing_Manager_SetMicStateChangeCallback_001, TestSize.Level1) 38 { 39 int32_t ret = -1; 40 std::shared_ptr<AudioManagerMicStateChangeCallbackTest> callback = 41 std::make_shared<AudioManagerMicStateChangeCallbackTest>(); 42 ret = AudioRoutingManager::GetInstance()->SetMicStateChangeCallback(callback); 43 EXPECT_EQ(SUCCESS, ret); 44 } 45 } // namespace AudioStandard 46 } // namespace OHOS