[UTC][shortcut][ACR-810]Add new tc for unset api
authorMyungki Lee <mk5004.lee@samsung.com>
Wed, 7 Dec 2016 10:11:44 +0000 (19:11 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Wed, 7 Dec 2016 10:16:29 +0000 (19:16 +0900)
Change-Id: I79912183c0fd7a000aef9c1c2d1d365e91910f9d
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
src/utc/shortcut/tct-shortcut-core_mobile.h
src/utc/shortcut/utc-shortcut.c

index bacc5692c1bbdbb69366b746e1006d1e5b582ce7..355f5ca198fc4f38872ccdbb610697dedb37fbb4 100755 (executable)
@@ -32,6 +32,10 @@ extern int utc_shortcut_set_remove_cb_n(void);
 extern int utc_shortcut_set_remove_cb_p(void);
 extern int utc_shortcut_remove_from_home_n(void);
 extern int utc_shortcut_remove_from_home_p(void);
+extern int utc_shortcut_unset_request_cb_n(void);
+extern int utc_shortcut_unset_request_cb_p(void);
+extern int utc_shortcut_unset_remove_cb_n(void);
+extern int utc_shortcut_unset_remove_cb_p(void);
 
 testcase tc_array[] = {
     {"utc_shortcut_add_to_home_n", utc_shortcut_add_to_home_n, NULL, NULL},
@@ -46,6 +50,10 @@ testcase tc_array[] = {
     {"utc_shortcut_set_remove_cb_p", utc_shortcut_set_remove_cb_p, NULL, NULL},
     {"utc_shortcut_remove_from_home_n", utc_shortcut_remove_from_home_n, NULL, NULL},
     {"utc_shortcut_remove_from_home_p", utc_shortcut_remove_from_home_p, NULL, NULL},
+    {"utc_shortcut_unset_request_cb_n", utc_shortcut_unset_request_cb_n, NULL, NULL},
+    {"utc_shortcut_unset_request_cb_p", utc_shortcut_unset_request_cb_p, NULL, NULL},
+    {"utc_shortcut_unset_remove_cb_n", utc_shortcut_unset_remove_cb_n, NULL, NULL},
+    {"utc_shortcut_unset_remove_cb_p", utc_shortcut_unset_remove_cb_p, NULL, NULL},
     {NULL, NULL}
 };
 
index 90a86b9d8fc637dd0e41b78af358918c1d0fa21c..d714e8be165ff6d6f5e6ce17871a724b0d6ab225 100755 (executable)
@@ -188,7 +188,72 @@ int utc_shortcut_set_remove_cb_p(void)
     return 0;
 }
 
+/**
+ * @testcase           utc_shortcut_unset_request_cb_n
+ * @since_tizen                3.0
+ * @description                Negative test case of shortcut_unset_request_cb()
+ */
+int utc_shortcut_unset_request_cb_n(void)
+{
+    int ret;
+
+    ret = shortcut_set_request_cb(NULL, "temp");
+    assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
+
+    shortcut_unset_request_cb();
+
+    return 0;
+}
+
+/**
+ * @testcase           utc_shortcut_unset_request_cb_p
+ * @since_tizen                3.0
+ * @description                Positive test case of shortcut_unset_request_cb()
+ */
+int utc_shortcut_unset_request_cb_p(void)
+{
+    int ret;
+
+    ret = shortcut_set_request_cb(_request_cb, "temp");
+    assert_eq(ret, SHORTCUT_ERROR_NONE);
+
+    shortcut_unset_request_cb();
+
+    return 0;
+}
 
+/**
+ * @testcase           utc_shortcut_unset_remove_cb_n
+ * @since_tizen                3.0
+ * @description                Negative test case of shortcut_unset_remove_cb()
+ */
+int utc_shortcut_unset_remove_cb_n(void)
+{
+    int ret;
+
+    ret = shortcut_set_remove_cb(NULL, "temp");
+    assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
+
+    shortcut_unset_remove_cb();
+
+    return 0;
+}
+
+/**
+ * @testcase           utc_shortcut_unset_remove_cb_p
+ * @since_tizen                3.0
+ * @description                Positive test case of shortcut_unset_remove_cb()
+ */
+int utc_shortcut_unset_remove_cb_p(void)
+{
+    int ret;
+
+    ret = shortcut_set_remove_cb(_remove_cb, "temp");
+    assert_eq(ret, SHORTCUT_ERROR_NONE);
+
+    shortcut_unset_remove_cb();
+    return 0;
+}
 
 int list_cb(const char *package_name, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *user_data)
 {