[UTC][component-manager][Non-ACR] Adds calling assert_eq() 17/312517/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 11 Jun 2024 05:06:53 +0000 (14:06 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 11 Jun 2024 05:06:53 +0000 (14:06 +0900)
This patch is for TCA coverage issues.

Change-Id: I3dbf39acefba49f8abaa8394205b837001fe5485
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
26 files changed:
src/utc/component-manager/utc_component_context_clone.c
src/utc/component-manager/utc_component_context_destroy.c
src/utc/component-manager/utc_component_context_get_app_id.c
src/utc/component-manager/utc_component_context_get_component_id.c
src/utc/component-manager/utc_component_context_get_component_state.c
src/utc/component-manager/utc_component_context_get_instance_id.c
src/utc/component-manager/utc_component_context_is_subcomponent.c
src/utc/component-manager/utc_component_context_is_terminated.c
src/utc/component-manager/utc_component_info_clone.c
src/utc/component-manager/utc_component_info_create.c
src/utc/component-manager/utc_component_info_destroy.c
src/utc/component-manager/utc_component_info_get_app_id.c
src/utc/component-manager/utc_component_info_get_component_id.c
src/utc/component-manager/utc_component_info_get_component_type.c
src/utc/component-manager/utc_component_info_get_icon.c
src/utc/component-manager/utc_component_info_get_label.c
src/utc/component-manager/utc_component_info_get_localized_label.c
src/utc/component-manager/utc_component_info_is_icon_display.c
src/utc/component-manager/utc_component_info_is_managed_by_task_manager.c
src/utc/component-manager/utc_component_manager_foreach_component_context.c
src/utc/component-manager/utc_component_manager_foreach_component_info.c
src/utc/component-manager/utc_component_manager_get_component_context.c
src/utc/component-manager/utc_component_manager_get_component_info.c
src/utc/component-manager/utc_component_manager_is_running.c
src/utc/component-manager/utc_component_manager_resume_component.c
src/utc/component-manager/utc_component_manager_terminate_bg_component.c

index a171f51cff98417c40579e3e30acf9e648e0a937..bbdd77ab6b818e3bc2fc997f93fd6fb7f110dec7 100644 (file)
@@ -75,10 +75,7 @@ int utc_component_context_clone_p(void)
        int ret;
 
        ret = component_context_clone(&context, __component_context);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to clone component context. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        component_context_destroy(context);
 
@@ -97,10 +94,7 @@ int utc_component_context_clone_n(void)
        int ret;
 
        ret = component_context_clone(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 6f68d4c85d7608b4bc4f257f30bda0fc07fbebbf..d58e92559eb702d8830ad5af6d1f9063296c17ec 100644 (file)
@@ -69,10 +69,7 @@ int utc_component_context_destroy_p(void)
        int ret;
 
        ret = component_context_destroy(__component_context);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to destroy component context. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        return 0;
 }
@@ -89,10 +86,7 @@ int utc_component_context_destroy_n(void)
        int ret;
 
        ret = component_context_destroy(NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index d51bd33455ef25a43047ecb090fbe5a57a4e8484..a3f777498b5de79b6079f97eb612ec1a24979173 100644 (file)
@@ -76,16 +76,8 @@ int utc_component_context_get_app_id_p(void)
        int ret;
 
        ret = component_context_get_app_id(__component_context, &app_id);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get application ID. error(%d)", ret);
-               return ret;
-       }
-
-       if (strcmp(app_id, "org.example.componentbased") != 0) {
-               _E("app_id(%s) should be `org.example.componentbased`", app_id);
-               free(app_id);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(strcmp(app_id, "org.example.componentbased"), 0);
        free(app_id);
 
        return 0;
@@ -103,10 +95,7 @@ int utc_component_context_get_app_id_n(void)
        int ret;
 
        ret = component_context_get_app_id(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index ffcaa60e0d06e8e7e1f335a02060baddf1cffa23..e6ca384f148e82864fa44c471bee6f854eee7184 100644 (file)
@@ -77,17 +77,8 @@ int utc_component_context_get_component_id_p(void)
 
        ret = component_context_get_component_id(__component_context,
                        &component_id);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get component ID. error(%d)", ret);
-               return ret;
-       }
-
-       if (strcmp(component_id, "org.example.frame-component") != 0) {
-               _E("component_id(%s) should be `org.example.frame-component`",
-                               component_id);
-               free(component_id);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(strcmp(component_id, "org.example.frame-component"), 0);
 
        free(component_id);
 
@@ -106,10 +97,7 @@ int utc_component_context_get_component_id_n(void)
        int ret;
 
        ret = component_context_get_component_id(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 9f01b9d67584c8a46d7594a08fe5330395926d6a..43ebd31af4646c04165a9101224df810bba301ea 100644 (file)
@@ -77,16 +77,8 @@ int utc_component_context_get_component_state_p(void)
 
        ret = component_context_get_component_state(__component_context,
                        &state);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get component state. error(%d)", ret);
-               return ret;
-       }
-
-       if (state == COMPONENT_STATE_INITIALIZED) {
-               _E("state(%d) should not be `COMPONENT_STATE_INITIALIZED`",
-                               state);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_neq(state, COMPONENT_STATE_INITIALIZED);
 
        return 0;
 }
@@ -103,10 +95,7 @@ int utc_component_context_get_component_state_n(void)
        int ret;
 
        ret = component_context_get_component_state(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 5499a8fbc33f9d8933f5a84b3690ba07f8d51cca..573e976297b597438b98b5471f434d95135b0d65 100644 (file)
@@ -76,10 +76,7 @@ int utc_component_context_get_instance_id_p(void)
 
        ret = component_context_get_instance_id(__component_context,
                        &instance_id);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get instance ID. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        free(instance_id);
 
@@ -98,10 +95,7 @@ int utc_component_context_get_instance_id_n(void)
        int ret;
 
        ret = component_context_get_instance_id(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index a1a92b787891b4f24c5ada022a609b516a50f095..ed346de33053ae4eee769991c34cf71c6dedb4fe 100644 (file)
@@ -77,15 +77,8 @@ int utc_component_context_is_subcomponent_p(void)
 
        ret = component_context_is_subcomponent(__component_context,
                        &is_subcomponent);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get component running state. error(%d)", ret);
-               return ret;
-       }
-
-       if (is_subcomponent) {
-               _E("is_subcomponent(%d) should be `false`", is_subcomponent);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_neq(is_subcomponent, true);
 
        return 0;
 }
@@ -102,10 +95,7 @@ int utc_component_context_is_subcomponent_n(void)
        int ret;
 
        ret = component_context_is_subcomponent(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index b2bfafa7c699db6d5bfe9e07a86f4037f3dd9338..cd17534b1ba787810a4158a3a3a4dc09ccea3df5 100644 (file)
@@ -138,15 +138,8 @@ int utc_component_context_is_terminated_p(void)
        int ret;
 
        ret = component_context_is_terminated(__component_context, &terminated);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get component running state. error(%d)", ret);
-               return ret;
-       }
-
-       if (!terminated) {
-               _E("terminated(%d) should be `true`", terminated);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(terminated, true);
 
        return 0;
 }
@@ -163,10 +156,7 @@ int utc_component_context_is_terminated_n(void)
        int ret;
 
        ret = component_context_is_terminated(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 7b28dc2feaab0a923ff4335c283311ab98c31c96..0eebb4a92c35f6101f36b815670496ba1049eb95 100644 (file)
@@ -51,10 +51,7 @@ int utc_component_info_clone_p(void)
        int ret;
 
        ret = component_info_clone(&info, __component_info);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to clone component info. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        component_info_destroy(info);
 
@@ -73,10 +70,7 @@ int utc_component_info_clone_n(void)
        int ret;
 
        ret = component_info_clone(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 6cebd1c3e03c043347c8a6cb982fe71f69aef99b..c1f6f6a4fef23d9d9c7dcd6af76200273fb874d8 100644 (file)
@@ -44,10 +44,7 @@ int utc_component_info_create_p(void)
 
        ret = component_info_create("org.example.frame-component",
                        &__component_info);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to create component info. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        return 0;
 }
@@ -64,10 +61,7 @@ int utc_component_info_create_n(void)
        int ret;
 
        ret = component_info_create(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index d1baf37c4a1b439da81747bc87415285807f71d7..14d8bf4746867ea682f6d154dcb6b71c225412e4 100644 (file)
@@ -45,10 +45,7 @@ int utc_component_info_destroy_p(void)
        int ret;
 
        ret = component_info_destroy(__component_info);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to destroy component info. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        return 0;
 }
@@ -65,10 +62,7 @@ int utc_component_info_destroy_n(void)
        int ret;
 
        ret = component_info_destroy(NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index af8eaf3532500da363d88f9693dfa23dcd865345..0772502d50d7869ea2ee43e702ba88ff3b8e839d 100644 (file)
@@ -53,16 +53,8 @@ int utc_component_info_get_app_id_p(void)
        int ret;
 
        ret = component_info_get_app_id(__component_info, &app_id);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get application ID. error(%d)", ret);
-               return ret;
-       }
-
-       if (strcmp(app_id, "org.example.componentbased") != 0) {
-               _E("app_id(%s) is not `org.example.component-based`", app_id);
-               free(app_id);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(strcmp(app_id, "org.example.componentbased"), 0);
 
        free(app_id);
 
@@ -81,10 +73,7 @@ int utc_component_info_get_app_id_n(void)
        int ret;
 
        ret = component_info_get_app_id(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 974c6e964a240ee08eb2c5de6ff45a1548ed2098..b27fa4907c98414464b48f48cf62953bce1b52a8 100644 (file)
@@ -53,17 +53,8 @@ int utc_component_info_get_component_id_p(void)
        int ret;
 
        ret = component_info_get_component_id(__component_info, &component_id);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get component ID. error(%d)", ret);
-               return ret;
-       }
-
-       if (strcmp(component_id, "org.example.frame-component") != 0) {
-               _E("component_id(%s) is not `org.example.frame-component`",
-                               component_id);
-               free(component_id);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(strcmp(component_id, "org.example.frame-component"), 0);
 
        free(component_id);
 
@@ -82,10 +73,7 @@ int utc_component_info_get_component_id_n(void)
        int ret;
 
        ret = component_info_get_component_id(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 854c461bd9be0df61bebd6d44c954fae975f531f..7e6e140c7294194d364583e43c4389a7cef7325a 100644 (file)
@@ -52,16 +52,8 @@ int utc_component_info_get_component_type_p(void)
        int ret;
 
        ret = component_info_get_component_type(__component_info, &type);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get component type. error(%d)", ret);
-               return ret;
-       }
-
-       if (type != COMPONENT_INFO_COMPONENT_TYPE_FRAME) {
-               _E("type(%d) is not `COMPONENT_INFO_COMPONENT_TYPE_FRAME`",
-                               type);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(type, COMPONENT_INFO_COMPONENT_TYPE_FRAME);
 
        return 0;
 }
@@ -78,10 +70,7 @@ int utc_component_info_get_component_type_n(void)
        int ret;
 
        ret = component_info_get_component_type(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index a9d76ad3abebf2b0d4e0904b2ee9d34a3ac589c1..398eb5c0b6d471fdd5433a5c1c26c9cd4c7a63cc 100644 (file)
@@ -51,10 +51,8 @@ int utc_component_info_get_icon_p(void)
        int ret;
 
        ret = component_info_get_icon(__component_info, &icon);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get icon. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_neq(icon, NULL);
 
        free(icon);
 
@@ -73,10 +71,7 @@ int utc_component_info_get_icon_n(void)
        int ret;
 
        ret = component_info_get_icon(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index fc4951e06e6c4a09d57a10b21c612d68e0823f16..353cb0feb0c749df10853e647e567f846e24dfc8 100644 (file)
@@ -51,10 +51,8 @@ int utc_component_info_get_label_p(void)
        int ret;
 
        ret = component_info_get_label(__component_info, &label);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to check taskmanage. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_neq(label, NULL);
 
        free(label);
 
@@ -73,10 +71,7 @@ int utc_component_info_get_label_n(void)
        int ret;
 
        ret = component_info_get_label(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 52f7e47e62351f68ea29565f0118b07fb9319177..9a39669be10a485f6e26537679d46503e4c06717 100644 (file)
@@ -52,10 +52,8 @@ int utc_component_info_get_localized_label_p(void)
 
        ret = component_info_get_localized_label(__component_info, "ko-kr",
                        &label);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to check taskmanage. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_neq(label, NULL);
 
        free(label);
 
@@ -74,10 +72,7 @@ int utc_component_info_get_localized_label_n(void)
        int ret;
 
        ret = component_info_get_localized_label(NULL, NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 75cc44f4856c0d8ef5c92d91885d067bd03f5bd5..2fd64adaf2a5bad147088247b29ffed1afdde6b0 100644 (file)
@@ -52,15 +52,8 @@ int utc_component_info_is_icon_display_p(void)
        int ret;
 
        ret = component_info_is_icon_display(__component_info, &icon_display);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to check icon display. error(%d)", ret);
-               return ret;
-       }
-
-       if (!icon_display) {
-               _E("icon_display(%d) is not `true`", icon_display);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(icon_display, true);
 
        return 0;
 }
@@ -77,10 +70,7 @@ int utc_component_info_is_icon_display_n(void)
        int ret;
 
        ret = component_info_is_icon_display(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 251e9287949cd6f3d208330c6111dcb0bc70808f..494c7dd774d4a4ea8b885bb22a7ffa1ee8685972 100644 (file)
@@ -53,15 +53,8 @@ int utc_component_info_is_managed_by_task_manager_p(void)
 
        ret = component_info_is_managed_by_task_manager(__component_info,
                        &managed);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to check taskmanage. error(%d)", ret);
-               return ret;
-       }
-
-       if (!managed) {
-               _E("managed(%d) is not `true`", managed);
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(managed, true);
 
        return 0;
 }
@@ -78,10 +71,7 @@ int utc_component_info_is_managed_by_task_manager_n(void)
        int ret;
 
        ret = component_info_is_managed_by_task_manager(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 2476e04d6d632b4f711de797afec70de7fe46b67..3b6d99941594cc4ad041fb6f93510b08afdba45b 100644 (file)
@@ -91,16 +91,8 @@ int utc_component_manager_foreach_component_context_p(void)
 
        ret = component_manager_foreach_component_context(
                        __component_context_cb, (void *)&matched);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to retrieve running component contexts. error(%d)",
-                               ret);
-               return ret;
-       }
-
-       if (!matched) {
-               _E("`org.example.frame-component` is not running");
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(matched, true);
 
        return 0;
 }
@@ -117,10 +109,7 @@ int utc_component_manager_foreach_component_context_n(void)
        int ret;
 
        ret = component_manager_foreach_component_context(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index dba29dd7bb1f3fb6478defe6405bd69dd7955fba..f90c509a81192d2d735c275fdbceddd26bd36121 100644 (file)
@@ -65,16 +65,8 @@ int utc_component_manager_foreach_component_info_p(void)
 
        ret = component_manager_foreach_component_info(__component_info_cb,
                        (void *)&matched);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to retrieve installed component info. error(%d)",
-                               ret);
-               return ret;
-       }
-
-       if (!matched) {
-               _E("`org.example.frame-component` is not installed");
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(matched, true);
 
        return 0;
 }
@@ -91,10 +83,7 @@ int utc_component_manager_foreach_component_info_n(void)
        int ret;
 
        ret = component_manager_foreach_component_info(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index d5eb8e4a0502efac3cac9097e0422f2fab88773a..6700c76c9ec09e2e5d76a01bb91a600f3873026d 100644 (file)
@@ -64,10 +64,7 @@ int utc_component_manager_get_component_context_p(void)
 
        ret = component_manager_get_component_context(
                        "org.example.frame-component", &context);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get running component context. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        component_context_destroy(context);
 
@@ -86,10 +83,7 @@ int utc_component_manager_get_component_context_n(void)
        int ret;
 
        ret = component_manager_get_component_context(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index ca1ce7fd35d586df3bee32460bd2c5630d98ad0a..8c6207e25b04d996ddd44d16ac00b35668cf6264 100644 (file)
@@ -38,10 +38,7 @@ int utc_component_manager_get_component_info_p(void)
 
        ret = component_manager_get_component_info(
                        "org.example.frame-component", &info);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to get installed component info. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        component_info_destroy(info);
 
@@ -60,10 +57,7 @@ int utc_component_manager_get_component_info_n(void)
        int ret;
 
        ret = component_manager_get_component_info(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 9b521a09c8174cd458ab4c15af9029d516981fac..bbd8e90b35d8e3fd4ef26eea9cc349127cd5b850 100644 (file)
@@ -65,15 +65,8 @@ int utc_component_manager_is_running_p(void)
 
        ret = component_manager_is_running("org.example.frame-component",
                        &running);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to check running state. error(%d)", ret);
-               return ret;
-       }
-
-       if (!running) {
-               _E("`org.example.frame-component` is not running");
-               return -1;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
+       assert_eq(running, true);
 
        return 0;
 }
@@ -90,10 +83,7 @@ int utc_component_manager_is_running_n(void)
        int ret;
 
        ret = component_manager_is_running(NULL, NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 0199730f38d44ee3ec7343a21b2ce7564ca15d33..0c94dedf53acf5fc96d5fd6870c8ac5e2e33ae92 100644 (file)
@@ -78,10 +78,7 @@ int utc_component_manager_resume_component_p(void)
        int ret;
 
        ret = component_manager_resume_component(__component_context);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to send resume request. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        return 0;
 }
@@ -98,10 +95,7 @@ int utc_component_manager_resume_component_n(void)
        int ret;
 
        ret = component_manager_resume_component(NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }
index 53c7ef0a9b681d2a3942624d47d1ac03edce9ce1..fe6a46d8e5bad5dfe039a34f051fc9fcc3173840 100644 (file)
@@ -77,10 +77,7 @@ int utc_component_manager_terminate_bg_component_p(void)
        int ret;
 
        ret = component_manager_terminate_bg_component(__component_context);
-       if (ret != COMPONENT_MANAGER_ERROR_NONE) {
-               _E("Failed to send resume request. error(%d)", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_NONE);
 
        return 0;
 }
@@ -97,10 +94,7 @@ int utc_component_manager_terminate_bg_component_n(void)
        int ret;
 
        ret = component_manager_terminate_bg_component(NULL);
-       if (ret != COMPONENT_MANAGER_ERROR_INVALID_PARAMETER) {
-               _E("The return value(%d) is not invalid parameter", ret);
-               return ret;
-       }
+       assert_eq(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
 
        return 0;
 }