• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #include <gtest/gtest.h>
10 #include "audio_common_test.h"
11 #include "hdf_uhdf_test.h"
12 
13 using namespace testing::ext;
14 
15 namespace {
16 class AudioCodecBaseTest : public testing::Test {
17 public:
18     static void SetUpTestCase();
19     static void TearDownTestCase();
20     void SetUp();
21     void TearDown();
22 };
23 
SetUpTestCase()24 void AudioCodecBaseTest::SetUpTestCase()
25 {
26     HdfTestOpenService();
27 }
28 
TearDownTestCase()29 void AudioCodecBaseTest::TearDownTestCase()
30 {
31     HdfTestCloseService();
32 }
33 
SetUp()34 void AudioCodecBaseTest::SetUp()
35 {
36 }
37 
TearDown()38 void AudioCodecBaseTest::TearDown()
39 {
40 }
41 
42 HWTEST_F(AudioCodecBaseTest, AudioCodecBaseTest_GetServiceName, TestSize.Level1)
43 {
44     struct HdfTestMsg msg = {g_testAudioType, TESTGETSERVICENAME, -1};
45     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
46 }
47 
48 HWTEST_F(AudioCodecBaseTest, AudioCodecBaseTest_GetDaiName, TestSize.Level1)
49 {
50     struct HdfTestMsg msg = {g_testAudioType, TESTGETDAINAME, -1};
51     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
52 }
53 
54 HWTEST_F(AudioCodecBaseTest, AudioCodecBaseTest_GetConfigInfo, TestSize.Level1)
55 {
56     struct HdfTestMsg msg = {g_testAudioType, TESTGETCONFIGINFO, -1};
57     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
58 }
59 
60 HWTEST_F(AudioCodecBaseTest, AudioCodecBaseTest_SetConfigInfo, TestSize.Level1)
61 {
62     struct HdfTestMsg msg = {g_testAudioType, TESTSETCONFIGINFO, -1};
63     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
64 }
65 
66 HWTEST_F(AudioCodecBaseTest, AudioCodecBaseTest_SetCtlFunc, TestSize.Level1)
67 {
68     struct HdfTestMsg msg = {g_testAudioType, TESTSETCTLFUNC, -1};
69     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
70 }
71 }
72