Fix to check SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE feature
[platform/core/api/system-settings.git] / tests / sst_gtest_err_interface.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #include <string.h>
18 #include <glib.h>
19 #include <gtest/gtest.h>
20 #include <vconf.h>
21
22 #include "system_settings.h"
23 #include "mocks/sstt_mock.h"
24
25 extern "C" {
26 #include "sst_interface.h"
27 #include "sst.h"
28 }
29
30 TEST(SstInterfaceTest, getInterfaceERR)
31 {
32         system_settings_key_e key[] = {
33                 SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN,
34                 SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN,
35                 SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
36                 SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
37                 SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,
38                 SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE,
39                 SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,
40                 SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE,
41                 SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE,
42                 SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE,
43                 SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR,
44                 SYSTEM_SETTINGS_KEY_ROTARY_EVENT_ENABLED
45         };
46         int cnt = sizeof(key) / sizeof(system_settings_key_e);
47         sst_interface *iface;
48
49         sstm_system_info_get_platform_string_setup(false);
50         sstm_system_info_get_platform_bool_setup(false);
51         for (int i = 0; i < cnt; i++) {
52                 int ret = sst_get_interface(key[i], &iface);
53                 EXPECT_EQ(SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED, ret);
54         }
55         sstm_system_info_get_platform_string_setup(true);
56         sstm_system_info_get_platform_bool_setup(true);
57 }
58