extern int utc_sticker_data_get_date_p(void);
extern int utc_sticker_data_get_date_n(void);
+extern int utc_sticker_data_set_display_type_p(void);
+extern int utc_sticker_data_set_display_type_n(void);
+
+extern int utc_sticker_data_get_display_type_p(void);
+extern int utc_sticker_data_get_display_type_n(void);
+
// Provider
extern void utc_capi_ui_sticker_provider_startup(void);
extern void utc_capi_ui_sticker_provider_cleanup(void);
extern int utc_sticker_provider_data_foreach_all_p(void);
extern int utc_sticker_provider_data_foreach_all_n(void);
+extern int utc_sticker_provider_delete_data_by_uri_p(void);
+extern int utc_sticker_provider_delete_data_by_uri_n(void);
+extern int utc_sticker_provider_delete_data_by_uri_n2(void);
+
// Consumer
extern void utc_capi_ui_sticker_consumer_startup(void);
extern void utc_capi_ui_sticker_consumer_cleanup(void);
extern int utc_sticker_consumer_keyword_list_foreach_all_p(void);
extern int utc_sticker_consumer_keyword_list_foreach_all_n(void);
+extern int utc_sticker_consumer_data_foreach_by_display_type_p(void);
+extern int utc_sticker_consumer_data_foreach_by_display_type_n(void);
+
+extern int utc_sticker_consumer_group_list_foreach_by_display_type_p(void);
+extern int utc_sticker_consumer_group_list_foreach_by_display_type_n(void);
+
+extern int utc_sticker_consumer_add_recent_data_p(void);
+extern int utc_sticker_consumer_add_recent_data_n(void);
+
+extern int utc_sticker_consumer_get_recent_data_list_p(void);
+extern int utc_sticker_consumer_get_recent_data_list_n(void);
+
+extern int utc_sticker_consumer_set_event_cb_p(void);
+extern int utc_sticker_consumer_set_event_cb_n(void);
+
+extern int utc_sticker_consumer_unset_event_cb_p(void);
+extern int utc_sticker_consumer_unset_event_cb_n(void);
+
testcase tc_array[] = {
{"utc_sticker_data_create_p", utc_sticker_data_create_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_create_n", utc_sticker_data_create_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_get_description_n", utc_sticker_data_get_description_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_get_date_p", utc_sticker_data_get_date_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_get_date_n", utc_sticker_data_get_date_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_set_display_type_p", utc_sticker_data_set_display_type_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_set_display_type_n", utc_sticker_data_set_display_type_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_get_display_type_p", utc_sticker_data_get_display_type_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_get_display_type_n", utc_sticker_data_get_display_type_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_provider_create_p", utc_sticker_provider_create_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_create_n", utc_sticker_provider_create_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_destroy_p", utc_sticker_provider_destroy_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_get_sticker_count_n", utc_sticker_provider_get_sticker_count_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_data_foreach_all_p", utc_sticker_provider_data_foreach_all_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_data_foreach_all_n", utc_sticker_provider_data_foreach_all_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
+ {"utc_sticker_provider_delete_data_by_uri_p", utc_sticker_provider_delete_data_by_uri_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
+ {"utc_sticker_provider_delete_data_by_uri_n", utc_sticker_provider_delete_data_by_uri_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
+ {"utc_sticker_provider_delete_data_by_uri_n2", utc_sticker_provider_delete_data_by_uri_n2, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_consumer_create_p", utc_sticker_consumer_create_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_create_n", utc_sticker_consumer_create_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_destroy_p", utc_sticker_consumer_destroy_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_group_list_foreach_all_n", utc_sticker_consumer_group_list_foreach_all_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_keyword_list_foreach_all_p", utc_sticker_consumer_keyword_list_foreach_all_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_keyword_list_foreach_all_n", utc_sticker_consumer_keyword_list_foreach_all_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_data_foreach_by_display_type_p", utc_sticker_consumer_data_foreach_by_display_type_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_data_foreach_by_display_type_n", utc_sticker_consumer_data_foreach_by_display_type_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_group_list_foreach_by_display_type_p", utc_sticker_consumer_group_list_foreach_by_display_type_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_group_list_foreach_by_display_type_n", utc_sticker_consumer_group_list_foreach_by_display_type_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_add_recent_data_p", utc_sticker_consumer_add_recent_data_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_add_recent_data_n", utc_sticker_consumer_add_recent_data_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_get_recent_data_list_p", utc_sticker_consumer_get_recent_data_list_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_get_recent_data_list_n", utc_sticker_consumer_get_recent_data_list_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_set_event_cb_p", utc_sticker_consumer_set_event_cb_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_set_event_cb_n", utc_sticker_consumer_set_event_cb_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_unset_event_cb_p", utc_sticker_consumer_unset_event_cb_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_unset_event_cb_n", utc_sticker_consumer_unset_event_cb_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{NULL, NULL}
};
extern int utc_sticker_data_get_date_p(void);
extern int utc_sticker_data_get_date_n(void);
+extern int utc_sticker_data_set_display_type_p(void);
+extern int utc_sticker_data_set_display_type_n(void);
+
+extern int utc_sticker_data_get_display_type_p(void);
+extern int utc_sticker_data_get_display_type_n(void);
+
// Provider
extern void utc_capi_ui_sticker_provider_startup(void);
extern void utc_capi_ui_sticker_provider_cleanup(void);
extern int utc_sticker_provider_data_foreach_all_p(void);
extern int utc_sticker_provider_data_foreach_all_n(void);
+extern int utc_sticker_provider_delete_data_by_uri_p(void);
+extern int utc_sticker_provider_delete_data_by_uri_n(void);
+extern int utc_sticker_provider_delete_data_by_uri_n2(void);
+
// Consumer
extern void utc_capi_ui_sticker_consumer_startup(void);
extern void utc_capi_ui_sticker_consumer_cleanup(void);
extern int utc_sticker_consumer_keyword_list_foreach_all_p(void);
extern int utc_sticker_consumer_keyword_list_foreach_all_n(void);
+extern int utc_sticker_consumer_data_foreach_by_display_type_p(void);
+extern int utc_sticker_consumer_data_foreach_by_display_type_n(void);
+
+extern int utc_sticker_consumer_group_list_foreach_by_display_type_p(void);
+extern int utc_sticker_consumer_group_list_foreach_by_display_type_n(void);
+
+extern int utc_sticker_consumer_add_recent_data_p(void);
+extern int utc_sticker_consumer_add_recent_data_n(void);
+
+extern int utc_sticker_consumer_get_recent_data_list_p(void);
+extern int utc_sticker_consumer_get_recent_data_list_n(void);
+
+extern int utc_sticker_consumer_set_event_cb_p(void);
+extern int utc_sticker_consumer_set_event_cb_n(void);
+
+extern int utc_sticker_consumer_unset_event_cb_p(void);
+extern int utc_sticker_consumer_unset_event_cb_n(void);
+
testcase tc_array[] = {
{"utc_sticker_data_create_p", utc_sticker_data_create_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_create_n", utc_sticker_data_create_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_get_description_n", utc_sticker_data_get_description_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_get_date_p", utc_sticker_data_get_date_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_data_get_date_n", utc_sticker_data_get_date_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_set_display_type_p", utc_sticker_data_set_display_type_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_set_display_type_n", utc_sticker_data_set_display_type_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_get_display_type_p", utc_sticker_data_get_display_type_p, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
+ {"utc_sticker_data_get_display_type_n", utc_sticker_data_get_display_type_n, utc_capi_ui_sticker_data_startup, utc_capi_ui_sticker_data_cleanup},
{"utc_sticker_provider_create_p", utc_sticker_provider_create_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_create_n", utc_sticker_provider_create_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_destroy_p", utc_sticker_provider_destroy_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_get_sticker_count_n", utc_sticker_provider_get_sticker_count_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_data_foreach_all_p", utc_sticker_provider_data_foreach_all_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_provider_data_foreach_all_n", utc_sticker_provider_data_foreach_all_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
+ {"utc_sticker_provider_delete_data_by_uri_p", utc_sticker_provider_delete_data_by_uri_p, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
+ {"utc_sticker_provider_delete_data_by_uri_n", utc_sticker_provider_delete_data_by_uri_n, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
+ {"utc_sticker_provider_delete_data_by_uri_n2", utc_sticker_provider_delete_data_by_uri_n2, utc_capi_ui_sticker_provider_startup, utc_capi_ui_sticker_provider_cleanup},
{"utc_sticker_consumer_create_p", utc_sticker_consumer_create_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_create_n", utc_sticker_consumer_create_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_destroy_p", utc_sticker_consumer_destroy_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_group_list_foreach_all_n", utc_sticker_consumer_group_list_foreach_all_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_keyword_list_foreach_all_p", utc_sticker_consumer_keyword_list_foreach_all_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{"utc_sticker_consumer_keyword_list_foreach_all_n", utc_sticker_consumer_keyword_list_foreach_all_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_data_foreach_by_display_type_p", utc_sticker_consumer_data_foreach_by_display_type_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_data_foreach_by_display_type_n", utc_sticker_consumer_data_foreach_by_display_type_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_group_list_foreach_by_display_type_p", utc_sticker_consumer_group_list_foreach_by_display_type_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_group_list_foreach_by_display_type_n", utc_sticker_consumer_group_list_foreach_by_display_type_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_add_recent_data_p", utc_sticker_consumer_add_recent_data_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_add_recent_data_n", utc_sticker_consumer_add_recent_data_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_get_recent_data_list_p", utc_sticker_consumer_get_recent_data_list_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_get_recent_data_list_n", utc_sticker_consumer_get_recent_data_list_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_set_event_cb_p", utc_sticker_consumer_set_event_cb_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_set_event_cb_n", utc_sticker_consumer_set_event_cb_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_unset_event_cb_p", utc_sticker_consumer_unset_event_cb_p, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
+ {"utc_sticker_consumer_unset_event_cb_n", utc_sticker_consumer_unset_event_cb_n, utc_capi_ui_sticker_consumer_startup, utc_capi_ui_sticker_consumer_cleanup},
{NULL, NULL}
};
static sticker_data_h g_dh = NULL;
static sticker_provider_h g_ph = NULL;
static sticker_consumer_h g_ch = NULL;
+GMainLoop *async_g_loop = NULL;
static void sticker_data_foreach_cb(sticker_data_h data_handle, void *user_data)
{
callback_result = true;
}
+static void event_cb(sticker_consumer_event_type_e event_type, sticker_data_h data_handle, void *user_data)
+{
+ callback_result = true;
+}
+
static void foreach_to_check_del(sticker_data_h data_handle, void *user_data)
{
sticker_provider_delete_data(g_ph, data_handle);
}
+static gboolean timeout_func(gpointer data)
+{
+ g_main_loop_quit((GMainLoop *) data);
+ return false;
+}
+
+static void wait_for_async()
+{
+ int t_id = 0;
+ async_g_loop = g_main_loop_new(NULL, FALSE);
+ t_id = g_timeout_add(5000, timeout_func, async_g_loop);
+ g_main_loop_run(async_g_loop);
+ g_source_remove(t_id);
+ g_main_loop_unref(async_g_loop);
+ async_g_loop = NULL;
+}
+
/**
* @function utc_capi_ui_sticker_consumer_startup
* @description Called before each test
sticker_data_set_group_name(g_dh, "tizen");
sticker_data_set_thumbnail(g_dh, "/res/test.png");
sticker_data_set_description(g_dh, "TCT Test");
+ sticker_data_set_display_type(g_dh, STICKER_DATA_DISP_WALLPAPER);
sticker_provider_insert_data(g_ph, g_dh);
}
}
else
assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_data_foreach_by_display_type_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that retrieves all sticker data using display type.
+ */
+int utc_sticker_consumer_data_foreach_by_display_type_p(void)
+{
+ int result = 0;
+ callback_result = false;
+ int ret = sticker_consumer_data_foreach_by_display_type(g_ch, 0, 1000, &result, STICKER_DATA_DISP_WALLPAPER, sticker_data_foreach_cb, NULL);
+ if (sticker_supported == true) {
+ assert_eq(callback_result, true);
+ assert_eq(ret, STICKER_ERROR_NONE);
+ }
+ else {
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_data_foreach_by_display_type_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that retrieves all sticker data using display type.
+ */
+int utc_sticker_consumer_data_foreach_by_display_type_n(void)
+{
+ int result = 0;
+ int ret = sticker_consumer_data_foreach_by_display_type(g_ch, -1, 0, &result, STICKER_DATA_DISP_WALLPAPER, sticker_data_foreach_cb, NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_group_list_foreach_by_display_type_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that retrieves all group name using display type.
+ */
+int utc_sticker_consumer_group_list_foreach_by_display_type_p(void)
+{
+ callback_result = false;
+ int ret = sticker_consumer_group_list_foreach_by_display_type(g_ch, STICKER_DATA_DISP_WALLPAPER, group_list_foreach_cb, NULL);
+ if (sticker_supported == true) {
+ assert_eq(callback_result, true);
+ assert_eq(ret, STICKER_ERROR_NONE);
+ }
+ else {
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_group_list_foreach_by_display_type_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that retrieves all group name using display type.
+ */
+int utc_sticker_consumer_group_list_foreach_by_display_type_n(void)
+{
+ int ret = sticker_consumer_group_list_foreach_by_display_type(g_ch, STICKER_DATA_DISP_WALLPAPER, NULL, NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_add_recent_data_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that adds entry to recently used stickers list.
+ */
+int utc_sticker_consumer_add_recent_data_p(void)
+{
+ int ret = sticker_consumer_add_recent_data(g_ch, g_dh);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_NONE);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_add_recent_data_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that adds entry to recently used stickers list.
+ */
+int utc_sticker_consumer_add_recent_data_n(void)
+{
+ int ret = sticker_consumer_add_recent_data(g_ch, NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_get_recent_data_list_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that gets recently used stickers list.
+ */
+int utc_sticker_consumer_get_recent_data_list_p(void)
+{
+ int result = 0;
+ callback_result = false;
+ sticker_consumer_add_recent_data(g_ch, g_dh);
+ int ret = sticker_consumer_get_recent_data_list(g_ch, 1, &result, sticker_data_foreach_cb, NULL);
+ if (sticker_supported == true) {
+ assert_eq(callback_result, true);
+ assert_eq(ret, STICKER_ERROR_NONE);
+ }
+ else {
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_get_recent_data_list_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that gets recently used stickers list.
+ */
+int utc_sticker_consumer_get_recent_data_list_n(void)
+{
+ int result = 0;
+ int ret = sticker_consumer_get_recent_data_list(g_ch, 0, &result, sticker_data_foreach_cb, NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_set_event_cb_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that registers a event callback function.
+ */
+int utc_sticker_consumer_set_event_cb_p(void)
+{
+ callback_result = false;
+ int ret = sticker_consumer_set_event_cb(g_ch, event_cb, NULL);
+ if (sticker_supported == true) {
+ assert_eq(ret, STICKER_ERROR_NONE);
+ } else {
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ sticker_provider_delete_data(g_ph, g_dh);
+ wait_for_async();
+ assert_eq(callback_result, true);
+ sticker_consumer_unset_event_cb(g_ch);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_set_event_cb_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that registers a event callback function.
+ */
+int utc_sticker_consumer_set_event_cb_n(void)
+{
+ int ret = sticker_consumer_set_event_cb(g_ch, NULL, NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_unset_event_cb_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that unregisters a event callback function.
+ */
+int utc_sticker_consumer_unset_event_cb_p(void)
+{
+ sticker_consumer_set_event_cb(g_ch, event_cb, NULL);
+ int ret = sticker_consumer_unset_event_cb(g_ch);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_NONE);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_consumer_unset_event_cb_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that unregisters a event callback function.
+ */
+int utc_sticker_consumer_unset_event_cb_n(void)
+{
+ int ret = sticker_consumer_unset_event_cb(NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
return 0;
}
\ No newline at end of file
#include <stdbool.h>
#include <system_info.h>
#include <sticker_data.h>
+#include <sticker_provider.h>
#define STICKER_FEATURE "tizen.org/feature/ui_service.sticker"
static bool sticker_supported = false;
static bool callback_result = false;
static sticker_data_h g_dh = NULL;
+static sticker_provider_h g_ph = NULL;
static void foreach_keyword_cb(const char *keyword, void *user_data)
{
sticker_data_set_group_name(g_dh, "tizen");
sticker_data_set_thumbnail(g_dh, "/res/test.png");
sticker_data_set_description(g_dh, "TCT Test");
+ sticker_data_set_display_type(g_dh, STICKER_DATA_DISP_WALLPAPER);
}
}
else
assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_data_set_display_type_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that sets display type of sticker data.
+ */
+int utc_sticker_data_set_display_type_p(void)
+{
+ int ret = sticker_data_set_display_type(g_dh, STICKER_DATA_DISP_EMOJI);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_NONE);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_data_set_display_type_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that sets display type of sticker data.
+ */
+int utc_sticker_data_set_display_type_n(void)
+{
+ int ret = sticker_data_set_display_type(g_dh, 100);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_data_get_display_type_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that gets display type of sticker data.
+ */
+int utc_sticker_data_get_display_type_p(void)
+{
+ sticker_data_display_type_e disp_type;
+ int ret = sticker_data_get_display_type(g_dh, &disp_type);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_NONE);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_data_get_display_type_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that gets display type of sticker data.
+ */
+int utc_sticker_data_get_display_type_n(void)
+{
+ int ret = sticker_data_get_display_type(g_dh, NULL);
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
return 0;
}
\ No newline at end of file
sticker_data_set_group_name(g_dh, "tizen");
sticker_data_set_thumbnail(g_dh, "/res/test.png");
sticker_data_set_description(g_dh, "TCT Test");
+ sticker_data_set_display_type(g_dh, STICKER_DATA_DISP_WALLPAPER);
}
}
else
assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_provider_delete_data_by_uri_p
+ * @since_tizen 5.5
+ * @description Positive UTC of the function that deletes a sticker data using URI.
+ */
+int utc_sticker_provider_delete_data_by_uri_p(void)
+{
+ sticker_provider_insert_data(g_ph, g_dh);
+ int ret = sticker_provider_delete_data_by_uri(g_ph, "www.samsung.com");
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_NONE);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_provider_delete_data_by_uri_n
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that deletes a sticker data using URI.
+ */
+int utc_sticker_provider_delete_data_by_uri_n(void)
+{
+ int ret = sticker_provider_delete_data_by_uri(NULL, "");
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_sticker_provider_delete_data_by_uri_n2
+ * @since_tizen 5.5
+ * @description Negative UTC of the function that deletes a sticker data using URI.
+ */
+int utc_sticker_provider_delete_data_by_uri_n2(void)
+{
+ int ret = sticker_provider_delete_data_by_uri(g_ph, "www.invalid.com");
+ if (sticker_supported == true)
+ assert_eq(ret, STICKER_ERROR_NO_SUCH_FILE);
+ else
+ assert_eq(ret, STICKER_ERROR_NOT_SUPPORTED);
+
return 0;
}
\ No newline at end of file