/* Test */
__print_line();
__tcinfo(function, "privilege_package_info_is_privacy_requestable");
+
+ __tcinfo(goal, NEG_TC_PREFIX "uid 5001, api-version=3.0, pkgid=NULL");
+ ret = privilege_package_info_is_privacy_requestable(5001, NULL, "http://tizen.org/privilege/call", &is_requestable);
+ expect_result = (ret == PRVMGR_ERR_INVALID_PARAMETER);
+ __output_privilege_package_info_is_privacy_requestable(expect_result, is_requestable, ret);
+
+ __tcinfo(goal, NEG_TC_PREFIX "uid 5001, api-version=3.0, org.test.nativeapp_3, with no exist privilege");
+ ret = privilege_package_info_is_privacy_requestable(5001, "org.test.nativeapp_3", "http://tizen.org/privilege/ffffffsasas", &is_requestable);
+ expect_result = (ret == PRVMGR_ERR_NONE && !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=3.0, org.test.nativeapp_3 can request privacy for http://tizen.org/privilege/call");
ret = privilege_package_info_is_privacy_requestable(5001, "org.test.nativeapp_3", "http://tizen.org/privilege/call", &is_requestable);
expect_result = (ret == PRVMGR_ERR_NONE && !is_requestable);
__output_privilege_package_info_is_privacy_requestable(expect_result, is_requestable, ret);
__tcinfo(function, "privilege_package_info_get_privacy_list_by_pkgid");
- __tcinfo(goal, POS_TC_PREFIX "get privacy list of org.test.nativeapp_3");
+
+ __tcinfo(goal, NEG_TC_PREFIX "get privacy list of org.test.nativeapp_3 with pkgid=NULL");
GList* tmp_list = NULL;
+ ret = privilege_package_info_get_privacy_list_by_pkgid(5001, NULL, &tmp_list);
+ __tcinfo(expect, PRVMGR_ERR_INVALID_PARAMETER);
+ __print_result('m', ret);
+
+ __tcinfo(goal, NEG_TC_PREFIX "get privacy list of org.test.nativeapp_3 with invalid pkgid");
+ ret = privilege_package_info_get_privacy_list_by_pkgid(5001, "abcdef", &tmp_list);
+ __tcinfo(expect, PRVMGR_ERR_NONE);
+ __tcinfo(ret, __get_result_string('m', expected_result), __get_result_string('m', ret));
+ if(tmp_list == NULL && ret == expected_result) {
+ success_cnt++;
+ __color_to_green();
+ printf(">> test success\n");
+ } else {
+ fail_cnt++;
+ __color_to_bold_red();
+ printf(">> test fail\n");
+ }
+
+ __tcinfo(goal, POS_TC_PREFIX "get privacy list of org.test.nativeapp_3");
ret = privilege_package_info_get_privacy_list_by_pkgid(5001, "org.test.nativeapp_3", &tmp_list);
__tcinfo(expect, PRVMGR_ERR_NONE);
__print_result('m', ret);
__print_line();
__tcinfo(function, "privilege_package_info_get_package_list_by_privacy");
+
+ __tcinfo(goal, NEG_TC_PREFIX "get list of packages with null privacy");
+ ret = privilege_package_info_get_package_list_by_privacy(5001, NULL, &tmp_list);
+ __tcinfo(expect, PRVMGR_ERR_INVALID_PARAMETER);
+ __print_result('m', ret);
+ if (tmp_list != NULL) {
+ __print_glist(tmp_list);
+ gfree(tmp_list);
+ }
+
__tcinfo(goal, POS_TC_PREFIX "get list of packages with bookmark privacy");
ret = privilege_package_info_get_package_list_by_privacy(5001, "http://tizen.org/privacy/bookmark", &tmp_list);
__tcinfo(expect, PRVMGR_ERR_NONE);
__print_line();
__tcinfo(function, "privilege_package_info_get_privilege_list_by_pkgid_and_privacy");
+
+ __tcinfo(goal, NEG_TC_PREFIX "get privilege list of org.test.nativeapp_3's NULL privacy");
+ ret = privilege_package_info_get_privilege_list_by_pkgid_and_privacy(5001, "org.test.nativeapp_3", NULL, &tmp_list);
+ __tcinfo(expect, PRVMGR_ERR_INVALID_PARAMETER);
+ __print_result('m', ret);
+ if (tmp_list != NULL) {
+ __print_glist(tmp_list);
+ gfree(tmp_list);
+ }
+
+ __tcinfo(goal, NEG_TC_PREFIX "get privilege list of org.test.nativeapp_3's NULL pkgid");
+ ret = privilege_package_info_get_privilege_list_by_pkgid_and_privacy(5001, NULL, "http://tizen.org/privacy/account", &tmp_list);
+ __tcinfo(expect, PRVMGR_ERR_INVALID_PARAMETER);
+ __print_result('m', ret);
+ if (tmp_list != NULL) {
+ __print_glist(tmp_list);
+ gfree(tmp_list);
+ }
+
__tcinfo(goal, POS_TC_PREFIX "get privilege list of org.test.nativeapp_3's account privacy");
ret = privilege_package_info_get_privilege_list_by_pkgid_and_privacy(5001, "org.test.nativeapp_3", "http://tizen.org/privacy/account", &tmp_list);
__tcinfo(expect, PRVMGR_ERR_NONE);