SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
+ ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/unit_test)
ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SYSTEM_SETTINGS_UTIL}/include)
)
IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
- INCLUDE(FindPkgConfig)
- INCLUDE(FindPkgConfig)
- pkg_check_modules(${unit_test} REQUIRED ${requires} elementary ecore)
- FOREACH(flag ${${unit_test}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
- ENDFOREACH(flag)
- ADD_EXECUTABLE(${unit_test} src/system_setting_unittest.c)
- TARGET_LINK_LIBRARIES(${unit_test} ${fw_name})
- INSTALL(TARGETS ${unit_test} DESTINATION /usr/local/bin)
-
-
# Coverage Testing
INSTALL(
DIRECTORY "CMakeFiles" DESTINATION /usr/src/packages/BUILD/capi-system-system-settings-${FULLVER}
RELEASE=`echo %{version} | grep Version: | awk '{ print $2 }'`
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-
cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DCMAKE_LIBDIR=%{_libdir} \
-DCMAKE_INCLUDEDIR=%{_includedir} \
-DTZ_SYS_DATA=%{TZ_SYS_DATA} \
-DTZ_SYS_RO_SHARE=%{TZ_SYS_RO_SHARE} \
-DTZ_SYS_SHARE=%{TZ_SYS_SHARE} \
-DSETTING_DEF_RES=%{TZ_SYS_GLOBALUSER_DATA}/settings \
+%if 0%{?thread_number}
+ -DN_THREADS=%{thread_number} \
+%endif
%if "%{run_tests}" == "1"
-DCMAKE_BUILD_TYPE=UNITTEST \
-DUNIT_TEST=1 \
# add empty line
%endif
+
make %{?jobs:-j%jobs}
%install
}
+/* LCOV_EXCL_START */
static int _compare_cb(const void *d1, const void *d2)
{
fileNodeInfo *pNode1 = (fileNodeInfo *)d1;
return strcmp(pNode1->media_name, pNode2->media_name);
}
+/* LCOV_EXCL_STOP */
/*
* get the RINGTONE list
system_setting_set_ad_id(key, uuid_unparsed); //example of setting the value
}
#endif
-/* LCOV_EXCL_START */
int system_setting_set_ads_id(system_settings_key_e key, void *value)
{
SETTING_TRACE_BEGIN;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
int system_setting_set_changed_callback_ads_id(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, 2);
}
-#ifdef UNIT_TEST
-static void simple_test_case(void)
-{
- /* a suitable test */
- g_assert(g_bit_storage(1) == 1);
-
- /* a test with verbose error message */
- g_assert_cmpint(g_bit_storage(1), ==, 1);
-}
-
-static void simple_test_case02(void)
-{
- /* a suitable test */
- g_assert(g_bit_storage(1) == 1);
-
- /* a test with verbose error message */
- g_assert_cmpint(g_bit_storage(1), ==, 1);
-}
-void unittest_platform()
-{
- /* hook up your test functions */
- g_test_add_func("/Simple Test Case", simple_test_case);
- g_test_add_func("/Simple Test Case02", simple_test_case02);
- /* run tests from the suite */
-}
-#endif
+++ /dev/null
-#include <glib.h>
-#include <Elementary.h>
-
-extern void unittest_platform();
-extern void unittest_api();
-
-int main(int argc, char* argv[])
-{
- ecore_evas_init();
-
- g_test_init(&argc, &argv, NULL);
- g_test_set_nonfatal_assertions();
- unittest_platform();
- unittest_api();
-
- return g_test_run();
-}
#define SYSTEM_SETTINGS_MAX -1
-
-
system_setting_s system_setting_table[] = {
{
return -1;
}
-
/* LCOV_EXCL_STOP */
int system_settings_get_item(system_settings_key_e key, system_setting_h *item)
int system_settings_set_value_string(system_settings_key_e key, const char *value)
{
LOGE("Enter [%s]", __FUNCTION__);
- if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key)) {
+ if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- }
-
if (key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
char *vconf_string = NULL;
system_setting_h system_setting_item;
- if (callback == NULL) {
+ if (callback == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- }
if (key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
char *vconf_string = NULL;
system_setting_h system_setting_item;
- if (callback == NULL)
+ if (callback == NULL) {
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+ }
- if (key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)
+ if (key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE) {
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
+ }
int ret = system_settings_get_item(key, &system_setting_item);
if (ret != 0) {
return system_settings_del_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void *)value);
}
-///////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef UNIT_TEST
-
-static int my_assert_ret(int retcode)
-{
- if (retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) {
- g_assert_cmpint(retcode, ==, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
- } else {
- g_assert_cmpint(retcode, ==, SYSTEM_SETTINGS_ERROR_NONE);
- }
- return 1;
-}
-
-static GMainLoop* multi_main_loop = NULL;
-static bool _callback_called = false;
-//static char *new_ringtonepath = "/usr/apps/org.tizen.setting/shared/res/settings/Ringtones/Basic_Bell.ogg";
-static char *new_ringtonepath = "/opt/usr/data/settings/Ringtones/ringtone_sdk.mp3";
-
-/**
- * @function utc_system_settings_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-static void utc_system_settings_startup(void)
-{
-}
-
-/**
- * @function utc_system_settings_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-static void utc_system_settings_cleanup(void)
-{
-}
-
-
-static gboolean timeout_callback(gpointer data)
-{
- _callback_called = false;
- /*g_main_loop_quit(main_loop);*/
- return FALSE;
-}
-
-
-static void utc_system_settings_changed_callback(system_settings_key_e key, void *user_data)
-{
- _callback_called = true;
- /*g_main_loop_quit(main_loop);*/
-}
-
-/**
- * TEST GETTING SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE
- */
-/**
- * @testcase utc_system_settings_get_value_string_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is able to get the property
- */
-static void utc_system_settings_get_value_string_p1(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, &value);
- //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-/**
- * TEST GETTING SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY
- */
-/**
- * @testcase utc_system_settings_get_value_string_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to get the property
- */
-static void utc_system_settings_get_value_string_p2(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &value);
- //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-/**
- * TEST GETTING SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE
- */
-/**
- * @testcase utc_system_settings_get_value_string_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to get the property
- */
-static void utc_system_settings_get_value_string_p3(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &value);
- //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-/**
- * TEST GETTING SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE
- */
-/**
- * @testcase utc_system_settings_get_value_string_p4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to get the property
- */
-static void utc_system_settings_get_value_string_p4(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &value);
- //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-/**
- * TEST SETTING SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN
- */
-/**
- * @testcase utc_system_settings_get_value_string_p5
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to get the property.
- */
-static void utc_system_settings_get_value_string_p5(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &value);
- //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-/**
- * @testcase utc_system_settings_get_value_string_p11
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to get the property.
- */
-static void utc_system_settings_get_value_string_p11(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEVICE_NAME, &value);
- //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_string_p7
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to get the property.
- */
-static void utc_system_settings_get_value_string_p7(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &value);
- my_assert_ret(retcode);
- free(value);
-}
-
-/**
- * @testcase utc_system_settings_get_value_string_p6
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEZON is able to get the property.
- */
-static void utc_system_settings_get_value_string_p6(void)
-{
- char *value = NULL;
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &value);
- my_assert_ret(retcode);
- free(value);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_string_p10
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to get the property.
- */
-static void utc_system_settings_get_value_string_p10(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &value);
- my_assert_ret(retcode);
- if (retcode == SYSTEM_SETTINGS_ERROR_NONE)
- g_assert(value != NULL);
- free(value);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_string_p8
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to get the property.
- */
-static void utc_system_settings_get_value_string_p8(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &value);
- my_assert_ret(retcode);
- g_assert(value != NULL);
- free(value);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_string_p9
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to get the property.
- */
-static void utc_system_settings_get_value_string_p9(void)
-{
- char *value = NULL;
-
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, &value);
- my_assert_ret(retcode);
- if (retcode == SYSTEM_SETTINGS_ERROR_NONE)
- g_assert(value != NULL);
- free(value);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_string_n
- * @since_tizen 2.3
- * @description check if system_settings_get_value_string is able to handle invalid parameters.
- */
-static void utc_system_settings_get_value_string_n(void)
-{
- int retcode = system_settings_get_value_string(-1, NULL);
- //assert_neq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- g_assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p1(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p2(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p3(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p4(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &value);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p5
- * @since_tizen 2.3
- * check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p5(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p6
- * @since_tizen 2.3
- * check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p6(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p7
- * @since_tizen 2.3
- * check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p7(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p8
- * @since_tizen 2.3
- * check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p8(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p9
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p9(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p10
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to get the property.
- */
-static void utc_system_settings_get_value_bool_p10(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_n
- * @since_tizen 2.3
- * @description check if system_settings_get_value_bool is able to handle invalid parameters.
- */
-static void utc_system_settings_get_value_bool_n(void)
-{
- int retcode = system_settings_get_value_bool(-1, NULL);
- //assert_neq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- g_assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_int_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to get the property.
- */
-static void utc_system_settings_get_value_int_p1(void)
-{
- int value = 0;
-
- int retcode = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_int_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to get the property.
- */
-static void utc_system_settings_get_value_int_p2(void)
-{
- int font_size = 0;
-
- int retcode = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &font_size);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_n
- * @since_tizen 2.3
- * @description check if system_settings_get_value_int is able to handle invalid parameters.
- */
-static void utc_system_settings_get_value_n(void)
-{
- int retcode = system_settings_get_value_int(-1, NULL);
- //assert_neq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
- g_assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_int_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to get the property.
- */
-static void utc_system_settings_get_value_int_p3(void)
-{
- int value;
- int nRetVal = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, &value);
- my_assert_ret(nRetVal);
-}
-
-
-/**
- * @testcase utc_system_settings_get_value_bool_p11
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to get the property
- */
-static void utc_system_settings_get_value_bool_p11(void)
-{
- bool value = false;
-
- int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &value);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p1(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p1(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p2(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p2(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p3(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p3(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p4(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_LOCK_SCREEN_unset_changed_cb_p
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_WALLPAPER is able to unset the callback for change-notification.
- */
-static void utc_system_settings_LOCK_SCREEN_unset_changed_cb_p(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p5
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p5(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p4(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p6
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p6(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p5
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p5(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE,
- utc_system_settings_changed_callback, NULL);
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p7
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p7(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p6
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p6(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p8
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p8(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p7
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p7(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p9
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to set callback for getting notification of change
- */
-static void utc_system_settings_set_changed_cb_p9(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p8
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p8(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p10
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP is able to set callback for getting notification of change
- */
-static void utc_system_settings_set_changed_cb_p10(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p9
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p9(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p11
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to set callback for getting notification of change
- */
-static void utc_system_settings_set_changed_cb_p11(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p10
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to set callback for getting notification of change and unset doing
- */
-static void utc_system_settings_unset_changed_cb_p10(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p12
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p12(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p11
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p11(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p13
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p13(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR
- */
-/**
- * @testcase utc_system_settings_unset_changed_cb_p12
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p12(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p14
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p14(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p13
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p13(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p15
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p15(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p14
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p14(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p16
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p16(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p15
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p15(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p17
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p17(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p16
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p16(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p18
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p18(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p17
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p17(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p19
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p19(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p18
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p18(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p20
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p20(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p19
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p19(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p21
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p21(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p20
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p20(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p22
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p22(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p21
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p21(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p23
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p23(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p22
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p22(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p24
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p24(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p23
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p23(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p25
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p25(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p24
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p24(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION);
- my_assert_ret(retcode);
-}
-
-
-
-/**
- * @testcase utc_system_settings_set_value_string_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to get the property
- */
-static void utc_system_settings_set_value_string_p1(void)
-{
- int ret;
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, new_ringtonepath);
- my_assert_ret(ret);
-
- char *ret_ringtonepath = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &ret_ringtonepath);
- my_assert_ret(ret);
-
- if (ret_ringtonepath != NULL && 0 == strcmp(ret_ringtonepath, new_ringtonepath)) {
- g_assert(1);
- } else {
- g_assert(0);
- }
- return;
-}
-
-
-/**
- * TEST SETTING SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN
- */
-/**
- * @testcase utc_system_settings_set_value_string_n2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to set the property in error-case.
- */
-static void utc_system_settings_set_value_string_n2(void)
-{
- int ret;
- char *wallpaper = NULL;
-
- char *wrong_wallpaper_path = "/wrongpath/aaa.png";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, wrong_wallpaper_path);
- g_assert(ret != SYSTEM_SETTINGS_ERROR_NONE);
-
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &wallpaper);
- g_assert(ret == SYSTEM_SETTINGS_ERROR_NONE);
- free(wallpaper);
- return;
-}
-
-/**
- * SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN
- */
-/**
- * @testcase utc_system_settings_set_value_string_n3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to set the property in error-case.
- */
-static void utc_system_settings_set_value_string_n3(void)
-{
- int ret;
- char *wallpaper = NULL;
-
- char *wrong_wallpaper_path = "/wrongpath/aaa.png";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, wrong_wallpaper_path);
- g_assert(ret != SYSTEM_SETTINGS_ERROR_NONE);
-
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &wallpaper);
- //assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
- free(wallpaper);
- return;
-}
-
-/**
- * SYSTEM_SETTINGS_KEY_FONT_TYPE
- */
-/**
- * @testcase utc_system_settings_set_value_string_n4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to set the property in error-case.
- */
-static void utc_system_settings_set_value_string_n4(void)
-{
- int ret;
-
- char *wrong_font_name = "WrongFontName";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, wrong_font_name);
- g_assert(ret != SYSTEM_SETTINGS_ERROR_NONE);
-
- char *font_name = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &font_name);
- //assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
- free(font_name);
- return;
-}
-
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_n1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to set the property in a normal-case.
- */
-static void utc_system_settings_set_value_bool_n1(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, &ret_state);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_n2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_bool_n2(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &ret_state);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_n3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_bool_n3(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, &ret_state);
- my_assert_ret(ret);
- return;
-}
-
-/**
- * @testcase utc_system_settings_set_value_bool_n4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_bool_n4(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &ret_state);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_n5
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_bool_n5(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, &ret_state);
- my_assert_ret(ret);
- return;
-}
-
-/**
- * @testcase utc_system_settings_set_value_bool_n6
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_bool_n6(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS , state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS , &ret_state);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_string_n8
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_string_n8(void)
-{
- int ret;
- char *new_font = "DefaultFontName";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, new_font);
- //my_assert_ret(ret);
- g_assert_cmpint(ret, !=, SYSTEM_SETTINGS_ERROR_NONE);
-
- char *ret_font = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, &ret_font);
- g_assert_cmpint(ret, ==, SYSTEM_SETTINGS_ERROR_NONE);
- return;
-
-#if 0
- int ret;
- char *new_font = "DefaultFontName";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, new_font);
- //assert_eq(ret, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
-
- char *ret_font = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, &ret_font);
- int ret2 = my_assert_ret(ret);
- return ret2;
- //return;
-#endif
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_string_n7
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_string_n7(void)
-{
- int ret;
- char *new_zone = "Asia/Seoul";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, new_zone);
- my_assert_ret(ret);
-
- char *ret_device = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &ret_device);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_int_n1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_int_n1(void)
-{
- int ret;
- int value = 3600;
- ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_TIME_CHANGED, value);
- my_assert_ret(ret);
-
- int time_changed;
- ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_TIME_CHANGED, &time_changed);
- my_assert_ret(ret);
-
- return;
-}
-
-
-/**
- * SYSTEM_SETTINGS_KEY_DEVICE_NAME
- * check_SYSTEM_SETTINGS_ERROR_CALL_UNSUPPORTED_API
- */
-/**
- * @testcase utc_system_settings_set_value_string_n5
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to set the property in an exceptional-case. (not supported)
- */
-static void utc_system_settings_set_value_string_n5(void)
-{
- int ret;
- char *new_device = "Tizen222";
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_DEVICE_NAME, new_device);
- my_assert_ret(ret);
-
- char *ret_device = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEVICE_NAME, &ret_device);
-
- if (ret_device != NULL && 0 == strcmp(ret_device, new_device)) {
- g_assert(0);
- } else {
- g_assert(1);
- }
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_string_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to set the property in a normal-case.
- */
-static void utc_system_settings_set_value_string_p2(void)
-{
- int ret;
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, new_ringtonepath);
- my_assert_ret(ret);
-
- char *ret_ringtonepath = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, &ret_ringtonepath);
-
- if (ret_ringtonepath != NULL && 0 == strcmp(ret_ringtonepath, new_ringtonepath)) {
- g_assert(1);
- } else {
- g_assert(0);
- }
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_string_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to set the property in a normal-case.
- */
-static void utc_system_settings_set_value_string_p3(void)
-{
- int ret;
- char *new_country = "ko_KR";
-
- /* backup */
- char *backup = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &backup);
- my_assert_ret(ret);
-
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, new_country);
- my_assert_ret(ret);
-
- char *ret_country = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &ret_country);
- my_assert_ret(ret);
-
- if (ret_country != NULL && 0 == strcmp(ret_country, new_country)) {
- g_assert(1);
- } else {
- g_assert(0);
- }
-
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, backup);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_string_p4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to get the property.
- * check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to set the property in a normal-case.
- */
-static void utc_system_settings_set_value_string_p4(void)
-{
- int ret;
- char *new_country = "ko_KR";
-
- /* backup */
- char *backup = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &backup);
- my_assert_ret(ret);
-
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, new_country);
- my_assert_ret(ret);
-
- char *ret_country = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &ret_country);
- my_assert_ret(ret);
-
- if (ret_country != NULL && 0 == strcmp(ret_country, new_country)) {
- g_assert(1);
- } else {
- g_assert(0);
- }
-
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, backup);
- my_assert_ret(ret);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to get the property.
- */
-static void utc_system_settings_set_value_bool_p1(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &ret_state);
- my_assert_ret(ret);
-
- //assert_eq(state, ret_state);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to get the property.
- */
-static void utc_system_settings_set_value_bool_p2(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &ret_state);
- my_assert_ret(ret);
-
- //assert_eq(state, ret_state);
-
- /* roll back */
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, !state);
- my_assert_ret(ret);
-
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &ret_state);
- //assert_eq(ret_state, !state);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_n
- * @since_tizen 2.3
- * @description check if system_settings_set_changed_cb is able to handle invalid parameters.
- */
-static void utc_system_settings_set_changed_cb_n(void)
-{
- int retcode = system_settings_set_changed_cb(-1, NULL, NULL);
- g_assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
- return;
-}
-
-
-
-/**
- * @testcase utc_system_settings_get_value_int_p4
- * @since_tizen 3.0
- * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to get the property.
- */
-static void utc_system_settings_get_value_int_p4(void)
-{
- int value = 0;
- int nRetVal = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, &value);
- my_assert_ret(nRetVal);
- return;
-}
-
-
-
-/**
- * @testcase utc_system_settings_set_value_int_p1
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to get the property.
- */
-static void utc_system_settings_set_value_int_p1(void)
-{
- int nRetVal = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 30);
- my_assert_ret(nRetVal);
-
- int value;
- nRetVal = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, &value);
- //assert_eq(value, 30);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_int_n2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to set the properties with exceptional cases.
- */
-static void utc_system_settings_set_value_int_n2(void)
-{
- int ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, -5);
- g_assert(ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
-
- ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 601);
- g_assert(ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
-
- ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 0);
- g_assert(ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_p3
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to get the property.
- */
-static void utc_system_settings_set_value_bool_p3(void)
-{
- int ret;
- bool state = true;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, state);
- my_assert_ret(ret);
-
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &ret_state);
- my_assert_ret(ret);
-
- //assert_eq(state, ret_state);
-
- /* roll back */
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, !state);
- my_assert_ret(ret);
-
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &ret_state);
- //assert_eq(ret_state, !state);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_p4
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to get the property.
- */
-static void utc_system_settings_set_value_bool_p4(void)
-{
- int ret;
-
- /* get current state */
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, &ret_state);
- my_assert_ret(ret);
-
-
- bool state = !ret_state;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, state);
- my_assert_ret(ret);
-
- /* roll back */
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, ret_state);
- my_assert_ret(ret);
-
- g_assert(state != ret_state);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_p5
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to get the property.
- */
-static void utc_system_settings_set_value_bool_p5(void)
-{
- int ret;
-
- /* get current state */
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, &ret_state);
- my_assert_ret(ret);
-
-
- bool state = !ret_state;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, state);
- my_assert_ret(ret);
-
-
- /* roll back */
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, ret_state);
- my_assert_ret(ret);
-
- g_assert(state != ret_state);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_bool_p6
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_VIBRATION is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_VIBRATION is able to get the property.
- */
-static void utc_system_settings_set_value_bool_p6(void)
-{
- int ret;
-
- /* get current state */
- bool ret_state = false;
- ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_VIBRATION, &ret_state);
- my_assert_ret(ret);
-
-
- bool state = !ret_state;
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_VIBRATION, state);
- my_assert_ret(ret);
-
-
- /* roll back */
- ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_VIBRATION, ret_state);
- my_assert_ret(ret);
-
- g_assert(state != ret_state);
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_int_p2
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to get the property.
- */
-static void utc_system_settings_set_value_int_p2(void)
-{
- int ret = -1;
- int backup;
- int arr[] = {
- SYSTEM_SETTINGS_FONT_SIZE_SMALL,
- SYSTEM_SETTINGS_FONT_SIZE_NORMAL,
- SYSTEM_SETTINGS_FONT_SIZE_LARGE,
- SYSTEM_SETTINGS_FONT_SIZE_HUGE,
- SYSTEM_SETTINGS_FONT_SIZE_GIANT
- };
-
- srand(time(NULL));
- int size = sizeof(arr)/sizeof(arr[0]);
- int sel = rand() % size;
-
- /* backup */
- ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &backup);
- my_assert_ret(ret);
-
- /* change font at random */
- ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, sel);
- my_assert_ret(ret);
-
- /* check if selection and result are identical. */
- int after;
- ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &after);
- //assert_eq(sel, after);
-
- /* roll back to backup */
- ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, backup);
- my_assert_ret(ret);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_set_value_string_n6
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the property.
- * check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to get the property.
- */
-static void utc_system_settings_set_value_string_n6(void)
-{
- int ret;
- ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, new_ringtonepath);
- my_assert_ret(ret);
- //assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
-
- char *ret_ringtonepath = NULL;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &ret_ringtonepath);
-
- if (ret_ringtonepath != NULL && 0 == strcmp(ret_ringtonepath, new_ringtonepath)) {
- my_assert_ret(0);
- } else {
- my_assert_ret(1);
- }
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_n
- * @since_tizen 2.3
- * @description check if system_settings_unset_changed_cb is able to handle invalid parameters.
- */
-static void utc_system_settings_unset_changed_cb_n(void)
-{
- int retcode = system_settings_unset_changed_cb(-1);
- g_assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
- return;
-}
-
-
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p27
- * @since_tizen 3.0
- * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p27(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p26
- * @since_tizen 3.0
- * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p26(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE);
- my_assert_ret(retcode);
-
- return;
-}
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p29
- * @since_tizen 3.0
- * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p29(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p28
- * @since_tizen 3.0
- * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p28(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST);
- my_assert_ret(retcode);
-
- return;
-}
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p31
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p31(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p30
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p30(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS);
- my_assert_ret(retcode);
-
- return;
-}
-
-/**
- * @testcase utc_system_settings_set_changed_cb_p33
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_VIBRATION is able to set the callback for change-notification.
- */
-static void utc_system_settings_set_changed_cb_p33(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_VIBRATION,
- utc_system_settings_changed_callback, NULL);
- my_assert_ret(retcode);
-
- return;
-}
-
-
-/**
- * @testcase utc_system_settings_unset_changed_cb_p32
- * @since_tizen 2.3
- * @description check if SYSTEM_SETTINGS_KEY_VIBRATION is able to set the callback for change-notification.
- * check if SYSTEM_SETTINGS_KEY_VIBRATION is able to unset the callback for change-notification.
- */
-static void utc_system_settings_unset_changed_cb_p32(void)
-{
- int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_VIBRATION,
- utc_system_settings_changed_callback, NULL);
-
- retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_VIBRATION);
- my_assert_ret(retcode);
-
- return;
-}
-
-static int cb_count;
-static bool system_setting_get_ringtone_list_cb(int index, const char* data, void *user_data)
-{
- cb_count += 1;
-/* printf("%s\n", (char*)data); */
- return true;
-}
-
-static void utc_system_settings_add_ringtone_list_p1(void)
-{
- int retcode = -1;
- cb_count = 0;
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
- my_assert_ret(retcode);
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_foreach_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, system_setting_get_ringtone_list_cb, NULL);
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
- my_assert_ret(retcode);
- g_assert_cmpint(cb_count, ==, 5);
-
- return;
-}
-
-/**
- * @function utc_system_settings_delete_ringtone_list_p1_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-
-/* system_settings - del ringtone list */
-static void utc_system_settings_delete_ringtone_list_p1(void)
-{
- int retcode = -1;
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
- my_assert_ret(retcode);
- retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
- my_assert_ret(retcode);
-
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
- my_assert_ret(retcode);
- retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
- my_assert_ret(retcode);
-
- return;
-}
-
-#include <unistd.h> /* to use sleep */
-static int call_cnt = 0;
-static void utc_system_settings_changed_multi_callback1(system_settings_key_e key, void *user_data)
-{
- call_cnt++;
-}
-
-static void utc_system_settings_changed_multi_callback2(system_settings_key_e key, void *user_data)
-{
- call_cnt++;
- sleep(1);
- g_main_loop_quit(multi_main_loop);
-}
-
-static void *test_multi_callback_thread(void *arg)
-{
- int retcode = system_settings_add_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_multi_callback1, NULL);
- my_assert_ret(retcode);
-
- retcode = system_settings_add_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_multi_callback1, NULL);
-
- /* not support same callback about 1 system-settings key */
- g_assert_cmpint(retcode, ==, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
-
- retcode = system_settings_add_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_multi_callback2, NULL);
-
- bool bk_state = false;
- system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR , &bk_state);
-
- bool state = true;
- system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR , state);
-
- sleep(1);
-
- my_assert_ret(retcode);
- retcode = system_settings_remove_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_multi_callback1);
- my_assert_ret(retcode);
- retcode = system_settings_remove_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
- utc_system_settings_changed_multi_callback2);
- my_assert_ret(retcode);
-
- system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR , bk_state);
-
-
-}
-/**
- * @testcase utc_system_settings_add_changed_cb_p1
- * @since_tizen 4.0
- * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the callback for change-notification.
- */
-static void utc_system_settings_add_changed_cb_p1(void)
-{
- multi_main_loop = g_main_loop_new(NULL, FALSE);
- pthread_t test_thread;
-
- pthread_create(&test_thread, NULL, test_multi_callback_thread, NULL);
- pthread_detach(test_thread);
-
- g_main_loop_run(multi_main_loop);
-
- g_assert_cmpint(call_cnt, ==, 2);
- return;
-}
-
-
-static void utc_system_settings_changed_callback_1(system_settings_key_e key, void *user_data)
-{
- _callback_called = true;
-}
-
-static void utc_system_settings_changed_callback_2(system_settings_key_e key, void *user_data)
-{
- _callback_called = true;
-}
-
-static void utc_system_settings_add_remove_changed_cb_p1(void)
-{
- int retcode = 0;
- int key_idx = 0;
-
- for (key_idx = SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE; key_idx < SYSTEM_SETTINGS_KEY_MAX ; key_idx++) {
-
- if (key_idx == SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED + 1)
- continue; /* skip removed system-setting key */
-
- if (key_idx == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)
- continue; /* skip removed system-setting key */
-
- retcode = system_settings_add_changed_cb(key_idx,
- utc_system_settings_changed_callback_1, NULL);
-
- if (retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) {
- g_assert_cmpint(retcode, ==, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
- } else {
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE)
- printf("ERROR !! key =%d , ret = %d\n", key_idx, retcode);
- }
-
- retcode = system_settings_remove_changed_cb(key_idx,
- utc_system_settings_changed_callback_1);
-
- if (retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) {
- g_assert_cmpint(retcode, ==, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
- } else {
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE)
- printf("ERROR !! key =%d , ret = %d\n", key_idx, retcode);
- }
-
- retcode = system_settings_add_changed_cb(key_idx,
- utc_system_settings_changed_callback_1, NULL);
- my_assert_ret(retcode);
-
- retcode = system_settings_add_changed_cb(key_idx,
- utc_system_settings_changed_callback_2, NULL);
- my_assert_ret(retcode);
-
- retcode = system_settings_remove_changed_cb(key_idx,
- utc_system_settings_changed_callback_1);
- my_assert_ret(retcode);
-
- retcode = system_settings_remove_changed_cb(key_idx,
- utc_system_settings_changed_callback_2);
- my_assert_ret(retcode);
- }
-
- return;
-}
-
-static void simple_test_case(void)
-{
- /* a suitable test */
- g_assert(g_bit_storage(1) == 1);
-
- /* a test with verbose error message */
- g_assert_cmpint(g_bit_storage(1), ==, 1);
-}
-
-void unittest_api()
-{
- /* hook up your test functions */
- g_test_add_func("/API Test Case", simple_test_case);
- g_test_add_func("/utc_system_settings_add_changed_cb_p1", utc_system_settings_add_changed_cb_p1);
- g_test_add_func("/utc_system_settings_add_remove_changed_cb_p1", utc_system_settings_add_remove_changed_cb_p1);
- g_test_add_func("/utc_system_settings_get_value_string_p1", utc_system_settings_get_value_string_p1);
- g_test_add_func("/utc_system_settings_get_value_string_p2", utc_system_settings_get_value_string_p2);
- g_test_add_func("/utc_system_settings_get_value_string_p3", utc_system_settings_get_value_string_p3);
- g_test_add_func("/utc_system_settings_get_value_string_p4", utc_system_settings_get_value_string_p4);
- g_test_add_func("/utc_system_settings_get_value_string_p5", utc_system_settings_get_value_string_p5);
- g_test_add_func("/utc_system_settings_get_value_string_p7", utc_system_settings_get_value_string_p7);
- g_test_add_func("/utc_system_settings_get_value_string_p6", utc_system_settings_get_value_string_p6);
- g_test_add_func("/utc_system_settings_get_value_string_p10", utc_system_settings_get_value_string_p10);
- g_test_add_func("/utc_system_settings_get_value_string_p8", utc_system_settings_get_value_string_p8);
- g_test_add_func("/utc_system_settings_get_value_string_p9", utc_system_settings_get_value_string_p9);
- g_test_add_func("/utc_system_settings_get_value_string_p11", utc_system_settings_get_value_string_p11);
- g_test_add_func("/utc_system_settings_get_value_string_n", utc_system_settings_get_value_string_n);
- g_test_add_func("/utc_system_settings_get_value_bool_p1", utc_system_settings_get_value_bool_p1);
- g_test_add_func("/utc_system_settings_get_value_bool_p2", utc_system_settings_get_value_bool_p2);
- g_test_add_func("/utc_system_settings_get_value_bool_p3", utc_system_settings_get_value_bool_p3);
- g_test_add_func("/utc_system_settings_get_value_bool_p4", utc_system_settings_get_value_bool_p4);
- g_test_add_func("/utc_system_settings_get_value_bool_p5", utc_system_settings_get_value_bool_p5);
- g_test_add_func("/utc_system_settings_get_value_bool_p6", utc_system_settings_get_value_bool_p6);
- g_test_add_func("/utc_system_settings_get_value_bool_p7", utc_system_settings_get_value_bool_p7);
- g_test_add_func("/utc_system_settings_get_value_bool_p8", utc_system_settings_get_value_bool_p8);
- g_test_add_func("/utc_system_settings_get_value_bool_p9", utc_system_settings_get_value_bool_p9);
- g_test_add_func("/utc_system_settings_get_value_bool_p10", utc_system_settings_get_value_bool_p10);
- g_test_add_func("/utc_system_settings_get_value_bool_n", utc_system_settings_get_value_bool_n);
- g_test_add_func("/utc_system_settings_get_value_int_p1", utc_system_settings_get_value_int_p1);
- g_test_add_func("/utc_system_settings_get_value_int_p2", utc_system_settings_get_value_int_p2);
- g_test_add_func("/utc_system_settings_get_value_n", utc_system_settings_get_value_n);
- g_test_add_func("/utc_system_settings_get_value_int_p3", utc_system_settings_get_value_int_p3);
- g_test_add_func("/utc_system_settings_get_value_bool_p11", utc_system_settings_get_value_bool_p11);
- g_test_add_func("/utc_system_settings_get_value_int_p4", utc_system_settings_get_value_int_p4);
- g_test_add_func("/utc_system_settings_set_value_string_n2", utc_system_settings_set_value_string_n2);
- g_test_add_func("/utc_system_settings_set_value_string_n3", utc_system_settings_set_value_string_n3);
- g_test_add_func("/utc_system_settings_set_value_string_n4", utc_system_settings_set_value_string_n4);
- g_test_add_func("/utc_system_settings_set_value_string_n5", utc_system_settings_set_value_string_n5);
- g_test_add_func("/utc_system_settings_set_value_string_n7", utc_system_settings_set_value_string_n7);
- g_test_add_func("/utc_system_settings_set_value_string_n8", utc_system_settings_set_value_string_n8);
- g_test_add_func("/utc_system_settings_set_changed_cb_p1", utc_system_settings_set_changed_cb_p1);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p1", utc_system_settings_unset_changed_cb_p1);
- g_test_add_func("/utc_system_settings_set_changed_cb_p2", utc_system_settings_set_changed_cb_p2);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p2", utc_system_settings_unset_changed_cb_p2);
- g_test_add_func("/utc_system_settings_set_changed_cb_p3", utc_system_settings_set_changed_cb_p3);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p3", utc_system_settings_unset_changed_cb_p3);
- g_test_add_func("/utc_system_settings_set_changed_cb_p4", utc_system_settings_set_changed_cb_p4);
- g_test_add_func("/utc_system_settings_LOCK_SCREEN_unset_changed_cb_p", utc_system_settings_LOCK_SCREEN_unset_changed_cb_p);
- g_test_add_func("/utc_system_settings_set_changed_cb_p5", utc_system_settings_set_changed_cb_p5);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p4", utc_system_settings_unset_changed_cb_p4);
- g_test_add_func("/utc_system_settings_set_changed_cb_p6", utc_system_settings_set_changed_cb_p6);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p5", utc_system_settings_unset_changed_cb_p5);
- g_test_add_func("/utc_system_settings_set_changed_cb_p7", utc_system_settings_set_changed_cb_p7);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p6", utc_system_settings_unset_changed_cb_p6);
- g_test_add_func("/utc_system_settings_set_changed_cb_p8", utc_system_settings_set_changed_cb_p8);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p7", utc_system_settings_unset_changed_cb_p7);
- g_test_add_func("/utc_system_settings_set_changed_cb_p9", utc_system_settings_set_changed_cb_p9);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p8", utc_system_settings_unset_changed_cb_p8);
- g_test_add_func("/utc_system_settings_set_changed_cb_p10", utc_system_settings_set_changed_cb_p10);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p9", utc_system_settings_unset_changed_cb_p9);
- g_test_add_func("/utc_system_settings_set_changed_cb_p11", utc_system_settings_set_changed_cb_p11);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p10", utc_system_settings_unset_changed_cb_p10);
- g_test_add_func("/utc_system_settings_set_changed_cb_p12", utc_system_settings_set_changed_cb_p12);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p11", utc_system_settings_unset_changed_cb_p11);
- g_test_add_func("/utc_system_settings_set_changed_cb_p13", utc_system_settings_set_changed_cb_p13);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p12", utc_system_settings_unset_changed_cb_p12);
- g_test_add_func("/utc_system_settings_set_changed_cb_p14", utc_system_settings_set_changed_cb_p14);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p13", utc_system_settings_unset_changed_cb_p13);
- g_test_add_func("/utc_system_settings_set_changed_cb_p15", utc_system_settings_set_changed_cb_p15);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p14", utc_system_settings_unset_changed_cb_p14);
- g_test_add_func("/utc_system_settings_set_changed_cb_p16", utc_system_settings_set_changed_cb_p16);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p15", utc_system_settings_unset_changed_cb_p15);
- g_test_add_func("/utc_system_settings_set_changed_cb_p17", utc_system_settings_set_changed_cb_p17);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p16", utc_system_settings_unset_changed_cb_p16);
- g_test_add_func("/utc_system_settings_set_changed_cb_p18", utc_system_settings_set_changed_cb_p18);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p17", utc_system_settings_unset_changed_cb_p17);
- g_test_add_func("/utc_system_settings_set_changed_cb_p19", utc_system_settings_set_changed_cb_p19);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p18", utc_system_settings_unset_changed_cb_p18);
- g_test_add_func("/utc_system_settings_set_changed_cb_p20", utc_system_settings_set_changed_cb_p20);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p19;", utc_system_settings_unset_changed_cb_p19);
- g_test_add_func("/utc_system_settings_set_changed_cb_p21", utc_system_settings_set_changed_cb_p21);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p20", utc_system_settings_unset_changed_cb_p20);
- g_test_add_func("/utc_system_settings_set_changed_cb_p22", utc_system_settings_set_changed_cb_p22);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p21", utc_system_settings_unset_changed_cb_p21);
- g_test_add_func("/utc_system_settings_set_changed_cb_p23", utc_system_settings_set_changed_cb_p23);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p22", utc_system_settings_unset_changed_cb_p22);
- g_test_add_func("/utc_system_settings_set_changed_cb_p24", utc_system_settings_set_changed_cb_p24);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p23", utc_system_settings_unset_changed_cb_p23);
- g_test_add_func("/utc_system_settings_set_changed_cb_p25", utc_system_settings_set_changed_cb_p25);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p24", utc_system_settings_unset_changed_cb_p24);
- g_test_add_func("/utc_system_settings_set_changed_cb_p27", utc_system_settings_set_changed_cb_p27);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p26", utc_system_settings_unset_changed_cb_p26);
- g_test_add_func("/utc_system_settings_set_changed_cb_p29", utc_system_settings_set_changed_cb_p29);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p28", utc_system_settings_unset_changed_cb_p28);
- g_test_add_func("/utc_system_settings_set_changed_cb_p31", utc_system_settings_set_changed_cb_p31);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p30", utc_system_settings_unset_changed_cb_p30);
- g_test_add_func("/utc_system_settings_set_changed_cb_p33", utc_system_settings_set_changed_cb_p33);
- g_test_add_func("/utc_system_settings_unset_changed_cb_p32", utc_system_settings_unset_changed_cb_p32);
- g_test_add_func("/utc_system_settings_add_ringtone_list_p1", utc_system_settings_add_ringtone_list_p1);
- g_test_add_func("/utc_system_settings_delete_ringtone_list_p1", utc_system_settings_delete_ringtone_list_p1);
- g_test_add_func("/utc_system_settings_set_value_string_p1", utc_system_settings_set_value_string_p1);
- g_test_add_func("/utc_system_settings_set_value_string_p2", utc_system_settings_set_value_string_p2);
- g_test_add_func("/utc_system_settings_set_value_string_p3", utc_system_settings_set_value_string_p3);
- g_test_add_func("/utc_system_settings_set_value_string_p4", utc_system_settings_set_value_string_p4);
- g_test_add_func("/utc_system_settings_set_value_bool_n1", utc_system_settings_set_value_bool_n1);
- g_test_add_func("/utc_system_settings_set_value_bool_n2", utc_system_settings_set_value_bool_n2);
- g_test_add_func("/utc_system_settings_set_value_bool_n3", utc_system_settings_set_value_bool_n3);
- g_test_add_func("/utc_system_settings_set_value_bool_n4", utc_system_settings_set_value_bool_n4);
- g_test_add_func("/utc_system_settings_set_value_bool_n5", utc_system_settings_set_value_bool_n5);
- g_test_add_func("/utc_system_settings_set_value_bool_n6", utc_system_settings_set_value_bool_n6);
- g_test_add_func("/utc_system_settings_set_value_bool_p1", utc_system_settings_set_value_bool_p1);
- g_test_add_func("/utc_system_settings_set_value_bool_p2", utc_system_settings_set_value_bool_p2);
- g_test_add_func("/utc_system_settings_set_value_int_n1", utc_system_settings_set_value_int_n1);
- g_test_add_func("/utc_system_settings_set_changed_cb_n", utc_system_settings_set_changed_cb_n);
- g_test_add_func("/utc_system_settings_set_value_int_p1", utc_system_settings_set_value_int_p1);
- g_test_add_func("/utc_system_settings_set_value_int_n2", utc_system_settings_set_value_int_n2);
- g_test_add_func("/utc_system_settings_set_value_bool_p3", utc_system_settings_set_value_bool_p3);
- g_test_add_func("/utc_system_settings_set_value_bool_p4", utc_system_settings_set_value_bool_p4);
- g_test_add_func("/utc_system_settings_set_value_bool_p5", utc_system_settings_set_value_bool_p5);
- g_test_add_func("/utc_system_settings_set_value_bool_p6", utc_system_settings_set_value_bool_p6);
- g_test_add_func("/utc_system_settings_set_value_int_p2", utc_system_settings_set_value_int_p2);
- g_test_add_func("/utc_system_settings_set_value_string_n6", utc_system_settings_set_value_string_n6);
- g_test_add_func("/utc_system_settings_unset_changed_cb_n", utc_system_settings_unset_changed_cb_n);
-}
-#endif
-
/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
JsonParser* ss_json_ringtone_open_file(char* path)
{
JsonParser *parser;
return parser;
}
+/* LCOV_EXCL_STOP */
JsonParser* ss_json_ringtone_load_from_data()
{
LOGE("Leave [%s]", __FUNCTION__);
}
+/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_0(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_1(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_2(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_3(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
+/* LCOV_EXCL_STOP */
static system_setting_vconf_event_cb system_setting_vconf_get_event_multi_cb_slot(system_settings_key_e key)
{
#define SETTING_TZONE_SYMLINK_PATH @SETTING_TZONE_SYMLINK_PATH@
-
#endif /* __SYSTEM_SETTING_CONFIG_IN_H */
}
/* LCOV_EXCL_STOP */
-char *_get_cur_font()
-{
- return __get_main_font_family_name_by_alias(SETTING_FONT_TIZEN_FONT_ALIAS);
-}
-
/* LCOV_EXCL_START */
void font_config_set_notification()
{
--- /dev/null
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(fw_name "capi-system-system-settings")
+SET(unit_test "system-setting-unittest")
+
+SET(requires "dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info alarm-service capi-media-metadata-extractor eina elementary aul json-glib-1.0 capi-appfw-app-manager capi-appfw-package-manager capi-system-info glib-2.0")
+
+PROJECT(${unit_test})
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${requires})
+FOREACH(flag ${${fw_name}_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${unit_test} REQUIRED ${requires} elementary ecore)
+FOREACH(flag ${${unit_test}_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+ADD_DEFINITIONS("-DN_THREADS=${N_THREADS}")
+ADD_EXECUTABLE(${unit_test} src/unit_test.c
+ src/unit_test_fw.c)
+
+TARGET_LINK_LIBRARIES(${unit_test} ${fw_name})
+INSTALL(TARGETS ${unit_test} DESTINATION /usr/local/bin)
+
--- /dev/null
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef _ASSERT_H_
+#define _ASSERT_H_
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef GLIB_MODE
+#define assert(exp) \
+ do { \
+ if (!(exp)) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert Fail; Following expression is not true: %s\\n", \
+ __FILE__, __LINE__, #exp); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_eq(var, ref) \
+ do { \
+ if (var != ref) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are not equal\\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_neq(var, ref) \
+ do { \
+ if (var == ref) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) and (%s == 0x%x) are equal\\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_gt(var, ref) \
+ do { \
+ if (var <= ref) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than (%s == 0x%x)\\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_geq(var, ref) \
+ do { \
+ if (var < ref) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not greater than or equal to (%s == 0x%x)\\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_lt(var, ref) \
+ do { \
+ if (var >= ref) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than (%s == 0x%x)\\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#define assert_leq(var, ref) \
+ do { \
+ if (var > ref) { \
+ fprintf(stderr, \
+ "\\n[TCT][%s][Line : %d] Assert fail; Values (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\\n", \
+ __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \
+ return 1; \
+ } \
+ } while (0)
+
+#else //GLIB_MODE
+
+#define assert(exp) g_assert(exp)
+#define assert_eq(var, ref) g_assert(var == ref)
+#define assert_neq(var, ref) g_assert(var != ref)
+#define assert_gt(var, ref) g_assert(var > ref)
+#define assert_geq(var, ref) g_assert(var >= ref)
+#define assert_lt(var, ref) g_assert(var < ref)
+#define assert_leq(var, ref) g_assert(var <= ref)
+
+#endif //GLIB_MODE
+
+#endif // _ASSERT_H_
--- /dev/null
+#ifndef __UNIT_TEST_FW__
+#define __UNIT_TEST_FW__
+
+#define GLIB_MODE
+
+#include <stdio.h>
+#include <glib.h>
+#include <unistd.h>
+#include <Elementary.h>
+
+#include <unit_test_assert.h>
+
+void add_test_func(char * test_name, GTestFunc func_pointer);
+void unittest_api();
+
+#ifdef GLIB_MODE
+#define RETTYPE void
+#define RETURN(a) return
+#else
+#define RETTYPE int
+#define RETURN(a) return a
+#endif
+
+#ifndef N_THREADS
+#define N_THERADS 0
+#endif
+
+#define MAX_TEST_CASE 1000
+
+#endif
--- /dev/null
+set pagination off
+set logging file /opt/usr/share/unit_test_gdb_logs.txt
+set logging on
+set confirm off
+file /usr/local/bin/system-setting-unittest
+r # run it once
+break exit
+commands
+run
+end
+set logging off
+#quit
#!/bin/bash
+PWD=`pwd`
RPATH=$1
SPECPATH=`find . -name *.spec`
ARCH=$2
VERSHORT=${VER%-*} # 1.2.3
-
+THREAD_NUM=$3
+GDB_TEST=$4
if [ -z $RPATH ]; then
echo "argument error : 1st arg is path "
exit 1
fi
-sudo gbs build -A $ARCH --include-all --define "run_tests 1" || exit 1
-# ex ) ./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS capi-system-system-settings 0.0.3-3 armv7l
+if [ -z $THREAD_NUM ]; then
+ sudo gbs build -A $ARCH --include-all --define "run_tests 1" || exit 1
+else
+ sudo gbs build -A $ARCH --include-all --define "run_tests 1" --define "thread_number $THREAD_NUM" || exit 1
+fi
+
+# ex ) ./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS capi-system-system-settings 0.0.3-3 armv7l 5
RPM_ROOT=$RPATH
+sudo mkdir -p /usr/src/packages/BUILD/$APP-$VERSHORT
+sudo cp -rf . /usr/src/packages/BUILD/$APP-$VERSHORT
+
sudo mkdir -p /home/abuild/rpmbuild/BUILD/$APP-$VERSHORT
sudo cp -rf . /home/abuild/rpmbuild/BUILD/$APP-$VERSHORT
SDB=/usr/bin/sdb
+GDB_SCRIPT=$PWD/unit_test/script/unit_test_gdb_script
+UNIT_TEST_RESOURCE=$PWD/unit_test/resource/*
$SDB root on
$SDB shell mount -o remount,rw /
$SDB push $RPM_ROOT/$APP-$VER.$ARCH.rpm /opt
$SDB push $RPM_ROOT/$APP-debuginfo-$VER.$ARCH.rpm /opt
$SDB push $RPM_ROOT/$APP-debugsource-$VER.$ARCH.rpm /opt
+$SDB push $GDB_SCRIPT /usr/local/bin
+$SDB push $UNIT_TEST_RESOURCE /opt/usr/share
$SDB shell rpm -Uvh --force --nodeps /opt/$APP-$VER.$ARCH.rpm
$SDB shell rpm -Uvh --force --nodeps /opt/$APP-debuginfo-$VER.$ARCH.rpm
echo "UNIT TEST----------------------------------------------------"
export GCOV_PREFIX=/opt
+
+if [ -z $GDB_TEST]; then
$SDB shell su - -c "G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 /usr/local/bin/system-setting-unittest"
+else
+$SDB shell su - -c "G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 gdb -x /usr/local/bin/unit_test_gdb_script"
+fi
echo "COVERAGE TEST----------------------------------------------------"
sdb pull /usr/src/packages/BUILD/$APP-$VERSHORT/
lcov -c -d ./CMakeFiles/$APP.dir/ -o $APP.info
lcov -c -d ./system-settings-util/CMakeFiles/system-settings-util.dir -o $APP.util.info
-VAR1="/home/abuild/rpmbuild/BUILD/$APP-$VERSHORT"
+VAR1="/usr/src/packages/BUILD/$APP-$VERSHORT"
VAR2="/usr/include"
-PWD=`pwd`
GBS_INCLUDE="$HOME/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/usr/include"
sed -i "s#$VAR1#$PWD#g" $APP.info
sed -i "s#$VAR2#$GBS_INCLUDE#g" $APP.info
echo "sed -i \"s#$VAR1#$PWD#g\" $APP.info"
echo "genhtml $APP.info $APP.util.info -o out"
+rm -rf out
genhtml $APP.info $APP.util.info -o out
find . -name "CMakeFiles" -type d -prune -exec rm -rf '{}' '+'
rm $APP.info $APP.util.info
-
+sudo rm -rf /usr/src/packages/BUILD/$APP-$VERSHORT
+sudo rm -rf /home/abuild/rpmbuild/BUILD/$APP-$VERSHORT
--- /dev/null
+#include <system_settings.h>
+
+#include <unit_test_fw.h>
+
+
+void unit_test_callback0(system_settings_key_e key, void *user_data) { }
+void unit_test_callback1(system_settings_key_e key, void *user_data) { }
+void unit_test_callback2(system_settings_key_e key, void *user_data) { }
+void unit_test_callback3(system_settings_key_e key, void *user_data) { }
+void unit_test_callback4(system_settings_key_e key, void *user_data) { }
+void unit_test_callback5(system_settings_key_e key, void *user_data) { }
+void unit_test_callback6(system_settings_key_e key, void *user_data) { }
+void unit_test_callback7(system_settings_key_e key, void *user_data) { }
+void unit_test_callback8(system_settings_key_e key, void *user_data) { }
+void unit_test_callback9(system_settings_key_e key, void *user_data) { }
+void unit_test_callback10(system_settings_key_e key, void *user_data) { }
+void unit_test_callback11(system_settings_key_e key, void *user_data) { }
+void unit_test_callback12(system_settings_key_e key, void *user_data) { }
+void unit_test_callback13(system_settings_key_e key, void *user_data) { }
+void unit_test_callback14(system_settings_key_e key, void *user_data) { }
+void unit_test_callback15(system_settings_key_e key, void *user_data) { }
+void unit_test_callback16(system_settings_key_e key, void *user_data) { }
+void unit_test_callback17(system_settings_key_e key, void *user_data) { }
+void unit_test_callback18(system_settings_key_e key, void *user_data) { }
+void unit_test_callback19(system_settings_key_e key, void *user_data) { }
+void unit_test_callback20(system_settings_key_e key, void *user_data) { }
+void unit_test_callback21(system_settings_key_e key, void *user_data) { }
+void unit_test_callback22(system_settings_key_e key, void *user_data) { }
+void unit_test_callback23(system_settings_key_e key, void *user_data) { }
+void unit_test_callback24(system_settings_key_e key, void *user_data) { }
+void unit_test_callback25(system_settings_key_e key, void *user_data) { }
+void unit_test_callback26(system_settings_key_e key, void *user_data) { }
+void unit_test_callback27(system_settings_key_e key, void *user_data) { }
+void unit_test_callback28(system_settings_key_e key, void *user_data) { }
+void unit_test_callback29(system_settings_key_e key, void *user_data) { }
+void unit_test_callback30(system_settings_key_e key, void *user_data) { }
+void unit_test_callback31(system_settings_key_e key, void *user_data) { }
+void unit_test_callback32(system_settings_key_e key, void *user_data) { }
+void unit_test_callback33(system_settings_key_e key, void *user_data) { }
+void unit_test_callback34(system_settings_key_e key, void *user_data) { }
+void unit_test_callback35(system_settings_key_e key, void *user_data) { }
+void unit_test_callback36(system_settings_key_e key, void *user_data) { }
+void unit_test_callback37(system_settings_key_e key, void *user_data) { }
+void unit_test_callback38(system_settings_key_e key, void *user_data) { }
+void unit_test_callback39(system_settings_key_e key, void *user_data) { }
+void unit_test_callback40(system_settings_key_e key, void *user_data) { }
+void unit_test_callback41(system_settings_key_e key, void *user_data) { }
+void unit_test_callback42(system_settings_key_e key, void *user_data) { }
+void unit_test_callback43(system_settings_key_e key, void *user_data) { }
+void unit_test_callback44(system_settings_key_e key, void *user_data) { }
+void unit_test_callback45(system_settings_key_e key, void *user_data) { }
+void unit_test_callback46(system_settings_key_e key, void *user_data) { }
+void unit_test_callback47(system_settings_key_e key, void *user_data) { }
+void unit_test_callback48(system_settings_key_e key, void *user_data) { }
+void unit_test_callback49(system_settings_key_e key, void *user_data) { }
+void unit_test_callback50(system_settings_key_e key, void *user_data) { }
+void unit_test_callback51(system_settings_key_e key, void *user_data) { }
+void unit_test_callback52(system_settings_key_e key, void *user_data) { }
+void unit_test_callback53(system_settings_key_e key, void *user_data) { }
+void unit_test_callback54(system_settings_key_e key, void *user_data) { }
+void unit_test_callback55(system_settings_key_e key, void *user_data) { }
+void unit_test_callback56(system_settings_key_e key, void *user_data) { }
+void unit_test_callback57(system_settings_key_e key, void *user_data) { }
+void unit_test_callback58(system_settings_key_e key, void *user_data) { }
+void unit_test_callback59(system_settings_key_e key, void *user_data) { }
+
+
+static int my_assert_ret(int retcode)
+{
+ if (retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) {
+ assert(retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ } else {
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE)
+ printf("Error!!\n");
+ assert(retcode == SYSTEM_SETTINGS_ERROR_NONE);
+ }
+ return 1;
+}
+
+
+system_settings_changed_cb get_system_settings_test_callback()
+{
+ static system_settings_changed_cb func_array[] = {
+ unit_test_callback0,
+ unit_test_callback1,
+ unit_test_callback2,
+ unit_test_callback3,
+ unit_test_callback4,
+ unit_test_callback5,
+ unit_test_callback6,
+ unit_test_callback7,
+ unit_test_callback8,
+ unit_test_callback9,
+ unit_test_callback10,
+ unit_test_callback11,
+ unit_test_callback12,
+ unit_test_callback13,
+ unit_test_callback14,
+ unit_test_callback15,
+ unit_test_callback16,
+ unit_test_callback17,
+ unit_test_callback18,
+ unit_test_callback19,
+ unit_test_callback20,
+ unit_test_callback21,
+ unit_test_callback22,
+ unit_test_callback23,
+ unit_test_callback24,
+ unit_test_callback25,
+ unit_test_callback26,
+ unit_test_callback27,
+ unit_test_callback28,
+ unit_test_callback29,
+ unit_test_callback30,
+ unit_test_callback31,
+ unit_test_callback32,
+ unit_test_callback33,
+ unit_test_callback34,
+ unit_test_callback35,
+ unit_test_callback36,
+ unit_test_callback37,
+ unit_test_callback38,
+ unit_test_callback39,
+ unit_test_callback40,
+ unit_test_callback41,
+ unit_test_callback42,
+ unit_test_callback43,
+ unit_test_callback44,
+ unit_test_callback45,
+ unit_test_callback46,
+ unit_test_callback47,
+ unit_test_callback48,
+ unit_test_callback49,
+ unit_test_callback50,
+ unit_test_callback51,
+ unit_test_callback52,
+ unit_test_callback53,
+ unit_test_callback54,
+ unit_test_callback55,
+ unit_test_callback56,
+ unit_test_callback57,
+ unit_test_callback58,
+ unit_test_callback59
+ };
+
+ static int func_num = 0;
+ func_num++;
+ if (func_num > 61)
+ func_num = 0;
+ int slot = func_num % 60;
+ return func_array[slot];
+}
+
+static bool _callback_called = false;
+static char *new_ringtonepath = "/opt/usr/share/ringtone_sdk.mp3";
+
+/**
+ * @function utc_system_settings_startup
+ * @description Called before each test
+ * @parameter NA
+ * @return NA
+ */
+RETTYPE utc_system_settings_startup(void)
+{
+ RETURN(0);
+}
+
+/**
+ * @function utc_system_settings_cleanup
+ * @description Called after each test
+ * @parameter NA
+ * @return NA
+ */
+RETTYPE utc_system_settings_cleanup(void)
+{
+ RETURN(0);
+}
+
+/**
+ * TEST GETTING SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE
+ */
+/**
+ * @testcase utc_system_settings_get_value_string_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is able to get the property
+ */
+RETTYPE utc_system_settings_get_value_string_p1(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, &value);
+ //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+/**
+ * TEST GETTING SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY
+ */
+/**
+ * @testcase utc_system_settings_get_value_string_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to get the property
+ */
+RETTYPE utc_system_settings_get_value_string_p2(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &value);
+ //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+/**
+ * TEST GETTING SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE
+ */
+/**
+ * @testcase utc_system_settings_get_value_string_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to get the property
+ */
+RETTYPE utc_system_settings_get_value_string_p3(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &value);
+ //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+/**
+ * TEST GETTING SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE
+ */
+/**
+ * @testcase utc_system_settings_get_value_string_p4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to get the property
+ */
+RETTYPE utc_system_settings_get_value_string_p4(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &value);
+ //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+/**
+ * TEST SETTING SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN
+ */
+/**
+ * @testcase utc_system_settings_get_value_string_p5
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p5(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &value);
+ //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_get_value_string_p11
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p11(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEVICE_NAME, &value);
+ //assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_string_p7
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p7(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &value);
+ my_assert_ret(retcode);
+ free(value);
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_get_value_string_p6
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEZON is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p6(void)
+{
+ char *value = NULL;
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &value);
+ my_assert_ret(retcode);
+ free(value);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_string_p10
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p10(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &value);
+ my_assert_ret(retcode);
+ if (retcode == SYSTEM_SETTINGS_ERROR_NONE)
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_string_p8
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p8(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &value);
+ my_assert_ret(retcode);
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_string_p9
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_string_p9(void)
+{
+ char *value = NULL;
+
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, &value);
+ my_assert_ret(retcode);
+ if (retcode == SYSTEM_SETTINGS_ERROR_NONE)
+ assert(value != NULL);
+ free(value);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_string_n
+ * @since_tizen 2.3
+ * @description check if system_settings_get_value_string is able to handle invalid parameters.
+ */
+RETTYPE utc_system_settings_get_value_string_n(void)
+{
+ int retcode = system_settings_get_value_string(-1, NULL);
+ //assert_neq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p1(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, &value);
+ my_assert_ret(retcode);
+ RETURN(0);
+
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p2(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, &value);
+ my_assert_ret(retcode);
+ RETURN(0);
+
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p3(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, &value);
+ my_assert_ret(retcode);
+ RETURN(0);
+
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p4(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &value);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p5
+ * @since_tizen 2.3
+ * check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p5(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &value);
+ my_assert_ret(retcode);
+ RETURN(0);
+
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p6
+ * @since_tizen 2.3
+ * check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p6(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p7
+ * @since_tizen 2.3
+ * check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p7(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p8
+ * @since_tizen 2.3
+ * check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p8(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p9
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p9(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p10
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_bool_p10(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_n
+ * @since_tizen 2.3
+ * @description check if system_settings_get_value_bool is able to handle invalid parameters.
+ */
+RETTYPE utc_system_settings_get_value_bool_n(void)
+{
+ int retcode = system_settings_get_value_bool(-1, NULL);
+ //assert_neq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_int_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_int_p1(void)
+{
+ int value = 0;
+
+ int retcode = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_int_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_int_p2(void)
+{
+ int font_size = 0;
+
+ int retcode = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &font_size);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_n
+ * @since_tizen 2.3
+ * @description check if system_settings_get_value_int is able to handle invalid parameters.
+ */
+RETTYPE utc_system_settings_get_value_n(void)
+{
+ int retcode = system_settings_get_value_int(-1, NULL);
+ //assert_neq(retcode, SYSTEM_SETTINGS_ERROR_NONE);
+ assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_int_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_int_p3(void)
+{
+ int value;
+ int nRetVal = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, &value);
+ my_assert_ret(nRetVal);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_get_value_bool_p11
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to get the property
+ */
+RETTYPE utc_system_settings_get_value_bool_p11(void)
+{
+ bool value = false;
+
+ int retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &value);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p1(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p1(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p2(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p2(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p3(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p3(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p4(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_LOCK_SCREEN_unset_changed_cb_p
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_WALLPAPER is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_LOCK_SCREEN_unset_changed_cb_p(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p5
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p5(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p4(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p6
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p6(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p5
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p5(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE,
+ callback, NULL);
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p7
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p7(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p6
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p6(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p8
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p8(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p7
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p7(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p9
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to set callback for getting notification of change
+ */
+RETTYPE utc_system_settings_set_changed_cb_p9(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p8
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p8(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p10
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP is able to set callback for getting notification of change
+ */
+RETTYPE utc_system_settings_set_changed_cb_p10(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p9
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p9(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p11
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to set callback for getting notification of change
+ */
+RETTYPE utc_system_settings_set_changed_cb_p11(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p10
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to set callback for getting notification of change and unset doing
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p10(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p12
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p12(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p11
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p11(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p13
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p13(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR
+ */
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p12
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p12(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p14
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p14(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p13
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p13(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p15
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p15(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p14
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p14(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_LOCK);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p16
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p16(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p15
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p15(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p17
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p17(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p16
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p16(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_TOUCH);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p18
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p18(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p17
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p17(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p19
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p19(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p18
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p18(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p20
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p20(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p19
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p19(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p21
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p21(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p20
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p20(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p22
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p22(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p21
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p21(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_DEVICE_NAME);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p23
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p23(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p22
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p22(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ENABLED);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p24
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p24(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p23
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p23(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p25
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p25(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,
+ callback, NULL);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p24
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p24(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE is able to get the property
+ */
+RETTYPE utc_system_settings_set_value_string_p1(void)
+{
+ int ret;
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, new_ringtonepath);
+ my_assert_ret(ret);
+
+ char *ret_ringtonepath = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &ret_ringtonepath);
+ my_assert_ret(ret);
+
+ if (ret == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED)
+ RETURN(0);
+
+ if (ret_ringtonepath != NULL && 0 == strcmp(ret_ringtonepath, new_ringtonepath)) {
+ assert(1);
+ } else {
+ assert(0);
+ }
+ RETURN(0);
+}
+
+
+/**
+ * TEST SETTING SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN
+ */
+/**
+ * @testcase utc_system_settings_set_value_string_n2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN is able to set the property in error-case.
+ */
+RETTYPE utc_system_settings_set_value_string_n2(void)
+{
+ int ret;
+ char *wallpaper = NULL;
+
+ char *wrong_wallpaper_path = "/wrongpath/aaa.png";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, wrong_wallpaper_path);
+ assert(ret != SYSTEM_SETTINGS_ERROR_NONE);
+
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &wallpaper);
+ assert(ret == SYSTEM_SETTINGS_ERROR_NONE);
+ free(wallpaper);
+ RETURN(0);
+}
+
+/**
+ * SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN
+ */
+/**
+ * @testcase utc_system_settings_set_value_string_n3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN is able to set the property in error-case.
+ */
+RETTYPE utc_system_settings_set_value_string_n3(void)
+{
+ int ret;
+ char *wallpaper = NULL;
+
+ char *wrong_wallpaper_path = "/wrongpath/aaa.png";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, wrong_wallpaper_path);
+ assert(ret != SYSTEM_SETTINGS_ERROR_NONE);
+
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &wallpaper);
+ //assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
+ free(wallpaper);
+ RETURN(0);
+}
+
+/**
+ * SYSTEM_SETTINGS_KEY_FONT_TYPE
+ */
+/**
+ * @testcase utc_system_settings_set_value_string_n4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_FONT_TYPE is able to set the property in error-case.
+ */
+RETTYPE utc_system_settings_set_value_string_n4(void)
+{
+ int ret;
+
+ char *wrong_font_name = "WrongFontName";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, wrong_font_name);
+ assert(ret != SYSTEM_SETTINGS_ERROR_NONE);
+
+ char *font_name = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &font_name);
+ //assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
+ free(font_name);
+ RETURN(0);
+}
+
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_n1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION is able to set the property in a normal-case.
+ */
+RETTYPE utc_system_settings_set_value_bool_n1(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION, &ret_state);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_n2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_bool_n2(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE, &ret_state);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_n3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_MOTION_ENABLED is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_bool_n3(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ENABLED, &ret_state);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_set_value_bool_n4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_TOUCH is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_bool_n4(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &ret_state);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_n5
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_LOCK is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_bool_n5(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_LOCK, &ret_state);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_set_value_bool_n6
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_bool_n6(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS , state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS , &ret_state);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_n8
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_string_n8(void)
+{
+ int ret;
+ char *new_font = "DefaultFontName";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, new_font);
+ //my_assert_ret(ret);
+ assert_neq(ret, SYSTEM_SETTINGS_ERROR_NONE);
+
+ char *ret_font = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, &ret_font);
+ assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
+ RETURN(0);
+
+#if 0
+ int ret;
+ char *new_font = "DefaultFontName";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, new_font);
+ //assert_eq(ret, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+
+ char *ret_font = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE, &ret_font);
+ int ret2 = my_assert_ret(ret);
+ return ret2;
+ //return;
+#endif
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_n7
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_string_n7(void)
+{
+ int ret;
+ char *new_zone = "Asia/Seoul";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, new_zone);
+ my_assert_ret(ret);
+
+ char *ret_device = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &ret_device);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_int_n1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_TIME_CHANGED is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_int_n1(void)
+{
+ int ret;
+ int value = 3600;
+ ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_TIME_CHANGED, value);
+ my_assert_ret(ret);
+
+ int time_changed;
+ ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_TIME_CHANGED, &time_changed);
+ my_assert_ret(ret);
+
+ RETURN(0);
+}
+
+
+/**
+ * SYSTEM_SETTINGS_KEY_DEVICE_NAME
+ * check_SYSTEM_SETTINGS_ERROR_CALL_UNSUPPORTED_API
+ */
+/**
+ * @testcase utc_system_settings_set_value_string_n5
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_DEVICE_NAME is able to set the property in an exceptional-case. (not supported)
+ */
+RETTYPE utc_system_settings_set_value_string_n5(void)
+{
+ int ret;
+ char *new_device = "Tizen222";
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_DEVICE_NAME, new_device);
+ my_assert_ret(ret);
+
+ char *ret_device = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_DEVICE_NAME, &ret_device);
+
+ if (ret_device != NULL && 0 == strcmp(ret_device, new_device)) {
+ assert(0);
+ } else {
+ assert(1);
+ }
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE is able to set the property in a normal-case.
+ */
+RETTYPE utc_system_settings_set_value_string_p2(void)
+{
+ int ret;
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, new_ringtonepath);
+ my_assert_ret(ret);
+
+ char *ret_ringtonepath = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, &ret_ringtonepath);
+
+ if (ret == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED)
+ RETURN(0);
+
+ if (ret_ringtonepath != NULL && 0 == strcmp(ret_ringtonepath, new_ringtonepath)) {
+ assert(1);
+ } else {
+ assert(0);
+ }
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY is able to set the property in a normal-case.
+ */
+RETTYPE utc_system_settings_set_value_string_p3(void)
+{
+ int ret;
+ char *new_country = "ko_KR";
+
+ /* backup */
+ char *backup = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &backup);
+ my_assert_ret(ret);
+
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, new_country);
+ my_assert_ret(ret);
+
+ char *ret_country = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &ret_country);
+ my_assert_ret(ret);
+
+ if (ret_country != NULL && 0 == strcmp(ret_country, new_country)) {
+ assert(1);
+ } else {
+ assert(0);
+ }
+
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, backup);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_p4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to get the property.
+ * check if SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE is able to set the property in a normal-case.
+ */
+RETTYPE utc_system_settings_set_value_string_p4(void)
+{
+ int ret;
+ char *new_country = "ko_KR";
+
+ /* backup */
+ char *backup = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &backup);
+ my_assert_ret(ret);
+
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, new_country);
+ my_assert_ret(ret);
+
+ char *ret_country = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &ret_country);
+ my_assert_ret(ret);
+
+ if (ret_country != NULL && 0 == strcmp(ret_country, new_country)) {
+ assert(1);
+ } else {
+ assert(0);
+ }
+
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, backup);
+ my_assert_ret(ret);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_bool_p1(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, &ret_state);
+ my_assert_ret(ret);
+
+ //assert_eq(state, ret_state);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_bool_p2(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &ret_state);
+ my_assert_ret(ret);
+
+ //assert_eq(state, ret_state);
+
+ /* roll back */
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, !state);
+ my_assert_ret(ret);
+
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &ret_state);
+ //assert_eq(ret_state, !state);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_n
+ * @since_tizen 2.3
+ * @description check if system_settings_set_changed_cb is able to handle invalid parameters.
+ */
+RETTYPE utc_system_settings_set_changed_cb_n(void)
+{
+ int retcode = system_settings_set_changed_cb(-1, NULL, NULL);
+ assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
+ RETURN(0);
+}
+
+
+
+/**
+ * @testcase utc_system_settings_get_value_int_p4
+ * @since_tizen 3.0
+ * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to get the property.
+ */
+RETTYPE utc_system_settings_get_value_int_p4(void)
+{
+ int value = 0;
+ int nRetVal = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, &value);
+ my_assert_ret(nRetVal);
+ RETURN(0);
+}
+
+
+
+/**
+ * @testcase utc_system_settings_set_value_int_p1
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_int_p1(void)
+{
+ int nRetVal = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 30);
+ my_assert_ret(nRetVal);
+
+ int value;
+ nRetVal = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, &value);
+ //assert_eq(value, 30);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_int_n2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME is able to set the properties with exceptional cases.
+ */
+RETTYPE utc_system_settings_set_value_int_n2(void)
+{
+ int ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, -5);
+ assert(ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+
+ ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 601);
+ assert(ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+
+ ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME, 0);
+ assert(ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_p3
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_bool_p3(void)
+{
+ int ret;
+ bool state = true;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, state);
+ my_assert_ret(ret);
+
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &ret_state);
+ my_assert_ret(ret);
+
+ //assert_eq(state, ret_state);
+
+ /* roll back */
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, !state);
+ my_assert_ret(ret);
+
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &ret_state);
+ //assert_eq(ret_state, !state);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_p4
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_bool_p4(void)
+{
+ int ret;
+
+ /* get current state */
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, &ret_state);
+ my_assert_ret(ret);
+
+
+ bool state = !ret_state;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, state);
+ my_assert_ret(ret);
+
+ /* roll back */
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, ret_state);
+ my_assert_ret(ret);
+
+ assert(state != ret_state);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_p5
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_bool_p5(void)
+{
+ int ret;
+
+ /* get current state */
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, &ret_state);
+ my_assert_ret(ret);
+
+
+ bool state = !ret_state;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, state);
+ my_assert_ret(ret);
+
+
+ /* roll back */
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, ret_state);
+ my_assert_ret(ret);
+
+ assert(state != ret_state);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_bool_p6
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_VIBRATION is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_VIBRATION is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_bool_p6(void)
+{
+ int ret;
+
+ /* get current state */
+ bool ret_state = false;
+ ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_VIBRATION, &ret_state);
+ my_assert_ret(ret);
+
+
+ bool state = !ret_state;
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_VIBRATION, state);
+ my_assert_ret(ret);
+
+
+ /* roll back */
+ ret = system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_VIBRATION, ret_state);
+ my_assert_ret(ret);
+
+ assert(state != ret_state);
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_int_p2
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_FONT_SIZE is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_int_p2(void)
+{
+ int ret = -1;
+ int backup;
+ int arr[] = {
+ SYSTEM_SETTINGS_FONT_SIZE_SMALL,
+ SYSTEM_SETTINGS_FONT_SIZE_NORMAL,
+ SYSTEM_SETTINGS_FONT_SIZE_LARGE,
+ SYSTEM_SETTINGS_FONT_SIZE_HUGE,
+ SYSTEM_SETTINGS_FONT_SIZE_GIANT
+ };
+
+ srand(time(NULL));
+ int size = sizeof(arr)/sizeof(arr[0]);
+ int sel = rand() % size;
+
+ /* backup */
+ ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &backup);
+ my_assert_ret(ret);
+
+ /* change font at random */
+ ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, sel);
+ my_assert_ret(ret);
+
+ /* check if selection and result are identical. */
+ int after;
+ ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &after);
+ //assert_eq(sel, after);
+
+ /* roll back to backup */
+ ret = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, backup);
+ my_assert_ret(ret);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_set_value_string_n6
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to set the property.
+ * check if SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION is able to get the property.
+ */
+RETTYPE utc_system_settings_set_value_string_n6(void)
+{
+ int ret;
+ ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, new_ringtonepath);
+ my_assert_ret(ret);
+ //assert_eq(ret, SYSTEM_SETTINGS_ERROR_NONE);
+
+ char *ret_ringtonepath = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &ret_ringtonepath);
+
+ if (ret_ringtonepath != NULL && 0 == strcmp(ret_ringtonepath, new_ringtonepath)) {
+ my_assert_ret(0);
+ } else {
+ my_assert_ret(1);
+ }
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_n
+ * @since_tizen 2.3
+ * @description check if system_settings_unset_changed_cb is able to handle invalid parameters.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_n(void)
+{
+ int retcode = system_settings_unset_changed_cb(-1);
+ assert(retcode != SYSTEM_SETTINGS_ERROR_NONE);
+ RETURN(0);
+}
+
+
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p27
+ * @since_tizen 3.0
+ * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p27(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p26
+ * @since_tizen 3.0
+ * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p26(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p29
+ * @since_tizen 3.0
+ * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p29(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p28
+ * @since_tizen 3.0
+ * @description check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p28(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p31
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p31(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p30
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p30(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+/**
+ * @testcase utc_system_settings_set_changed_cb_p33
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_VIBRATION is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_set_changed_cb_p33(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_VIBRATION,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+
+/**
+ * @testcase utc_system_settings_unset_changed_cb_p32
+ * @since_tizen 2.3
+ * @description check if SYSTEM_SETTINGS_KEY_VIBRATION is able to set the callback for change-notification.
+ * check if SYSTEM_SETTINGS_KEY_VIBRATION is able to unset the callback for change-notification.
+ */
+RETTYPE utc_system_settings_unset_changed_cb_p32(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_VIBRATION,
+ callback, NULL);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_VIBRATION);
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+static int cb_count;
+static bool system_setting_get_ringtone_list_cb(int index, const char* data, void *user_data)
+{
+ cb_count += 1;
+/* printf("%s\n", (char*)data); */
+ return true;
+}
+
+RETTYPE utc_system_settings_add_ringtone_list_p1(void)
+{
+ int retcode = -1;
+ cb_count = 0;
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
+ my_assert_ret(retcode);
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_foreach_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, system_setting_get_ringtone_list_cb, NULL);
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
+ my_assert_ret(retcode);
+ assert_eq(cb_count, 5);
+
+ RETURN(0);
+}
+
+/**
+ * @function utc_system_settings_delete_ringtone_list_p1_startup
+ * @description Called before each test
+ * @parameter NA
+ * @return NA
+ */
+
+/* system_settings - del ringtone list */
+RETTYPE utc_system_settings_delete_ringtone_list_p1(void)
+{
+ int retcode = -1;
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
+ my_assert_ret(retcode);
+ retcode = system_settings_add_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
+ my_assert_ret(retcode);
+
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/tct-content-tizen-tests_video.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/sound_5.wav");
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/daliTestVideo.mp4");
+ my_assert_ret(retcode);
+ retcode = system_settings_delete_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/usr/test/big_buck_bunny.mp4");
+ my_assert_ret(retcode);
+
+ RETURN(0);
+}
+
+#include <unistd.h> /* to use sleep */
+typedef struct __in_callback_test {
+ int call_cnt1;
+ int call_cnt2;
+} __in_callback_data;
+
+static void utc_system_settings_changed_multi_callback1(system_settings_key_e key, void *user_data)
+{
+ __in_callback_data *cb_data = (__in_callback_data*)user_data;
+ if (!cb_data)
+ return;
+ cb_data->call_cnt1++;
+}
+
+static void utc_system_settings_changed_multi_callback2(system_settings_key_e key, void *user_data)
+{
+ __in_callback_data *cb_data = (__in_callback_data*)user_data;
+ if (!cb_data)
+ return;
+ cb_data->call_cnt2++;
+}
+
+static gpointer test_multi_callback_thread(gpointer arg)
+{
+ int retcode = system_settings_add_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ utc_system_settings_changed_multi_callback1, arg);
+ my_assert_ret(retcode);
+
+ retcode = system_settings_add_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ utc_system_settings_changed_multi_callback1, arg);
+
+ /* not support same callback about 1 system-settings key */
+ assert_eq(retcode, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+
+ retcode = system_settings_add_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ utc_system_settings_changed_multi_callback2, arg);
+
+ bool bk_state = false;
+ system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR , &bk_state);
+
+ bool state = true;
+ system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR , state);
+
+ sleep(1);
+
+ my_assert_ret(retcode);
+ retcode = system_settings_remove_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ utc_system_settings_changed_multi_callback1);
+ my_assert_ret(retcode);
+ retcode = system_settings_remove_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
+ utc_system_settings_changed_multi_callback2);
+ my_assert_ret(retcode);
+
+ system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR , bk_state);
+
+ return 0;
+
+}
+/**
+ * @testcase utc_system_settings_add_changed_cb_p1
+ * @since_tizen 4.0
+ * @description check if SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR is able to set the callback for change-notification.
+ */
+RETTYPE utc_system_settings_add_changed_cb_p1(void)
+{
+ __in_callback_data *cb_data = calloc(sizeof(__in_callback_data), 1);
+ GThread *test_thread;
+
+ test_thread = g_thread_new(NULL, test_multi_callback_thread, cb_data);
+
+ g_thread_join(test_thread);
+ assert_eq(cb_data->call_cnt1, 1);
+ assert_eq(cb_data->call_cnt2, 1);
+ if (cb_data)
+ free(cb_data);
+
+ RETURN(0);
+}
+
+
+RETTYPE utc_system_settings_changed_callback_1(system_settings_key_e key, void *user_data)
+{
+ _callback_called = true;
+}
+
+RETTYPE utc_system_settings_changed_callback_2(system_settings_key_e key, void *user_data)
+{
+ _callback_called = true;
+}
+
+RETTYPE utc_system_settings_add_remove_changed_cb_p1(void)
+{
+ int retcode = 0;
+ int key_idx = 0;
+
+ for (key_idx = SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE; key_idx < SYSTEM_SETTINGS_KEY_MAX ; key_idx++) {
+ system_settings_changed_cb callback_1 = get_system_settings_test_callback();
+ system_settings_changed_cb callback_2 = get_system_settings_test_callback();
+
+ if (key_idx == SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED + 1)
+ continue; /* skip removed system-setting key */
+
+ if (key_idx == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)
+ continue; /* skip not supported notification callback of system-setting key */
+
+ retcode = system_settings_add_changed_cb(key_idx,
+ callback_1, NULL);
+
+ if (retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) {
+ assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ } else {
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE)
+ printf("ERROR !! key =%d , ret = %d\n", key_idx, retcode);
+ }
+
+ retcode = system_settings_remove_changed_cb(key_idx,
+ callback_1);
+
+ if (retcode == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) {
+ assert_eq(retcode, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ } else {
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE)
+ printf("ERROR !! key =%d , ret = %d\n", key_idx, retcode);
+ }
+
+ retcode = system_settings_add_changed_cb(key_idx,
+ callback_1, NULL);
+ my_assert_ret(retcode);
+
+ retcode = system_settings_add_changed_cb(key_idx,
+ callback_2, NULL);
+ my_assert_ret(retcode);
+
+ retcode = system_settings_remove_changed_cb(key_idx,
+ callback_1);
+ my_assert_ret(retcode);
+
+ retcode = system_settings_remove_changed_cb(key_idx,
+ callback_2);
+ my_assert_ret(retcode);
+ }
+
+ RETURN(0);
+}
+
+RETTYPE utc_system_settings_ads_id_p1(void)
+{
+ system_settings_changed_cb callback = get_system_settings_test_callback();
+ int retcode = 0;
+ char *ret_ads_id = NULL;
+ retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_ADS_ID, &ret_ads_id);
+
+ char *set_ads_id = "00000215-0156-0133-0034-000000000102";
+ retcode = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_ADS_ID, set_ads_id);
+ my_assert_ret(retcode);
+
+ system_settings_set_value_string(SYSTEM_SETTINGS_KEY_ADS_ID, ret_ads_id);
+ if (ret_ads_id)
+ free(ret_ads_id);
+
+ retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ADS_ID,
+ callback, NULL);
+ my_assert_ret(retcode);
+
+ retcode = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ADS_ID);
+ my_assert_ret(retcode);
+ RETURN(0);
+}
+
+RETTYPE utc_system_settings_lock_screen_app_p1(void)
+{
+ int retcode = 0;
+ char *ret_lock_screen_id = NULL;
+ retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP, &ret_lock_screen_id);
+
+ char *set_lock_screen_id = "org.tizen.voice-control-panel";
+ retcode = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP, set_lock_screen_id);
+ my_assert_ret(retcode);
+
+ system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP, ret_lock_screen_id);
+ if (ret_lock_screen_id)
+ free(ret_lock_screen_id);
+ RETURN(0);
+}
+
+void unittest_api()
+{
+ /* hook up your test functions */
+ g_test_add_func("/utc_system_settings_add_changed_cb_p1", utc_system_settings_add_changed_cb_p1);
+ g_test_add_func("/utc_system_settings_add_remove_changed_cb_p1", utc_system_settings_add_remove_changed_cb_p1);
+ g_test_add_func("/utc_system_settings_ads_id_p1", utc_system_settings_ads_id_p1);
+ add_test_func("/utc_system_settings_lock_screen_app_p1", utc_system_settings_lock_screen_app_p1);
+ add_test_func("/utc_system_settings_get_value_string_p1", utc_system_settings_get_value_string_p1);
+ add_test_func("/utc_system_settings_get_value_string_p2", utc_system_settings_get_value_string_p2);
+ add_test_func("/utc_system_settings_get_value_string_p3", utc_system_settings_get_value_string_p3);
+ add_test_func("/utc_system_settings_get_value_string_p4", utc_system_settings_get_value_string_p4);
+ add_test_func("/utc_system_settings_get_value_string_p5", utc_system_settings_get_value_string_p5);
+ add_test_func("/utc_system_settings_get_value_string_p7", utc_system_settings_get_value_string_p7);
+ add_test_func("/utc_system_settings_get_value_string_p6", utc_system_settings_get_value_string_p6);
+ add_test_func("/utc_system_settings_get_value_string_p10", utc_system_settings_get_value_string_p10);
+ add_test_func("/utc_system_settings_get_value_string_p8", utc_system_settings_get_value_string_p8);
+ add_test_func("/utc_system_settings_get_value_string_p9", utc_system_settings_get_value_string_p9);
+ add_test_func("/utc_system_settings_get_value_string_p11", utc_system_settings_get_value_string_p11);
+ add_test_func("/utc_system_settings_get_value_string_n", utc_system_settings_get_value_string_n);
+ add_test_func("/utc_system_settings_get_value_bool_p1", utc_system_settings_get_value_bool_p1);
+ add_test_func("/utc_system_settings_get_value_bool_p2", utc_system_settings_get_value_bool_p2);
+ add_test_func("/utc_system_settings_get_value_bool_p3", utc_system_settings_get_value_bool_p3);
+ add_test_func("/utc_system_settings_get_value_bool_p4", utc_system_settings_get_value_bool_p4);
+ add_test_func("/utc_system_settings_get_value_bool_p5", utc_system_settings_get_value_bool_p5);
+ add_test_func("/utc_system_settings_get_value_bool_p6", utc_system_settings_get_value_bool_p6);
+ add_test_func("/utc_system_settings_get_value_bool_p7", utc_system_settings_get_value_bool_p7);
+ add_test_func("/utc_system_settings_get_value_bool_p8", utc_system_settings_get_value_bool_p8);
+ add_test_func("/utc_system_settings_get_value_bool_p9", utc_system_settings_get_value_bool_p9);
+ add_test_func("/utc_system_settings_get_value_bool_p10", utc_system_settings_get_value_bool_p10);
+ add_test_func("/utc_system_settings_get_value_bool_n", utc_system_settings_get_value_bool_n);
+ add_test_func("/utc_system_settings_get_value_int_p1", utc_system_settings_get_value_int_p1);
+ add_test_func("/utc_system_settings_get_value_int_p2", utc_system_settings_get_value_int_p2);
+ add_test_func("/utc_system_settings_get_value_n", utc_system_settings_get_value_n);
+ add_test_func("/utc_system_settings_get_value_int_p3", utc_system_settings_get_value_int_p3);
+ add_test_func("/utc_system_settings_get_value_bool_p11", utc_system_settings_get_value_bool_p11);
+ add_test_func("/utc_system_settings_get_value_int_p4", utc_system_settings_get_value_int_p4);
+ g_test_add_func("/utc_system_settings_set_value_string_n2", utc_system_settings_set_value_string_n2);
+ g_test_add_func("/utc_system_settings_set_value_string_n3", utc_system_settings_set_value_string_n3);
+ add_test_func("/utc_system_settings_set_value_string_n4", utc_system_settings_set_value_string_n4);
+ add_test_func("/utc_system_settings_set_value_string_n5", utc_system_settings_set_value_string_n5);
+ g_test_add_func("/utc_system_settings_set_value_string_n7", utc_system_settings_set_value_string_n7);
+ add_test_func("/utc_system_settings_set_value_string_n8", utc_system_settings_set_value_string_n8);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p1", utc_system_settings_set_changed_cb_p1);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p1", utc_system_settings_unset_changed_cb_p1);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p2", utc_system_settings_set_changed_cb_p2);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p2", utc_system_settings_unset_changed_cb_p2);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p3", utc_system_settings_set_changed_cb_p3);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p3", utc_system_settings_unset_changed_cb_p3);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p4", utc_system_settings_set_changed_cb_p4);
+ g_test_add_func("/utc_system_settings_LOCK_SCREEN_unset_changed_cb_p", utc_system_settings_LOCK_SCREEN_unset_changed_cb_p);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p5", utc_system_settings_set_changed_cb_p5);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p4", utc_system_settings_unset_changed_cb_p4);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p6", utc_system_settings_set_changed_cb_p6);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p5", utc_system_settings_unset_changed_cb_p5);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p7", utc_system_settings_set_changed_cb_p7);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p6", utc_system_settings_unset_changed_cb_p6);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p8", utc_system_settings_set_changed_cb_p8);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p7", utc_system_settings_unset_changed_cb_p7);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p9", utc_system_settings_set_changed_cb_p9);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p8", utc_system_settings_unset_changed_cb_p8);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p10", utc_system_settings_set_changed_cb_p10);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p9", utc_system_settings_unset_changed_cb_p9);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p11", utc_system_settings_set_changed_cb_p11);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p10", utc_system_settings_unset_changed_cb_p10);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p12", utc_system_settings_set_changed_cb_p12);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p11", utc_system_settings_unset_changed_cb_p11);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p13", utc_system_settings_set_changed_cb_p13);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p12", utc_system_settings_unset_changed_cb_p12);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p14", utc_system_settings_set_changed_cb_p14);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p13", utc_system_settings_unset_changed_cb_p13);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p15", utc_system_settings_set_changed_cb_p15);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p14", utc_system_settings_unset_changed_cb_p14);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p16", utc_system_settings_set_changed_cb_p16);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p15", utc_system_settings_unset_changed_cb_p15);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p17", utc_system_settings_set_changed_cb_p17);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p16", utc_system_settings_unset_changed_cb_p16);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p18", utc_system_settings_set_changed_cb_p18);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p17", utc_system_settings_unset_changed_cb_p17);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p19", utc_system_settings_set_changed_cb_p19);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p18", utc_system_settings_unset_changed_cb_p18);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p20", utc_system_settings_set_changed_cb_p20);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p19;", utc_system_settings_unset_changed_cb_p19);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p21", utc_system_settings_set_changed_cb_p21);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p20", utc_system_settings_unset_changed_cb_p20);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p22", utc_system_settings_set_changed_cb_p22);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p21", utc_system_settings_unset_changed_cb_p21);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p23", utc_system_settings_set_changed_cb_p23);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p22", utc_system_settings_unset_changed_cb_p22);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p24", utc_system_settings_set_changed_cb_p24);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p23", utc_system_settings_unset_changed_cb_p23);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p25", utc_system_settings_set_changed_cb_p25);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p24", utc_system_settings_unset_changed_cb_p24);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p27", utc_system_settings_set_changed_cb_p27);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p26", utc_system_settings_unset_changed_cb_p26);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p29", utc_system_settings_set_changed_cb_p29);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p28", utc_system_settings_unset_changed_cb_p28);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p31", utc_system_settings_set_changed_cb_p31);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p30", utc_system_settings_unset_changed_cb_p30);
+ g_test_add_func("/utc_system_settings_set_changed_cb_p33", utc_system_settings_set_changed_cb_p33);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_p32", utc_system_settings_unset_changed_cb_p32);
+ g_test_add_func("/utc_system_settings_add_ringtone_list_p1", utc_system_settings_add_ringtone_list_p1);
+ g_test_add_func("/utc_system_settings_delete_ringtone_list_p1", utc_system_settings_delete_ringtone_list_p1);
+ add_test_func("/utc_system_settings_set_value_string_p1", utc_system_settings_set_value_string_p1);
+ add_test_func("/utc_system_settings_set_value_string_p2", utc_system_settings_set_value_string_p2);
+ g_test_add_func("/utc_system_settings_set_value_string_p3", utc_system_settings_set_value_string_p3);
+ g_test_add_func("/utc_system_settings_set_value_string_p4", utc_system_settings_set_value_string_p4);
+ add_test_func("/utc_system_settings_set_value_bool_n1", utc_system_settings_set_value_bool_n1);
+ add_test_func("/utc_system_settings_set_value_bool_n2", utc_system_settings_set_value_bool_n2);
+ add_test_func("/utc_system_settings_set_value_bool_n3", utc_system_settings_set_value_bool_n3);
+ add_test_func("/utc_system_settings_set_value_bool_n4", utc_system_settings_set_value_bool_n4);
+ add_test_func("/utc_system_settings_set_value_bool_n5", utc_system_settings_set_value_bool_n5);
+ add_test_func("/utc_system_settings_set_value_bool_n6", utc_system_settings_set_value_bool_n6);
+ add_test_func("/utc_system_settings_set_value_bool_p1", utc_system_settings_set_value_bool_p1);
+ add_test_func("/utc_system_settings_set_value_bool_p2", utc_system_settings_set_value_bool_p2);
+ add_test_func("/utc_system_settings_set_value_int_n1", utc_system_settings_set_value_int_n1);
+ g_test_add_func("/utc_system_settings_set_changed_cb_n", utc_system_settings_set_changed_cb_n);
+ add_test_func("/utc_system_settings_set_value_int_p1", utc_system_settings_set_value_int_p1);
+ add_test_func("/utc_system_settings_set_value_int_n2", utc_system_settings_set_value_int_n2);
+ add_test_func("/utc_system_settings_set_value_bool_p3", utc_system_settings_set_value_bool_p3);
+ add_test_func("/utc_system_settings_set_value_bool_p4", utc_system_settings_set_value_bool_p4);
+ add_test_func("/utc_system_settings_set_value_bool_p5", utc_system_settings_set_value_bool_p5);
+ add_test_func("/utc_system_settings_set_value_bool_p6", utc_system_settings_set_value_bool_p6);
+ add_test_func("/utc_system_settings_set_value_int_p2", utc_system_settings_set_value_int_p2);
+ add_test_func("/utc_system_settings_set_value_string_n6", utc_system_settings_set_value_string_n6);
+ g_test_add_func("/utc_system_settings_unset_changed_cb_n", utc_system_settings_unset_changed_cb_n);
+}
+
--- /dev/null
+#include <unit_test_fw.h>
+
+typedef struct __thread_test_table {
+ char * test_name;
+ GTestFunc t_func;
+} thread_test_node;
+
+
+static GThread *my_thread = NULL;
+static GMainLoop *main_loop = NULL;
+static thread_test_node thread_test_table[1000] = {0};
+static int thread_test_idx = 0;
+static int loop = 100;
+static int thread_sw = 1;
+
+
+void *thread_function(void *data)
+{
+ int cnt = 0;
+ int test_idx = (int)data;
+
+ while (thread_sw) {
+ if (cnt > loop)
+ break;
+ cnt++;
+ thread_test_table[test_idx].t_func();
+ sleep(0);
+ }
+
+ return 0;
+
+}
+
+static GThread **unit_test_thread_start(int test_num)
+{
+ int i;
+ GThread **thread_list = (GThread **)calloc(sizeof(GThread*), N_THREADS);
+ for (i = 0; i < N_THREADS; i++) {
+ thread_list[i] = g_thread_new(NULL, thread_function, (void*)test_num);
+ }
+ return thread_list;
+}
+
+static void unit_test_thread_stop(GThread **thread_list)
+{
+ int i;
+ for (i = 0; i < N_THREADS; i++) {
+ g_thread_join(thread_list[i]);
+ }
+
+ g_free(thread_list);
+}
+
+static void unit_thread_test()
+{
+ int i;
+ GThread **thread_test[MAX_TEST_CASE];
+
+ printf("START!!!! thread test for system-settings %d tests\n", thread_test_idx);
+
+ thread_sw = 1;
+ for (i = 0; i < thread_test_idx; i++) {
+ thread_test[i] = unit_test_thread_start(i);
+ printf("%3d %s:start!\n", i, thread_test_table[i].test_name);
+
+ unit_test_thread_stop(thread_test[i]);
+ printf("%3d %s:OK\n", i, thread_test_table[i].test_name);
+ }
+
+ printf("END!!!! thread test for system-settings\n");
+}
+
+static gpointer loop_func(gpointer data)
+{
+ g_main_loop_run(main_loop);
+ return NULL;
+}
+
+static void start_main_loop_thread()
+{
+ my_thread = g_thread_new(NULL, loop_func, NULL);
+}
+
+static void stop_main_loop_thread()
+{
+ g_main_loop_quit(main_loop);
+ g_thread_join(my_thread);
+ g_main_loop_unref(main_loop);
+}
+
+int main(int argc, char* argv[])
+{
+ ecore_evas_init();
+
+ main_loop = g_main_loop_new(NULL, FALSE);
+
+ g_test_init(&argc, &argv, NULL);
+ g_test_set_nonfatal_assertions();
+
+ start_main_loop_thread();
+
+ unittest_api();
+
+ g_test_run();
+ unit_thread_test();
+
+ stop_main_loop_thread();
+ return 0;
+}
+
+void add_test_func(char * test_name, GTestFunc func_pointer)
+{
+ g_test_add_func(test_name, func_pointer);
+
+ thread_test_table[thread_test_idx].test_name = test_name;
+ thread_test_table[thread_test_idx].t_func = func_pointer;
+
+ thread_test_idx++;
+}
+