2 * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "libmm_sound_unittest.h"
21 using ::testing::InitGoogleTest;
22 using ::testing::Test;
23 using ::testing::TestCase;
27 // MMSoundVolumeTest TestSuite
28 class MMSoundVolumeTest : public ::testing::Test
32 cout << "SetUp()" << endl;
36 cout << "TearDown()" << endl;
40 TEST_F(MMSoundVolumeTest, volume_get_value_p)
42 int ret = MM_ERROR_NONE;
45 ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &vol);
46 EXPECT_EQ(ret, MM_ERROR_NONE);
47 cout << "volume : " << vol << endl;
50 TEST_F(MMSoundVolumeTest, volume_get_value_n)
52 int ret = MM_ERROR_NONE;
54 ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, NULL);
55 EXPECT_EQ(ret, MM_ERROR_INVALID_ARGUMENT);
58 // MMSoundDeviceTest TestSuite
59 class MMSoundDeviceTest : public ::testing::Test
63 cout << "SetUp()" << endl;
67 cout << "TearDown()" << endl;
71 TEST_F(MMSoundDeviceTest, device_get_list_p)
73 int ret = MM_ERROR_NONE;
74 MMSoundDeviceList_t device_list;
76 ret = mm_sound_get_device_list(MM_SOUND_DEVICE_ALL_FLAG, &device_list);
78 EXPECT_EQ(ret, MM_ERROR_NONE);
80 mm_sound_free_device_list(device_list);
83 TEST_F(MMSoundDeviceTest, device_get_list_n)
85 int ret = MM_ERROR_NONE;
87 ret = mm_sound_get_device_list(MM_SOUND_DEVICE_ALL_FLAG, NULL);
89 EXPECT_EQ(ret, MM_ERROR_INVALID_ARGUMENT);
94 int main(int argc, char **argv)
96 InitGoogleTest(&argc, argv);
98 return RUN_ALL_TESTS();