printf_red("test fail\n");
fail_cnt++;
return;
- }else if(strcmp(description, expected_description) == 0){
+ } else if((description != NULL && expected_description != NULL) && strcmp(description, expected_description) == 0){
printf("matched\n");
printf_green("test success\n");
success_cnt++;
expected_description = "IDS_TPLATFORM_BODY_THIS_APPLICATION_CAN_READ_ACCOUNTS";
ret = privilege_info_get_privilege_description("http://tizen.org/privilege/account.read", &description);
__check_get_privilege_description_result(PRVMGR_ERR_NONE, ret, description, expected_description);
- SafeFree(description);
+ free(description);
+ description = NULL;
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description with wrong parameter");
expected_description = NULL;
ret = privilege_info_get_privilege_description("http://tizen.org/privilege/badge.admin", &description);
__check_get_privilege_description_result(PRVMGR_ERR_NONE, ret, description, expected_description);
- SafeFree(description);
+ free(description);
+ description = NULL;
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description with invalid parameter");
expected_description = NULL;
ret = privilege_info_get_privilege_description("http://tizen.org/privilege/accousdfsdnt.resdfsdfad", &description);
__check_get_privilege_description_result(PRVMGR_ERR_NONE, ret, description, expected_description);
- SafeFree(description);
+ free(description);
+ description = NULL;
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description with null parameter");
ret = privilege_info_get_privilege_description(NULL, &description);
__check_get_privilege_description_result(PRVMGR_ERR_INVALID_PARAMETER, ret, description, expected_description);
- SafeFree(description);
- SafeFree(expected_description);
+ free(description);
+ free(expected_description);
__print_line();
}
PRVMGR_PACKAGE_TYPE_CORE,
&description);
__check_get_privilege_description_result(PRVMGR_ERR_NONE, ret, description, expected_description);
- SafeFree(description);
+ free(description);
+ description = NULL;
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type with invalid privilege");
PRVMGR_PACKAGE_TYPE_CORE,
&description);
__check_get_privilege_description_result(PRVMGR_ERR_NO_EXIST_PRIVILEGE, ret, description, expected_description);
- SafeFree(description);
+ free(description);
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type with null privilege");
PRVMGR_PACKAGE_TYPE_CORE,
&description);
__check_get_privilege_description_result(PRVMGR_ERR_INVALID_PARAMETER, ret, description, expected_description);
- SafeFree(description);
+ free(description);
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type with PRVMGR_PACKAGE_TYPE_NONE");
PRVMGR_PACKAGE_TYPE_NONE,
&description);
__check_get_privilege_description_result(PRVMGR_ERR_INVALID_PARAMETER, ret, description, expected_description);
- SafeFree(description);
+ free(description);
__print_line();
}
PRVMGR_PACKAGE_TYPE_CORE,
&display_name);
__check_get_privilege_display_name_result(PRVMGR_ERR_NONE, ret, display_name, expected_display_name);
- SafeFree(display_name);
+ free(display_name);
+ display_name = NULL;
expected_display_name = NULL;
__print_line();
PRVMGR_PACKAGE_TYPE_CORE,
&display_name);
__check_get_privilege_display_name_result(PRVMGR_ERR_NO_EXIST_PRIVILEGE, ret, display_name, expected_display_name);
- SafeFree(display_name);
+ free(display_name);
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_display_name_by_package_type with null privilege");
printf("privilege : NULL\n");
ret = privilege_info_get_privilege_display_name_by_package_type(NULL, "2.3", PRVMGR_PACKAGE_TYPE_CORE, &display_name);
__check_get_privilege_display_name_result(PRVMGR_ERR_INVALID_PARAMETER, ret, display_name, expected_display_name);
- SafeFree(display_name);
+ free(display_name);
__print_line();
__tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_display_name_by_package_type with PRVMGR_PACKAGE_TYPE_NONE");
printf("privilege : NULL\n");
ret = privilege_info_get_privilege_display_name_by_package_type(NULL, "2.3", PRVMGR_PACKAGE_TYPE_NONE, &display_name);
__check_get_privilege_display_name_result(PRVMGR_ERR_INVALID_PARAMETER, ret, display_name, expected_display_name);
- SafeFree(display_name);
+ free(display_name);
__print_line();
}
bool is_requestable;
bool expect_result;
- printf("ENABLE ASKUSER: %s\n", ENABLE_ASKUSER ? "True" : "False");
+ printf("ENABLE ASKUSER: %s\n", (bool) ENABLE_ASKUSER ? "True" : "False");
__set_privacy_test_pkg_info();
/* Native api-version 3.0 */
__tcinfo(goal, POS_TC_PREFIX "see if uid 5001, api-version=4.0, org.test.webapp_4 can request privacy for http://tizen.org/privilege/call");
ret = privilege_package_info_is_privacy_requestable(5001, "org.test.webapp_4", "http://tizen.org/privilege/call", &is_requestable);
- expect_result = (ret == PRVMGR_ERR_NONE && ENABLE_ASKUSER == is_requestable);
+ expect_result = (ret == PRVMGR_ERR_NONE && (bool) ENABLE_ASKUSER == is_requestable);
__output_privilege_package_info_is_privacy_requestable(expect_result, is_requestable, ret);
__tcinfo(goal, POS_TC_PREFIX "see if uid 5001, api-version=4.0, org.test.webapp_4 can request privacy for http://tizen.org/privilege/mediastorage");
__tcinfo(goal, POS_TC_PREFIX "see if uid 5001, api-version=5.0, org.test.webapp_5 can request privacy for http://tizen.org/privilege/mediastorage");
ret = privilege_package_info_is_privacy_requestable(5001, "org.test.webapp_5", "http://tizen.org/privilege/mediastorage", &is_requestable);
- expect_result = (ret == PRVMGR_ERR_NONE && ENABLE_ASKUSER == is_requestable);
+ expect_result = (ret == PRVMGR_ERR_NONE && (bool) ENABLE_ASKUSER == is_requestable);
__output_privilege_package_info_is_privacy_requestable(expect_result, is_requestable, ret);
__tcinfo(goal, POS_TC_PREFIX "[Handle api_version >= 10] see if uid 5001, api-version=10.0, org.test.nativeapp_10 can request privacy for http://tizen.org/privilege/mediastorage");
ret = privilege_package_info_is_privacy_requestable(5001, "org.test.nativeapp_10", "http://tizen.org/privilege/mediastorage", &is_requestable);
- expect_result = (ret == PRVMGR_ERR_NONE && ENABLE_ASKUSER == is_requestable);
+ expect_result = (ret == PRVMGR_ERR_NONE && (bool) ENABLE_ASKUSER == is_requestable);
__output_privilege_package_info_is_privacy_requestable(expect_result, is_requestable, ret);
__tcinfo(goal, POS_TC_PREFIX "[Handle api_version >= 10] see if uid 5001, api-version=10.0, org.test.nativeapp_10 can request privacy for http://tizen.org/privilege/internet");