[UTC][capi-ui-sticker][ACR-1534][Add TCs for new APIs] 18/234018/3
authorInHong Han <inhong1.han@samsung.com>
Thu, 21 May 2020 06:05:52 +0000 (15:05 +0900)
committerInHong Han <inhong1.han@samsung.com>
Mon, 25 May 2020 07:23:24 +0000 (07:23 +0000)
Change-Id: I7432a0c6132eb5de11d84858019a0e0069fed6aa

src/utc/capi-ui-sticker/tct-capi-ui-sticker-core_mobile.h
src/utc/capi-ui-sticker/tct-capi-ui-sticker-core_wearable.h
src/utc/capi-ui-sticker/utc-capi-ui-sticker_consumer.c
src/utc/capi-ui-sticker/utc-capi-ui-sticker_data.c
src/utc/capi-ui-sticker/utc-capi-ui-sticker_provider.c

index fe0abc7e2178607a9240b40519ec41dfec1174ec..c4463fe6c09ef5a87a129b18f72d7448083fb579 100644 (file)
@@ -75,6 +75,12 @@ extern int utc_sticker_data_get_description_n(void);
 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);
@@ -104,6 +110,10 @@ extern int utc_sticker_provider_get_sticker_count_n(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);
@@ -132,6 +142,24 @@ extern int utc_sticker_consumer_group_list_foreach_all_n(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},
@@ -169,6 +197,10 @@ testcase tc_array[] = {
     {"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},
@@ -186,6 +218,9 @@ testcase tc_array[] = {
     {"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},
@@ -202,6 +237,18 @@ testcase tc_array[] = {
     {"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}
 };
 
index fe0abc7e2178607a9240b40519ec41dfec1174ec..c4463fe6c09ef5a87a129b18f72d7448083fb579 100644 (file)
@@ -75,6 +75,12 @@ extern int utc_sticker_data_get_description_n(void);
 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);
@@ -104,6 +110,10 @@ extern int utc_sticker_provider_get_sticker_count_n(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);
@@ -132,6 +142,24 @@ extern int utc_sticker_consumer_group_list_foreach_all_n(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},
@@ -169,6 +197,10 @@ testcase tc_array[] = {
     {"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},
@@ -186,6 +218,9 @@ testcase tc_array[] = {
     {"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},
@@ -202,6 +237,18 @@ testcase tc_array[] = {
     {"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}
 };
 
index 450b37a69d5bb445cfdad259af1839af0dc296bf..4bc80ec33cc0235844aedb77700a1fcfd8fafedf 100644 (file)
@@ -28,6 +28,7 @@ static bool callback_result = false;
 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)
 {
@@ -44,11 +45,33 @@ static void keyword_list_foreach_cb(const char *keyword, 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
@@ -73,6 +96,7 @@ void utc_capi_ui_sticker_consumer_startup(void)
         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);
     }
 }
@@ -395,5 +419,223 @@ int utc_sticker_consumer_keyword_list_foreach_all_n(void)
     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
index 8bb54cfb5db6ab862a19d8a9d5bcfc6168b8847f..eb6c6c6ad2881aec42a983d3a78a6e9513dd4abe 100644 (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)
 {
@@ -51,6 +53,7 @@ void utc_capi_ui_sticker_data_startup(void)
         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);
     }
 }
 
@@ -700,5 +703,70 @@ int utc_sticker_data_get_date_n(void)
     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
index e90f05433c4f2d5da5e4fd93178203f0faa6bab3..6d018f05d982718a03f001c676e0926a0a97740b 100644 (file)
@@ -101,6 +101,7 @@ void utc_capi_ui_sticker_provider_startup(void)
         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);
     }
 }
 
@@ -429,5 +430,54 @@ int utc_sticker_provider_data_foreach_all_n(void)
     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