int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(handle, "org.tizen.helloworld");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
- normal_exit(1);
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
-end:
app_control_destroy(handle);
return ret;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(handle, "org.example.reply");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle,
__app_control_result_cb_with_reply,
__app_control_reply_cb, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
- normal_exit(1);
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
-end:
app_control_destroy(handle);
return ret;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_mime(handle, "type/custom");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set MIME-Type");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(handle, "org.tizen.helloworld");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
- normal_exit(1);
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
-end:
app_control_destroy(handle);
return ret;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(handle, "org.example.appcontrolprivilegetest");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
- normal_exit(1);
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
-end:
app_control_destroy(handle);
return ret;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(NULL, NULL, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
ret = app_control_send_launch_request_async(handle, NULL, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
-
-end:
app_control_destroy(handle);
return 0;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
NULL, NULL);
- if (ret != APP_CONTROL_ERROR_APP_NOT_FOUND) {
- dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
- normal_exit(1);
- }
- normal_exit(0);
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_APP_NOT_FOUND);
-end:
+ normal_exit(0);
app_control_destroy(handle);
return 0;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(handle, "org.tizen.hellohelloworld");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle,
__app_control_result_cb_n3,
NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
- normal_exit(1);
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
-end:
app_control_destroy(handle);
return 0;
int ret;
ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_operation(handle,
APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_set_app_id(handle, "org.example.appcontrolprivilegetest2");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_async(handle,
__app_control_result_cb_n4,
NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
- normal_exit(1);
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
-end:
app_control_destroy(handle);
return 0;
NULL, NULL, NULL, NULL,
"org.tizen.test", APP_CONTROL_LAUNCH_MODE_SINGLE, 2,
"key1", "value1", "key2", "value2");
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG,
- "Failed to create appcontrol handle. error: %d",
- ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_get_app_id(handle, &app_id);
if (ret != APP_CONTROL_ERROR_NONE) {
NULL, NULL, NULL, NULL,
NULL, APP_CONTROL_LAUNCH_MODE_SINGLE, 1,
"key", "value");
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
NULL, NULL, NULL,
"org.example.reply", APP_CONTROL_LAUNCH_MODE_SINGLE,
0);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_sync(handle, &reply, &result);
- if (ret != APP_CONTROL_ERROR_NONE || result != APP_CONTROL_RESULT_SUCCEEDED) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+ assert_eq_with_exit(result, APP_CONTROL_RESULT_SUCCEEDED);
normal_exit(0);
-end:
+
if (reply)
app_control_destroy(reply);
if (handle)
int ret;
ret = app_control_send_launch_request_sync(NULL, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
NULL, NULL, NULL,
"org.tizen.helloworld", APP_CONTROL_LAUNCH_MODE_SINGLE,
0);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
- normal_exit(1);
- goto end;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
ret = app_control_send_launch_request_sync(handle, &reply, &result);
- if (ret == APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- goto end;
- }
+ assert_neq_with_exit(ret, APP_CONTROL_ERROR_NONE);
normal_exit(0);
-end:
+
if (reply)
app_control_destroy(reply);
if (handle)
ret = app_control_add_action_handler("action", __action_cb, NULL,
&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Failed to add action handler");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
app_control_remove_action_handler(handle);
normal_exit(0);
ret = app_control_add_action_handler(NULL, __action_cb, NULL,
&handle);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
int ret;
ret = app_control_add_action_handler("action", NULL, NULL, &handle);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
int ret;
ret = app_control_add_action_handler("action", __action_cb, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
ret = app_control_add_action_handler("NotFound", __action_cb, NULL,
&handle);
- if (ret != APP_CONTROL_ERROR_KEY_NOT_FOUND) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_KEY_NOT_FOUND);
normal_exit(0);
app_control_add_action_handler("action", __action_cb, NULL, &handle);
ret = app_control_remove_action_handler(handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG,
- "Failed to remove action handler");
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
normal_exit(0);
int ret;
ret = app_control_remove_action_handler(NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
app_control_uri_builder_build(builder, &uri);
ret = app_control_create_from_uri_handle(&app_control, uri);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- app_control_uri_builder_destroy(builder);
- app_control_uri_destroy(uri);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
app_control_uri_builder_destroy(builder);
app_control_uri_destroy(uri);
app_control_uri_builder_build(builder, &uri);
ret = app_control_create_from_uri_handle(NULL, uri);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- app_control_uri_builder_destroy(builder);
- app_control_uri_destroy(uri);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
app_control_uri_builder_destroy(builder);
app_control_uri_destroy(uri);
int utc_application_app_control_create_from_uri_handle_n2(void)
{
int ret;
-
app_control_h app_control;
ret = app_control_create_from_uri_handle(&app_control, NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
normal_exit(0);
app_control_create(&app_control);
ret = app_control_set_uri_by_handle(app_control, uri);
- if (ret != APP_CONTROL_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- app_control_uri_builder_destroy(builder);
- app_control_uri_destroy(uri);
- app_control_destroy(app_control);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
app_control_uri_builder_destroy(builder);
app_control_uri_destroy(uri);
app_control_uri_builder_build(builder, &uri);
ret = app_control_set_uri_by_handle(NULL, uri);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- app_control_uri_builder_destroy(builder);
- app_control_uri_destroy(uri);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
app_control_uri_builder_destroy(builder);
app_control_uri_destroy(uri);
app_control_create(&app_control);
ret = app_control_set_uri_by_handle(app_control, NULL);
- if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
- app_control_destroy(app_control);
- dlog_print(DLOG_ERROR, LOG_TAG, "Error: %d", ret);
- normal_exit(1);
- return -1;
- }
+ assert_eq_with_exit(ret, APP_CONTROL_ERROR_INVALID_PARAMETER);
app_control_destroy(app_control);
normal_exit(0);