[UTC][capi-appfw-app-control][ACR-1417][Add functions for component based application] 47/208647/2
authorhyunho <hhstark.kang@samsung.com>
Thu, 27 Jun 2019 04:17:57 +0000 (13:17 +0900)
committerhyunho <hhstark.kang@samsung.com>
Tue, 9 Jul 2019 01:12:33 +0000 (10:12 +0900)
Change-Id: If76964f61ecd3b1b35ed42811836ca110bf0cb5c
Signed-off-by: hyunho <hhstark.kang@samsung.com>
src/utc/application/assert_common.h
src/utc/application/tct-application-core_mobile.h
src/utc/application/tct-application-core_tizeniot.h
src/utc/application/tct-application-core_wearable.h
src/utc/application/utc_app_control.c

index f34a03d5f781f94d4961b125163aa6cd57a9382b..bedeb8d075afcbc7d7f06b172f23d75dc4c2d08c 100755 (executable)
@@ -35,7 +35,7 @@ char *__correct_value;
                        dlog_print(DLOG_ERROR, LOG_TAG, \
                                "Values \"%s\" and \"%s\" are not equal:\n" \
                                "%s == %d, %s == %d\n", \
-                               #var, #ref, #var, var, #ref, ref); \
+                               #var, #ref, #var, (int)var, #ref, (int)ref); \
                        utc_result = 1; \
                        ui_app_exit(); \
                        return 1; \
@@ -49,7 +49,7 @@ char *__correct_value;
                        dlog_print(DLOG_ERROR, LOG_TAG, \
                                "Values \"%s\" and \"%s\" are equal:\n" \
                                "%s == %s == %d\n", \
-                               #var, #ref, #var, #ref, ref); \
+                               #var, #ref, #var, #ref, (int)ref); \
                        utc_result = 1; \
                        ui_app_exit(); \
                        return 1; \
index c64e565b4ce47cf2cdb5dcfe19a0139db5d31015..420f64df7d995e499bbbc2cd068c77bc1c08b5b2 100755 (executable)
@@ -221,6 +221,10 @@ extern int utc_application_app_control_get_launch_mode_p3(void);
 extern int utc_application_app_control_get_launch_mode_n1(void);
 extern int utc_application_app_control_enable_app_started_result_event_p1(void);
 extern int utc_application_app_control_enable_app_started_result_event_n1(void);
+extern int utc_application_app_control_set_component_id_p1(void);
+extern int utc_application_app_control_set_component_id_n1(void);
+extern int utc_application_app_control_get_component_id_p1(void);
+extern int utc_application_app_control_get_component_id_n1(void);
 extern int utc_application_app_resource_manager_get_p1(void);
 extern int utc_application_app_resource_manager_get_p2(void);
 extern int utc_application_app_resource_manager_get_p3(void);
@@ -582,6 +586,10 @@ testcase tc_array[] = {
        {"utc_application_app_control_set_uri_by_handle_p", utc_application_app_control_set_uri_by_handle_p, NULL, NULL},
        {"utc_application_app_control_set_uri_by_handle_n1", utc_application_app_control_set_uri_by_handle_n1, NULL, NULL},
        {"utc_application_app_control_set_uri_by_handle_n2", utc_application_app_control_set_uri_by_handle_n2, NULL, NULL},
+       {"utc_application_app_control_set_component_id_p1", utc_application_app_control_set_component_id_p1, NULL, NULL},
+       {"utc_application_app_control_set_component_id_n1", utc_application_app_control_set_component_id_n1, NULL, NULL},
+       {"utc_application_app_control_get_component_id_p1", utc_application_app_control_get_component_id_p1, NULL, NULL},
+       {"utc_application_app_control_get_component_id_n1", utc_application_app_control_get_component_id_n1, NULL, NULL},
        {"utc_application_app_control_uri_create_p", utc_application_app_control_uri_create_p, NULL, NULL},
        {"utc_application_app_control_uri_create_n1", utc_application_app_control_uri_create_n1, NULL, NULL},
        {"utc_application_app_control_uri_create_n2", utc_application_app_control_uri_create_n2, NULL, NULL},
index c64e565b4ce47cf2cdb5dcfe19a0139db5d31015..420f64df7d995e499bbbc2cd068c77bc1c08b5b2 100755 (executable)
@@ -221,6 +221,10 @@ extern int utc_application_app_control_get_launch_mode_p3(void);
 extern int utc_application_app_control_get_launch_mode_n1(void);
 extern int utc_application_app_control_enable_app_started_result_event_p1(void);
 extern int utc_application_app_control_enable_app_started_result_event_n1(void);
+extern int utc_application_app_control_set_component_id_p1(void);
+extern int utc_application_app_control_set_component_id_n1(void);
+extern int utc_application_app_control_get_component_id_p1(void);
+extern int utc_application_app_control_get_component_id_n1(void);
 extern int utc_application_app_resource_manager_get_p1(void);
 extern int utc_application_app_resource_manager_get_p2(void);
 extern int utc_application_app_resource_manager_get_p3(void);
@@ -582,6 +586,10 @@ testcase tc_array[] = {
        {"utc_application_app_control_set_uri_by_handle_p", utc_application_app_control_set_uri_by_handle_p, NULL, NULL},
        {"utc_application_app_control_set_uri_by_handle_n1", utc_application_app_control_set_uri_by_handle_n1, NULL, NULL},
        {"utc_application_app_control_set_uri_by_handle_n2", utc_application_app_control_set_uri_by_handle_n2, NULL, NULL},
+       {"utc_application_app_control_set_component_id_p1", utc_application_app_control_set_component_id_p1, NULL, NULL},
+       {"utc_application_app_control_set_component_id_n1", utc_application_app_control_set_component_id_n1, NULL, NULL},
+       {"utc_application_app_control_get_component_id_p1", utc_application_app_control_get_component_id_p1, NULL, NULL},
+       {"utc_application_app_control_get_component_id_n1", utc_application_app_control_get_component_id_n1, NULL, NULL},
        {"utc_application_app_control_uri_create_p", utc_application_app_control_uri_create_p, NULL, NULL},
        {"utc_application_app_control_uri_create_n1", utc_application_app_control_uri_create_n1, NULL, NULL},
        {"utc_application_app_control_uri_create_n2", utc_application_app_control_uri_create_n2, NULL, NULL},
index c64e565b4ce47cf2cdb5dcfe19a0139db5d31015..420f64df7d995e499bbbc2cd068c77bc1c08b5b2 100755 (executable)
@@ -221,6 +221,10 @@ extern int utc_application_app_control_get_launch_mode_p3(void);
 extern int utc_application_app_control_get_launch_mode_n1(void);
 extern int utc_application_app_control_enable_app_started_result_event_p1(void);
 extern int utc_application_app_control_enable_app_started_result_event_n1(void);
+extern int utc_application_app_control_set_component_id_p1(void);
+extern int utc_application_app_control_set_component_id_n1(void);
+extern int utc_application_app_control_get_component_id_p1(void);
+extern int utc_application_app_control_get_component_id_n1(void);
 extern int utc_application_app_resource_manager_get_p1(void);
 extern int utc_application_app_resource_manager_get_p2(void);
 extern int utc_application_app_resource_manager_get_p3(void);
@@ -582,6 +586,10 @@ testcase tc_array[] = {
        {"utc_application_app_control_set_uri_by_handle_p", utc_application_app_control_set_uri_by_handle_p, NULL, NULL},
        {"utc_application_app_control_set_uri_by_handle_n1", utc_application_app_control_set_uri_by_handle_n1, NULL, NULL},
        {"utc_application_app_control_set_uri_by_handle_n2", utc_application_app_control_set_uri_by_handle_n2, NULL, NULL},
+       {"utc_application_app_control_set_component_id_p1", utc_application_app_control_set_component_id_p1, NULL, NULL},
+       {"utc_application_app_control_set_component_id_n1", utc_application_app_control_set_component_id_n1, NULL, NULL},
+       {"utc_application_app_control_get_component_id_p1", utc_application_app_control_get_component_id_p1, NULL, NULL},
+       {"utc_application_app_control_get_component_id_n1", utc_application_app_control_get_component_id_n1, NULL, NULL},
        {"utc_application_app_control_uri_create_p", utc_application_app_control_uri_create_p, NULL, NULL},
        {"utc_application_app_control_uri_create_n1", utc_application_app_control_uri_create_n1, NULL, NULL},
        {"utc_application_app_control_uri_create_n2", utc_application_app_control_uri_create_n2, NULL, NULL},
index 7c0d0cf70242e0c813492e692f20a63d2035add2..197a1b7499eb40047a997d8537859dd41349571b 100755 (executable)
@@ -2978,7 +2978,7 @@ int utc_application_app_control_get_caller_n3(void)
  * @since_tizen                2.3
  * @type               Positive
  * @description                Sends the terminate request to the application that is launched
- *                     by app_control. This API is only effective for some applications that 
+ *                     by app_control. This API is only effective for some applications that
  *                     are provided by default for handling platform default app_controls.
  *                     You are not allowed to terminate other general applications using this API.
  * @scenario           Sends the launch request and send the terminate request.
@@ -3016,7 +3016,7 @@ int utc_application_app_control_send_terminate_request_p(void)
  * @since_tizen                2.3
  * @type               Negative
  * @description         Sends the terminate request to the application that is launched
- *                      by app_control. This API is only effective for some applications that 
+ *                      by app_control. This API is only effective for some applications that
  *                      are provided by default for handling platform default app_controls.
  *                      You are not allowed to terminate other general applications using this API.
  * @scenario           Calls the app_control_send_terminate_request() with the invalid parameter.
@@ -4334,3 +4334,91 @@ int utc_application_app_control_set_uri_by_handle_n2(void)
 
        return 0;
 }
+
+/**
+ * @testcase           utc_application_app_control_set_component_id_p1
+ * @since_tizen                5.5
+ * @type               Positive
+ * @description                Sets component ID to app-control.
+ * @scenario           Sets the component ID.
+ */
+int utc_application_app_control_set_component_id_p1(void)
+{
+       int ret = APP_CONTROL_ERROR_NONE;
+       app_control_h app_control;
+
+       ret = app_control_create(&app_control);
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+       ret = app_control_set_component_id(app_control, "comp_id");
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+       app_control_destroy(app_control);
+       normal_exit(0);
+       return 0;
+}
+
+/**
+ * @testcase            utc_application_app_control_set_component_id_n1
+ * @since_tizen         5.5
+ * @type                Negative
+ * @description         Sets component ID to app-control.
+ * @scenario            Sets component ID with NULL value.
+ */
+int utc_application_app_control_set_component_id_n1(void)
+{
+       int ret = APP_CONTROL_ERROR_NONE;
+
+       ret = app_control_set_component_id(NULL, "comp_id");
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
+       normal_exit(0);
+       return 0;
+}
+
+
+/**
+ * @testcase           utc_application_app_control_get_component_id_p1
+ * @since_tizen                5.5
+ * @type               Positive
+ * @description                Gets the component ID from app-control
+ * @scenario           Create app-control with a component ID.
+ *                      Sets component ID and gets component ID from it.
+ *                      Check returned value.
+ */
+int utc_application_app_control_get_component_id_p1(void)
+{
+       int ret = APP_CONTROL_ERROR_NONE;
+       app_control_h app_control;
+       char *comp_id;
+
+       ret = app_control_create(&app_control);
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+       ret = app_control_set_component_id(app_control, "comp_id");
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+       ret = app_control_get_component_id(app_control, &comp_id);
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+       assert_with_exit(!strcmp(comp_id, "comp_id"));
+
+       app_control_destroy(app_control);
+       normal_exit(0);
+       return 0;
+}
+
+/**
+ * @testcase            utc_application_app_control_get_component_id_n1
+ * @since_tizen         5.5
+ * @type                Negative
+ * @description         Gets component ID to app-control.
+ * @scenario            Gets component ID with NULL value.
+ */
+int utc_application_app_control_get_component_id_n1(void)
+{
+       int ret = APP_CONTROL_ERROR_NONE;
+
+       ret = app_control_get_component_id(NULL, NULL);
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
+       normal_exit(0);
+       return 0;
+}
\ No newline at end of file