This patch is for TCA coverage issues.
Change-Id: I3dbf39acefba49f8abaa8394205b837001fe5485
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
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);
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;
}
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;
}
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;
}
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;
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;
}
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);
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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);
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;
}
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;
}
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}