2 * Copyright (c) 2020 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.
19 #include <gtest/gtest.h>
22 #include "system_settings.h"
23 #include "mocks/sstt_mock.h"
26 #include "sst_interface.h"
30 #define SST_DEPRECATED_KEY ((int)SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED + 1)
32 TEST(SstInterfaceTest, getInterfaceOk)
35 int key = (int)SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE;
37 sstm_system_info_get_platform_string_setup(true);
38 sstm_system_info_get_platform_bool_setup(true);
40 for ( ; key < (int)SYSTEM_SETTINGS_KEY_MAX; key++) {
41 if (key == SST_DEPRECATED_KEY) {
44 int ret = sst_get_interface((system_settings_key_e)key, &iface);
45 EXPECT_TRUE((SYSTEM_SETTINGS_ERROR_NONE == ret) || (SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED == ret));
49 TEST(SstInterfaceTest, getInterfaceERRInput)
52 int ret = sst_get_interface(SYSTEM_SETTINGS_KEY_MAX, &iface);
53 EXPECT_EQ(SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER, ret);
55 ret = sst_get_interface((system_settings_key_e)SST_DEPRECATED_KEY, &iface);
56 EXPECT_EQ(SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER, ret);