Fix to check SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE feature
[platform/core/api/system-settings.git] / tests / mocks / system_info.c
index c52197d..927c8a8 100644 (file)
 #include <string.h>
 #include <dlfcn.h>
 #include <stdbool.h>
+#include <tizen.h>
 #include "sst.h"
+#include "sstt_mock.h"
+
+static bool sstm_system_info_get_platform_string_enable = true;
+static bool sstm_system_info_get_platform_bool_enable = true;
+
+API void sstm_system_info_get_platform_string_setup(bool enable)
+{
+       sstm_system_info_get_platform_string_enable = enable;
+}
+
+API void sstm_system_info_get_platform_bool_setup(bool enable)
+{
+       sstm_system_info_get_platform_bool_enable = enable;
+}
 
 API int system_info_get_platform_bool(const char *key, bool *value)
 {
+       if (false == sstm_system_info_get_platform_bool_enable)
+               return TIZEN_ERROR_IO_ERROR;
+
        if (0 == strcmp(key, "tizen.org/feature/systemsetting.font")) {
                *value = true;
                return 0;
@@ -41,6 +59,10 @@ API int system_info_get_platform_bool(const char *key, bool *value)
                *value = true;
                return 0;
        }
+       if (0 == strcmp(key, "tizen.org/feature/network.ethernet")) {
+               *value = true;
+               return 0;
+       }
        if (0 == strcmp(key, "tizen.org/feature/network.wifi")) {
                *value = true;
                return 0;
@@ -69,8 +91,11 @@ API int system_info_get_platform_bool(const char *key, bool *value)
 
 API int system_info_get_platform_string(const char *key, char **value)
 {
+       if (false == sstm_system_info_get_platform_string_enable)
+               return TIZEN_ERROR_IO_ERROR;
+
        if (0 == strcmp(key, "tizen.org/feature/profile")) {
-               *value = strdup("mobile");
+               *value = strdup("wearable");
                return 0;
        }