1fa7767c5Sopenharmony_ci/*
2fa7767c5Sopenharmony_ci * Copyright (c) 2021-2021 Huawei Device Co., Ltd.
3fa7767c5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4fa7767c5Sopenharmony_ci * you may not use this file except in compliance with the License.
5fa7767c5Sopenharmony_ci * You may obtain a copy of the License at
6fa7767c5Sopenharmony_ci *
7fa7767c5Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8fa7767c5Sopenharmony_ci *
9fa7767c5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10fa7767c5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11fa7767c5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12fa7767c5Sopenharmony_ci * See the License for the specific language governing permissions and
13fa7767c5Sopenharmony_ci * limitations under the License.
14fa7767c5Sopenharmony_ci */
15fa7767c5Sopenharmony_ci
16fa7767c5Sopenharmony_ci#include "gtest/gtest.h"
17fa7767c5Sopenharmony_ci#include "plugin/common/any.h"
18fa7767c5Sopenharmony_ci#include "plugin/plugins/ffmpeg_adapter/utils/aac_audio_config_parser.h"
19fa7767c5Sopenharmony_ci#include "plugin/plugins/ffmpeg_adapter/utils/ffmpeg_utils.h"
20fa7767c5Sopenharmony_ci
21fa7767c5Sopenharmony_ci#define private public
22fa7767c5Sopenharmony_ci#define protected public
23fa7767c5Sopenharmony_ci
24fa7767c5Sopenharmony_ciusing namespace testing::ext;
25fa7767c5Sopenharmony_ci
26fa7767c5Sopenharmony_cinamespace OHOS {
27fa7767c5Sopenharmony_cinamespace Media {
28fa7767c5Sopenharmony_cinamespace Test {
29fa7767c5Sopenharmony_ciusing namespace Plugin;
30fa7767c5Sopenharmony_ciusing namespace Plugin::Ffmpeg;
31fa7767c5Sopenharmony_ci
32fa7767c5Sopenharmony_ciHWTEST(ChannelLayoutTest, test_convert_from_ffmpeg_mono, TestSize.Level1)
33fa7767c5Sopenharmony_ci{
34fa7767c5Sopenharmony_ci    int channels = 1;
35fa7767c5Sopenharmony_ci    uint64_t ffChannelLayout = 0x4;
36fa7767c5Sopenharmony_ci
37fa7767c5Sopenharmony_ci    AudioChannelLayout channelLayout = Ffmpeg::ConvertChannelLayoutFromFFmpeg(channels, ffChannelLayout);
38fa7767c5Sopenharmony_ci    EXPECT_EQ(AudioChannelLayout::MONO, channelLayout);
39fa7767c5Sopenharmony_ci}
40fa7767c5Sopenharmony_ci
41fa7767c5Sopenharmony_ciHWTEST(ChannelLayoutTest, test_convert_from_ffmpeg_stereo, TestSize.Level1)
42fa7767c5Sopenharmony_ci{
43fa7767c5Sopenharmony_ci    int channels = 2;
44fa7767c5Sopenharmony_ci    uint64_t ffChannelLayout = 0x3;
45fa7767c5Sopenharmony_ci
46fa7767c5Sopenharmony_ci    AudioChannelLayout channelLayout = Ffmpeg::ConvertChannelLayoutFromFFmpeg(channels, ffChannelLayout);
47fa7767c5Sopenharmony_ci    EXPECT_EQ(AudioChannelLayout::STEREO, channelLayout);
48fa7767c5Sopenharmony_ci}
49fa7767c5Sopenharmony_ci
50fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_1, TestSize.Level1)
51fa7767c5Sopenharmony_ci{
52fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0x8A, 0xE6};
53fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
54fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
55fa7767c5Sopenharmony_ci    EXPECT_EQ(true, status);
56fa7767c5Sopenharmony_ci    uint32_t level = aacAudioConfigParser.GetLevel();
57fa7767c5Sopenharmony_ci    EXPECT_EQ(2, level);
58fa7767c5Sopenharmony_ci}
59fa7767c5Sopenharmony_ci
60fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_2, TestSize.Level1)
61fa7767c5Sopenharmony_ci{
62fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0x8F, 0xE6};
63fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
64fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
65fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
66fa7767c5Sopenharmony_ci}
67fa7767c5Sopenharmony_ci
68fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_3, TestSize.Level1)
69fa7767c5Sopenharmony_ci{
70fa7767c5Sopenharmony_ci    const uint8_t config[5] = {0x8F, 0xE6, 0x47, 0x6F, 0x5B};
71fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 5);
72fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
73fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
74fa7767c5Sopenharmony_ci}
75fa7767c5Sopenharmony_ci
76fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_4, TestSize.Level1)
77fa7767c5Sopenharmony_ci{
78fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0x8E, 0xE6};
79fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
80fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
81fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
82fa7767c5Sopenharmony_ci}
83fa7767c5Sopenharmony_ci
84fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_5, TestSize.Level1)
85fa7767c5Sopenharmony_ci{
86fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0x2A, 0xE6};
87fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
88fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
89fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
90fa7767c5Sopenharmony_ci}
91fa7767c5Sopenharmony_ci
92fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_6, TestSize.Level1)
93fa7767c5Sopenharmony_ci{
94fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0x8A, 0xE6};
95fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
96fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
97fa7767c5Sopenharmony_ci    EXPECT_EQ(true, status);
98fa7767c5Sopenharmony_ci}
99fa7767c5Sopenharmony_ci
100fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_7, TestSize.Level1)
101fa7767c5Sopenharmony_ci{
102fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b00000000, 0b00000000};
103fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
104fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
105fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
106fa7767c5Sopenharmony_ci}
107fa7767c5Sopenharmony_ci
108fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_8, TestSize.Level1)
109fa7767c5Sopenharmony_ci{
110fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b00010001, 0b10001001};
111fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
112fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
113fa7767c5Sopenharmony_ci    EXPECT_EQ(true, status);
114fa7767c5Sopenharmony_ci}
115fa7767c5Sopenharmony_ci
116fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_9, TestSize.Level1)
117fa7767c5Sopenharmony_ci{
118fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b00011010, 0b10010010};
119fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
120fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
121fa7767c5Sopenharmony_ci    EXPECT_EQ(true, status);
122fa7767c5Sopenharmony_ci}
123fa7767c5Sopenharmony_ci
124fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_10, TestSize.Level1)
125fa7767c5Sopenharmony_ci{
126fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b00100011, 0b00011011};
127fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
128fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
129fa7767c5Sopenharmony_ci    EXPECT_EQ(true, status);
130fa7767c5Sopenharmony_ci}
131fa7767c5Sopenharmony_ci
132fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_11, TestSize.Level1)
133fa7767c5Sopenharmony_ci{
134fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b00001100, 0b10100100};
135fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
136fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
137fa7767c5Sopenharmony_ci    EXPECT_EQ(true, status);
138fa7767c5Sopenharmony_ci}
139fa7767c5Sopenharmony_ci
140fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_12, TestSize.Level1)
141fa7767c5Sopenharmony_ci{
142fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b10000110, 0b10101101};
143fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
144fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
145fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
146fa7767c5Sopenharmony_ci}
147fa7767c5Sopenharmony_ci
148fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_13, TestSize.Level1)
149fa7767c5Sopenharmony_ci{
150fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b10000111, 0b10110110};
151fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
152fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
153fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
154fa7767c5Sopenharmony_ci}
155fa7767c5Sopenharmony_ci
156fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_14, TestSize.Level1)
157fa7767c5Sopenharmony_ci{
158fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b10000111, 0b01011111};
159fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
160fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
161fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
162fa7767c5Sopenharmony_ci}
163fa7767c5Sopenharmony_ci
164fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_15, TestSize.Level1)
165fa7767c5Sopenharmony_ci{
166fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0b10000111, 0b01100101};
167fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
168fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
169fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
170fa7767c5Sopenharmony_ci}
171fa7767c5Sopenharmony_ci
172fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_16, TestSize.Level1)
173fa7767c5Sopenharmony_ci{
174fa7767c5Sopenharmony_ci    const uint8_t config[1] = {0xFA};
175fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 1);
176fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
177fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
178fa7767c5Sopenharmony_ci}
179fa7767c5Sopenharmony_ci
180fa7767c5Sopenharmony_ciHWTEST(AACAudioConfigParserTest, test_aac_audio_config_parser_17, TestSize.Level1)
181fa7767c5Sopenharmony_ci{
182fa7767c5Sopenharmony_ci    const uint8_t config[2] = {0xFA, 0xE6};
183fa7767c5Sopenharmony_ci    AACAudioConfigParser aacAudioConfigParser(config, 2);
184fa7767c5Sopenharmony_ci    bool status = aacAudioConfigParser.ParseConfigs();
185fa7767c5Sopenharmony_ci    EXPECT_EQ(false, status);
186fa7767c5Sopenharmony_ci}
187fa7767c5Sopenharmony_ci
188fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testAVStrError, TestSize.Level1)
189fa7767c5Sopenharmony_ci{
190fa7767c5Sopenharmony_ci    const int number = 1;
191fa7767c5Sopenharmony_ci    auto res = AVStrError(number);
192fa7767c5Sopenharmony_ci    ASSERT_STREQ(res.c_str(), "No error information");
193fa7767c5Sopenharmony_ci}
194fa7767c5Sopenharmony_ci
195fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testConvertTimeFromFFmpeg, TestSize.Level1)
196fa7767c5Sopenharmony_ci{
197fa7767c5Sopenharmony_ci    int64_t number = 1000;
198fa7767c5Sopenharmony_ci    AVRational rational = av_make_q(1000, 500);
199fa7767c5Sopenharmony_ci    auto res = ConvertTimeFromFFmpeg(number, rational);
200fa7767c5Sopenharmony_ci    ASSERT_EQ(res, 2000000000000);
201fa7767c5Sopenharmony_ci    number = ((int64_t)UINT64_C(0x8000000000000000));
202fa7767c5Sopenharmony_ci    auto res2 = ConvertTimeFromFFmpeg(number, rational);
203fa7767c5Sopenharmony_ci    ASSERT_EQ(res2, -1);
204fa7767c5Sopenharmony_ci}
205fa7767c5Sopenharmony_ci
206fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testConvertTimeToFFmpeg, TestSize.Level1)
207fa7767c5Sopenharmony_ci{
208fa7767c5Sopenharmony_ci    int64_t number = 1045566545;
209fa7767c5Sopenharmony_ci    AVRational rational = av_make_q(0, 50);
210fa7767c5Sopenharmony_ci    auto res = ConvertTimeToFFmpeg(number, rational);
211fa7767c5Sopenharmony_ci    ASSERT_EQ(res, ((int64_t)UINT64_C(0x8000000000000000)));
212fa7767c5Sopenharmony_ci    rational = av_make_q(10, 500);
213fa7767c5Sopenharmony_ci    auto res2 = ConvertTimeToFFmpeg(number, rational);
214fa7767c5Sopenharmony_ci    ASSERT_EQ(res2, 52);
215fa7767c5Sopenharmony_ci}
216fa7767c5Sopenharmony_ci
217fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testFillAVPicture, TestSize.Level1)
218fa7767c5Sopenharmony_ci{
219fa7767c5Sopenharmony_ci    AVFrame* frame = av_frame_alloc();
220fa7767c5Sopenharmony_ci    uint8_t ptr = 10;
221fa7767c5Sopenharmony_ci    auto res = FillAVPicture(frame, &ptr, AVPixelFormat::AV_PIX_FMT_ABGR, 1920, 1080);
222fa7767c5Sopenharmony_ci    ASSERT_EQ(res, 0);
223fa7767c5Sopenharmony_ci}
224fa7767c5Sopenharmony_ci
225fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testGetAVPictureSize, TestSize.Level1)
226fa7767c5Sopenharmony_ci{
227fa7767c5Sopenharmony_ci    AVPixelFormat format = AVPixelFormat::AV_PIX_FMT_ABGR;
228fa7767c5Sopenharmony_ci    int height = 1920;
229fa7767c5Sopenharmony_ci    int width = 1080;
230fa7767c5Sopenharmony_ci    auto res = GetAVPictureSize(format, height, width);
231fa7767c5Sopenharmony_ci    ASSERT_EQ(res, 0);
232fa7767c5Sopenharmony_ci}
233fa7767c5Sopenharmony_ci
234fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testRemoveDelimiter, TestSize.Level1)
235fa7767c5Sopenharmony_ci{
236fa7767c5Sopenharmony_ci    const char* str = "hello";
237fa7767c5Sopenharmony_ci    char ch = 'o';
238fa7767c5Sopenharmony_ci    auto res = RemoveDelimiter(str, ch);
239fa7767c5Sopenharmony_ci    ASSERT_STREQ(res.c_str(), "hell");
240fa7767c5Sopenharmony_ci}
241fa7767c5Sopenharmony_ci
242fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testRemoveDelimiter2, TestSize.Level1)
243fa7767c5Sopenharmony_ci{
244fa7767c5Sopenharmony_ci    std::string str = "hello";
245fa7767c5Sopenharmony_ci    char ch = 'l';
246fa7767c5Sopenharmony_ci    RemoveDelimiter(ch, str);
247fa7767c5Sopenharmony_ci    ASSERT_STREQ(str.c_str(), "heo");
248fa7767c5Sopenharmony_ci}
249fa7767c5Sopenharmony_ci
250fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testReplaceDelimiter, TestSize.Level1)
251fa7767c5Sopenharmony_ci{
252fa7767c5Sopenharmony_ci    std::string limit = "he";
253fa7767c5Sopenharmony_ci    char ch = 'e';
254fa7767c5Sopenharmony_ci    std::string str = "hello";
255fa7767c5Sopenharmony_ci    ReplaceDelimiter(limit, ch, str);
256fa7767c5Sopenharmony_ci    ASSERT_STREQ(str.c_str(), "eeeee");
257fa7767c5Sopenharmony_ci    char ch2 = 'o';
258fa7767c5Sopenharmony_ci    std::string str2 = "hello";
259fa7767c5Sopenharmony_ci    ReplaceDelimiter(limit, ch2, str2);
260fa7767c5Sopenharmony_ci    ASSERT_STREQ(str2.c_str(), "hello");
261fa7767c5Sopenharmony_ci}
262fa7767c5Sopenharmony_ci
263fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testSplitString, TestSize.Level1)
264fa7767c5Sopenharmony_ci{
265fa7767c5Sopenharmony_ci    const char* limit = "hello";
266fa7767c5Sopenharmony_ci    char ch = 'l';
267fa7767c5Sopenharmony_ci    std::vector<std::string> res = SplitString(limit, ch);
268fa7767c5Sopenharmony_ci    ASSERT_EQ(res.size(), 1);
269fa7767c5Sopenharmony_ci    ASSERT_STREQ(res[0].c_str(), "he");
270fa7767c5Sopenharmony_ci}
271fa7767c5Sopenharmony_ci
272fa7767c5Sopenharmony_ciHWTEST(UtilsTest, testConvertChannelLayoutFromFFmpeg, TestSize.Level1)
273fa7767c5Sopenharmony_ci{
274fa7767c5Sopenharmony_ci    for (int index = 0; index <= 24; index++) {
275fa7767c5Sopenharmony_ci        auto res = ConvertChannelLayoutFromFFmpeg(index, 0);
276fa7767c5Sopenharmony_ci        switch (index) {
277fa7767c5Sopenharmony_ci            case 1:
278fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::MONO, res);
279fa7767c5Sopenharmony_ci                break;
280fa7767c5Sopenharmony_ci            case 2:
281fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::STEREO, res);
282fa7767c5Sopenharmony_ci                break;
283fa7767c5Sopenharmony_ci            case 4:
284fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_4POINT0, res);
285fa7767c5Sopenharmony_ci                break;
286fa7767c5Sopenharmony_ci            case 6:
287fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_5POINT1, res);
288fa7767c5Sopenharmony_ci                break;
289fa7767c5Sopenharmony_ci            case 8:
290fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_5POINT1POINT2, res);
291fa7767c5Sopenharmony_ci                break;
292fa7767c5Sopenharmony_ci            case 10:
293fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_7POINT1POINT2, res);
294fa7767c5Sopenharmony_ci                break;
295fa7767c5Sopenharmony_ci            case 12:
296fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_7POINT1POINT4, res);
297fa7767c5Sopenharmony_ci                break;
298fa7767c5Sopenharmony_ci            case 14:
299fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_9POINT1POINT4, res);
300fa7767c5Sopenharmony_ci                break;
301fa7767c5Sopenharmony_ci            case 16:
302fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_9POINT1POINT6, res);
303fa7767c5Sopenharmony_ci                break;
304fa7767c5Sopenharmony_ci            case 24:
305fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::CH_22POINT2, res);
306fa7767c5Sopenharmony_ci                break;
307fa7767c5Sopenharmony_ci            default:
308fa7767c5Sopenharmony_ci                ASSERT_EQ(AudioChannelLayout::UNKNOWN, res);
309fa7767c5Sopenharmony_ci                break;
310fa7767c5Sopenharmony_ci        }
311fa7767c5Sopenharmony_ci    }
312fa7767c5Sopenharmony_ci}
313fa7767c5Sopenharmony_ci
314fa7767c5Sopenharmony_ci} // namespace Test
315fa7767c5Sopenharmony_ci} // namespace Media
316fa7767c5Sopenharmony_ci} // namespace OHOS