Increasing negative test cases for privilege_info.c 51/318651/3
authorLe <xuan.tien@samsung.com>
Fri, 4 Oct 2024 09:37:33 +0000 (16:37 +0700)
committerDariusz Michaluk <d.michaluk@samsung.com>
Fri, 11 Oct 2024 14:04:14 +0000 (14:04 +0000)
Change-Id: I5e946671f1caa970d4176a5f9b88e728e377fa3d
Signed-off-by: Le <xuan.tien@samsung.com>
test/tc-privilege-info.c

index f27b7bf40a6e0bf2a067993b9e5d02aa093d472a..740465bcd668326e51d660c3c5db207ec350789a 100644 (file)
@@ -178,6 +178,8 @@ void __test_privilege_privacy_attr()
 void __test_privilege_info_is_valid()
 {
        int ret;
+
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_is_valid expect true");
        printf("privilege : http://tizen.org/privilege/account.read\n");
        ret = privilege_info_is_valid("http://tizen.org/privilege/account.read");
        if (ret == 1) {
@@ -189,22 +191,23 @@ void __test_privilege_info_is_valid()
        }
        __print_line();
 
-       printf("privilege : http://tizen.org/privilege/internal/default/public\n");
-       ret = privilege_info_is_valid("http://tizen.org/privilege/internal/default/public");
-       if (ret == 1) {
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_is_valid expect false");
+       printf("privilege : http://tizen.org/privilege/internettttttt\n");
+       ret = privilege_info_is_valid("http://tizen.org/privilege/internettttttt");
+       if (ret == 0) {
                success_cnt++;
-               printf_green("SUCCESS: http://tizen.org/privilege/internal/default/public is valid\n");
+               printf_green("SUCCESS: http://tizen.org/privilege/internettttttt is invalid\n");
        } else {
                fail_cnt++;
-               printf_red("Test FAILED. ret =  %d\n", ret);
+               printf_red("Test FAILED. ret = %d\n", ret);
        }
-       __print_line();
 
-       printf("privilege : http://tizen.org/privilege/internettttttt\n");
-       ret = privilege_info_is_valid("http://tizen.org/privilege/internettttttt");
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_is_valid when privilege is empty");
+       printf("privilege : <empty>\n");
+       ret = privilege_info_is_valid("");
        if (ret == 0) {
                success_cnt++;
-               printf_green("SUCCESS: http://tizen.org/privilege/internettttttt is invalid\n");
+               printf_green("SUCCESS: empty privilege is invalid\n");
        } else {
                fail_cnt++;
                printf_red("Test FAILED. ret = %d\n", ret);
@@ -216,6 +219,8 @@ void __test_privilege_info_is_valid()
 void __test_privilege_info_is_internal()
 {
        int ret;
+
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_is_internal expect true");
        printf("privilege : http://tizen.org/privilege/internal/default/public\n");
        ret = privilege_info_is_internal("http://tizen.org/privilege/internal/default/public");
        if (ret == 1) {
@@ -227,6 +232,7 @@ void __test_privilege_info_is_internal()
        }
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_is_internal with privilege is not internal");
        printf("privilege : http://tizen.org/privilege/internet\n");
        ret = privilege_info_is_internal("http://tizen.org/privilege/internet");
        if (ret == 0) {
@@ -237,6 +243,8 @@ void __test_privilege_info_is_internal()
                printf_red("Test FAILED. ret = %d\n", ret);
        }
        __print_line();
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_is_internal with invalid privilege");
        printf("privilege : http://tizen.org/privilege/internettttt\n");
        ret = privilege_info_is_internal("http://tizen.org/privilege/internettttt");
        if (ret == 0) {
@@ -252,6 +260,8 @@ void __test_privilege_info_is_internal()
 void __test_privilege_info_is_privacy()
 {
        int ret;
+
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_is_privacy expect true");
        printf("privilege : http://tizen.org/privilege/account.read\n");
        ret = privilege_info_is_privacy("http://tizen.org/privilege/account.read");
        if ((DISABLE_ASKUSER && ret == 0) || (ENABLE_ASKUSER && ret == 1)) {
@@ -267,6 +277,7 @@ void __test_privilege_info_is_privacy()
        }
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_is_privacy with privilege is not privilege");
        printf("privilege : http://tizen.org/privilege/internet\n");
        ret = privilege_info_is_privacy("http://tizen.org/privilege/internet");
        if (ret == 0) {
@@ -278,18 +289,7 @@ void __test_privilege_info_is_privacy()
        }
        __print_line();
 
-       /* Do not treat internal privileges as privacy related
-       printf("privilege : http://tizen.org/privilege/internal/buxton/account.read\n");
-       ret = privilege_info_is_privacy("http://tizen.org/privilege/internal/buxton/account.read");
-       if (ret == 1) {
-               success_cnt++;
-               printf("SUCCESS: http://tizen.org/privilege/internal/buxton/account.read is PRIVACY\n");
-       } else {
-               fail_cnt++;
-               printf("Test FAILED. ret = %d\n", ret);
-       }
-       __print_line();*/
-
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_is_privacy with invalid privilege");
        printf("privilege : http://tizen.org/privilege/internettttt\n");
        ret = privilege_info_is_privacy("http://tizen.org/privilege/internettttt");
        if (ret == 0) {
@@ -307,6 +307,7 @@ void __test_privilege_info_get_privacy_display()
        char* privacy_display = NULL;
        int ret;
 
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privacy_display expect true");
        printf("VALID privacy: http://tizen.org/privacy/account\n");
        ret = privilege_info_get_privacy_display("http://tizen.org/privacy/account", &privacy_display);
        if (ret == PRVMGR_ERR_NONE && privacy_display != NULL) {
@@ -316,10 +317,10 @@ void __test_privilege_info_get_privacy_display()
                fail_cnt++;
                printf_red("FAIL: ret = %d, privacy_display = %s\n", ret, privacy_display);
        }
-
        free(privacy_display);
        privacy_display = NULL;
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privacy_display with wrong privacy");
        printf("WRONG privacy: http://tizen.org/privilege/account.read\n");
        ret = privilege_info_get_privacy_display("http://tizen.org/privilege/account.read", &privacy_display);
        if (ret == PRVMGR_ERR_INVALID_PARAMETER && privacy_display == NULL) {
@@ -329,10 +330,10 @@ void __test_privilege_info_get_privacy_display()
                fail_cnt++;
                printf_red("FAIL: ret = %d, privacy_display = %s\n", ret, privacy_display);
        }
-
        free(privacy_display);
        privacy_display = NULL;
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privacy_display with NULL parameter");
        printf("NULL param\n");
        ret = privilege_info_get_privacy_display(NULL, &privacy_display);
        if (ret == PRVMGR_ERR_INVALID_PARAMETER && privacy_display == NULL) {
@@ -342,7 +343,6 @@ void __test_privilege_info_get_privacy_display()
                fail_cnt++;
                printf_red("FAIL: ret = %d, privacy_display = %s\n", ret, privacy_display);
        }
-
        free(privacy_display);
 }
 
@@ -408,8 +408,6 @@ void __test_privilege_info_get_privacy_by_privilege()
 {
        char* privacy = NULL;
 
-       __print_line();
-
        __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privacy_by_privilege");
        printf("privilege : http://tizen.org/privilege/apphistory.read\n");
 
@@ -421,7 +419,7 @@ void __test_privilege_info_get_privacy_by_privilege()
 
        __print_line();
 
-       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privacy_by_privilege");
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privacy_by_privilege invalid parameter");
        printf("privilege : http://tizen.org/privilege/internet\n");
 
        ret = privilege_info_get_privacy_by_privilege("http://tizen.org/privilege/internet", &privacy);
@@ -437,6 +435,7 @@ void __test_privilege_info_get_privilege_display_name()
        char *display_name = NULL;
        char *expected_display_name = NULL;
 
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privilege_display_name expect true");
        printf("privilege : http://tizen.org/privilege/account.read\n");
        expected_display_name = "IDS_TPLATFORM_BODY_READING_ACCOUNTS";
        ret = privilege_info_get_privilege_display_name("http://tizen.org/privilege/account.read", &display_name);
@@ -446,6 +445,7 @@ void __test_privilege_info_get_privilege_display_name()
        expected_display_name = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_display_name with wrong privilege");
        printf("privilege : http://tizen.org/privilege/badge.admin\n");
        ret = privilege_info_get_privilege_display_name("http://tizen.org/privilege/badge.admin", &display_name);
        __check_get_privilege_display_name_result(PRVMGR_ERR_NONE, ret, display_name, expected_display_name);
@@ -454,6 +454,7 @@ void __test_privilege_info_get_privilege_display_name()
        expected_display_name = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_display_name with wrong privilege");
        printf("privilege : http://tizen.org/privilege/accousdfsdnt.resdfsdfad\n");
        ret = privilege_info_get_privilege_display_name("http://tizen.org/privilege/accousdfsdnt.resdfsdfad", &display_name);
        __check_get_privilege_display_name_result(PRVMGR_ERR_NONE, ret, display_name, expected_display_name);
@@ -462,6 +463,7 @@ void __test_privilege_info_get_privilege_display_name()
        expected_display_name = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_display_name with NULL parameter");
        printf("privilege : NULL\n");
        ret = privilege_info_get_privilege_display_name(NULL, &display_name);
        __check_get_privilege_display_name_result(PRVMGR_ERR_INVALID_PARAMETER, ret, display_name, expected_display_name);
@@ -475,6 +477,7 @@ void __test_privilege_info_get_privilege_description()
        char *description = NULL;
        char *expected_description = NULL;
 
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privilege_description expect true");
        printf("privilege : http://tizen.org/privilege/account.read\n");
        expected_description = "IDS_TPLATFORM_BODY_THIS_APPLICATION_CAN_READ_ACCOUNTS";
        ret = privilege_info_get_privilege_description("http://tizen.org/privilege/account.read", &description);
@@ -483,6 +486,7 @@ void __test_privilege_info_get_privilege_description()
        description = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description with wrong parameter");
        printf("privilege : http://tizen.org/privilege/badge.admin\n");
        expected_description = NULL;
        ret = privilege_info_get_privilege_description("http://tizen.org/privilege/badge.admin", &description);
@@ -491,6 +495,7 @@ void __test_privilege_info_get_privilege_description()
        description = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description with invalid parameter");
        printf("privilege : http://tizen.org/privilege/accousdfsdnt.resdfsdfad\n");
        expected_description = NULL;
        ret = privilege_info_get_privilege_description("http://tizen.org/privilege/accousdfsdnt.resdfsdfad", &description);
@@ -499,7 +504,7 @@ void __test_privilege_info_get_privilege_description()
        description = NULL;
        __print_line();
 
-       printf("privilege : NULL\n");
+       __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);
        free(description);
@@ -512,6 +517,7 @@ void __test_privilege_info_get_privilege_group_display_name()
        int ret;
        char *group_name = NULL;
 
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privilege_group_display_name expect true");
        printf("privilege : http://tizen.org/privilege/group/group0\n");
        ret = privilege_info_get_privilege_group_display_name("http://tizen.org/privilege/group/group0", &group_name);
        __check_get_privilege_group_display_name_result(PRVMGR_ERR_NONE, ret, group_name);
@@ -529,6 +535,7 @@ void __test_privilege_info_get_privilege_group_display_name()
        __check_get_privilege_group_display_name_result(PRVMGR_ERR_NONE, ret, group_name);
        free(group_name);
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_group_display_name with null privilege");
        printf("privilege : NULL\n");
        group_name = NULL;
        ret = privilege_info_get_privilege_group_display_name(NULL, &group_name);
@@ -575,7 +582,13 @@ void __test_privilege_info_get_privilege_type()
        printf("pkgid = org.test.webapp_4\n");
        printf("privilege = http://tizen.org/privilege/internet\n");
        printf("expected type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL\n");
-       ret = privilege_info_get_privilege_type(5001, "org.test.webapp_4", PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, "http://tizen.org/privilege/internet", &type);
+       ret = privilege_info_get_privilege_type(
+               5001,
+               "org.test.webapp_4",
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               "http://tizen.org/privilege/internet",
+               &type);
        if (ret == PRVMGR_ERR_NONE && type == PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL) {
                success_cnt++;
                printf_green("success\n");
@@ -591,7 +604,13 @@ void __test_privilege_info_get_privilege_type()
        printf("uid = 5001\n");
        printf("pkgid = org.test.webapp_4\n");
        printf("privilege = http://tizen.org/privilege/mediastorage\n");
-       ret = privilege_info_get_privilege_type(5001, "org.test.webapp_4", PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, "http://tizen.org/privilege/mediastorage", &type);
+       ret = privilege_info_get_privilege_type(
+               5001,
+               "org.test.webapp_4",
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               "http://tizen.org/privilege/mediastorage",
+               &type);
        if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE) {
                printf("expected type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_PRIVACY\n");
                if (ret == PRVMGR_ERR_NONE && type == PRIVILEGE_MANAGER_PRIVILEGE_TYPE_PRIVACY) {
@@ -620,7 +639,13 @@ void __test_privilege_info_get_privilege_type()
        printf("pkgid = org.test.webapp_4\n");
        printf("privilege = http://tizen.org/privilege/call\n");
        printf("expected type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL\n");
-       ret = privilege_info_get_privilege_type(5001, "org.test.webapp_4", PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, "http://tizen.org/privilege/call", &type);
+       ret = privilege_info_get_privilege_type(
+               5001,
+               "org.test.webapp_4",
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               "http://tizen.org/privilege/call",
+               &type);
        if (ret == PRVMGR_ERR_NONE && type == PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL) {
                success_cnt++;
                printf_green("success\n");
@@ -637,7 +662,13 @@ void __test_privilege_info_get_privilege_type()
        printf("pkgid = org.test.webapp_5\n");
        printf("privilege = http://tizen.org/privilege/mediastorage\n");
        printf("expected type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL\n");
-       ret = privilege_info_get_privilege_type(5001, "org.test.webapp_5", PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, "http://tizen.org/privilege/mediastorage", &type);
+       ret = privilege_info_get_privilege_type(
+               5001,
+               "org.test.webapp_5",
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               "http://tizen.org/privilege/mediastorage",
+               &type);
        if (ret == PRVMGR_ERR_NONE && type == PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL) {
                success_cnt++;
                printf_green("success\n");
@@ -662,7 +693,13 @@ void __test_privilege_info_get_privilege_type()
        printf("check privilege type\n");
        __tcinfo(goal, NEG_TC_PREFIX "privilege_info_get_privilege_type");
        printf("expected type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_BLACKLIST\n");
-       ret = privilege_info_get_privilege_type(0, "org.tizen.testtest", PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, "http://tizen.org/privilege/yyyyy", &type);
+       ret = privilege_info_get_privilege_type(
+               0,
+               "org.tizen.testtest",
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               "http://tizen.org/privilege/yyyyy",
+               &type);
        if (ret == PRVMGR_ERR_NONE && type == PRIVILEGE_MANAGER_PRIVILEGE_TYPE_BLACKLIST) {
                success_cnt++;
                printf_green("success\n");
@@ -684,7 +721,13 @@ void __test_privilege_info_get_privilege_type()
        printf("pkgid = NULL\n");
        printf("privilege = \n");
        printf("expected ret = PRVMGR_ERR_INVALID_PARAMETER\n");
-       ret = privilege_info_get_privilege_type(5001, NULL, PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, NULL, &type);
+       ret = privilege_info_get_privilege_type(
+               5001,
+               NULL,
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               NULL,
+               &type);
        if (ret == PRVMGR_ERR_INVALID_PARAMETER) {
                success_cnt++;
                printf_green("success\n");
@@ -701,7 +744,13 @@ void __test_privilege_info_get_privilege_type()
        printf("pkgid = org.tizen.testtest\n");
        printf("privilege = http://tizen.org/privilege/yyyyy\n");
        printf("expected type = PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL\n");
-       ret = privilege_info_get_privilege_type(5001, "org.tizen.testtest", PRVMGR_PACKAGE_TYPE_WRT, PRVMGR_PACKAGE_VISIBILITY_PLATFORM, "http://tizen.org/privilege/yyyyy", &type);
+       ret = privilege_info_get_privilege_type(
+               5001,
+               "org.tizen.testtest",
+               PRVMGR_PACKAGE_TYPE_WRT,
+               PRVMGR_PACKAGE_VISIBILITY_PLATFORM,
+               "http://tizen.org/privilege/yyyyy",
+               &type);
        if (ret == PRVMGR_ERR_NONE && type == PRIVILEGE_MANAGER_PRIVILEGE_TYPE_NORMAL) {
                success_cnt++;
                printf_green("success\n");
@@ -830,10 +879,10 @@ void __test_privilege_info_get_privilege_noti_info_list()
        privilege_noti_info_result_e return_result;
        int ret;
 
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privilege_noti_info_list expect true");
        char* privilege_name_1 = "http://tizen.org/privilege/call";
        char* privilege_name_2 = "http://tizen.org/privilege/content.read";
        char* privilege_name_3 = "http://tizen.org/privilege/filesystem.read";
-       char* privilege_name_4 = "http://tizen.org/privilege/bookmark.admin";
        printf("TEST NAME: %s #1\n", __func__);
        printf("--- UNKNOWN_LOCAL_CODE\n");
        printf("--- locale : xx_XX.UTF8\n");
@@ -862,8 +911,17 @@ void __test_privilege_info_get_privilege_noti_info_list()
        privilege_info_list_expected = g_list_append(privilege_info_list_expected, &privilege_info_2);
        privilege_info_list_expected = g_list_append(privilege_info_list_expected, &privilege_info_3);
 
-       ret = privilege_info_get_privilege_noti_info_list("xx_XX.UTF8", privilege_name_list, &privilege_info_list_result, &return_result);
-       __check_privilege_info_get_privilege_info(PRVMGR_ERR_NONE, ret, privilege_info_list_expected, privilege_info_list_result, return_result);
+       ret = privilege_info_get_privilege_noti_info_list(
+               "xx_XX.UTF8",
+               privilege_name_list,
+               &privilege_info_list_result,
+               &return_result);
+       __check_privilege_info_get_privilege_info(
+               PRVMGR_ERR_NONE,
+               ret,
+               privilege_info_list_expected,
+               privilege_info_list_result,
+               return_result);
        g_list_free(privilege_name_list);
        privilege_name_list = NULL;
        privilege_info_list_expected = NULL;
@@ -871,25 +929,22 @@ void __test_privilege_info_get_privilege_noti_info_list()
        privilege_info_list_result = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "test privilege_info_get_privilege_noti_info_list with null privilege_name_list");
        printf("TEST NAME: %s #2\n", __func__);
        printf("--- locale : vi_VN.UTF8\n");
-       printf("--- privilege name : %s\n", privilege_name_1);
-       printf("--- privilege name : %s\n", privilege_name_4);
-       privilege_name_list = g_list_append(privilege_name_list, privilege_name_1);
-       privilege_name_list = g_list_append(privilege_name_list, privilege_name_4);
-
-       privilege_info_1.privilege_name = privilege_name_1;
-       privilege_info_1.display_name = "Thực hiện cuộc gọi";
-       privilege_info_1.description = "Ứng dụng này có thể gọi đến các số điện thoại khi bạn chạm vào các số này mà không cần xác nhận thêm. Việc này có thể phát sinh thêm phí tùy vào gói cước của bạn.";
-       privilege_info_2.privilege_name = privilege_name_4;
-       privilege_info_2.display_name = "Truy cập đánh dấu Internet";
-       privilege_info_2.description = "Ứng dụng này có thể truy xuất, tạo, sửa và xóa đánh dấu Internet.";
-
-       privilege_info_list_expected = g_list_append(privilege_info_list_expected, &privilege_info_1);
-       privilege_info_list_expected = g_list_append(privilege_info_list_expected, &privilege_info_2);
-
-       ret = privilege_info_get_privilege_noti_info_list("vi_VN.UTF8", privilege_name_list, &privilege_info_list_result, &return_result);
-       __check_privilege_info_get_privilege_info(PRVMGR_ERR_NONE, ret, privilege_info_list_expected, privilege_info_list_result, return_result);
+       printf("--- privilege_name_list : NULL\n");
+
+       ret = privilege_info_get_privilege_noti_info_list(
+               "vi_VN.UTF8",
+               privilege_name_list,
+               &privilege_info_list_result,
+               &return_result);
+       __check_privilege_info_get_privilege_info(
+               PRVMGR_ERR_INVALID_PARAMETER,
+               ret,
+               privilege_info_list_expected,
+               privilege_info_list_result,
+               return_result);
        g_list_free(privilege_name_list);
        privilege_info_free_privilege_noti_info_list(privilege_info_list_result);
        __print_line();
@@ -901,21 +956,56 @@ void __test_privilege_info_get_privilege_description_by_package_type()
        char* description = NULL;
        char* expected_description = NULL;
 
+       /* api-version 2.3 */
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type expect true");
        printf("api_version : 2.3\n");
        printf("privilege : http://tizen.org/privilege/window.priority.set\n");
        expected_description = "IDS_TPLATFORM_BODY_THIS_APPLICATION_CAN_APPEAR_ON_TOP_OF_OTHER_WINDOWS_AND_SCREENS_MSG";
-       ret = privilege_info_get_privilege_description_by_package_type("http://tizen.org/privilege/window.priority.set", "2.3", PRVMGR_PACKAGE_TYPE_CORE, &description);
+       ret = privilege_info_get_privilege_description_by_package_type(
+               "http://tizen.org/privilege/window.priority.set",
+               "2.3",
+               PRVMGR_PACKAGE_TYPE_CORE,
+               &description);
        __check_get_privilege_description_result(PRVMGR_ERR_NONE, ret, description, expected_description);
        free(description);
        description = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type with invalid privilege");
        printf("api_version : 2.3\n");
        printf("privilege : http://tizen.org/privilege/RRRRRRRRRR\n");
-       ret = privilege_info_get_privilege_description_by_package_type("http://tizen.org/privilege/RRRRRRRRRR", "2.3", PRVMGR_PACKAGE_TYPE_CORE, &description);
+       ret = privilege_info_get_privilege_description_by_package_type(
+               "http://tizen.org/privilege/RRRRRRRRRR",
+               "2.3",
+               PRVMGR_PACKAGE_TYPE_CORE,
+               &description);
        __check_get_privilege_description_result(PRVMGR_ERR_NO_EXIST_PRIVILEGE, ret, description, expected_description);
        free(description);
        __print_line();
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type with null privilege");
+       printf("api_version : 2.3\n");
+       printf("privilege : NULL\n");
+       ret = privilege_info_get_privilege_description_by_package_type(
+               NULL,
+               "2.3",
+               PRVMGR_PACKAGE_TYPE_CORE,
+               &description);
+       __check_get_privilege_description_result(PRVMGR_ERR_INVALID_PARAMETER, ret, description, expected_description);
+       free(description);
+       __print_line();
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_description_by_package_type with PRVMGR_PACKAGE_TYPE_NONE");
+       printf("api_version : 2.3\n");
+       printf("privilege : http://tizen.org/privilege/window.priority.set\n");
+       ret = privilege_info_get_privilege_description_by_package_type(
+               "http://tizen.org/privilege/window.priority.set",
+               "2.3",
+               PRVMGR_PACKAGE_TYPE_NONE,
+               &description);
+       __check_get_privilege_description_result(PRVMGR_ERR_INVALID_PARAMETER, ret, description, expected_description);
+       free(description);
+       __print_line();
 }
 
 void __test_privilege_info_get_privilege_display_name_by_package_type()
@@ -924,22 +1014,49 @@ void __test_privilege_info_get_privilege_display_name_by_package_type()
        char* display_name = NULL;
        char* expected_display_name = NULL;
 
+       /* api-version 2.3 */
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_get_privilege_display_name_by_package_type expect true");
        printf("api_version : 2.3\n");
        printf("privilege : http://tizen.org/privilege/window.priority.set\n");
        expected_display_name = "IDS_TPLATFORM_HEADER_DISPLAYING_WINDOWS_ON_TOP_OF_OTHER_APPLICATIONS_AND_SCREENS";
-       ret = privilege_info_get_privilege_display_name_by_package_type("http://tizen.org/privilege/window.priority.set", "2.3", PRVMGR_PACKAGE_TYPE_CORE, &display_name);
+       ret = privilege_info_get_privilege_display_name_by_package_type(
+               "http://tizen.org/privilege/window.priority.set",
+               "2.3",
+               PRVMGR_PACKAGE_TYPE_CORE,
+               &display_name);
        __check_get_privilege_display_name_result(PRVMGR_ERR_NONE, ret, display_name, expected_display_name);
        free(display_name);
        display_name = NULL;
        expected_display_name = NULL;
        __print_line();
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_get_privilege_display_name_by_package_type with invalid privilege");
        printf("api_version : 2.3\n");
        printf("privilege : http://tizen.org/privilege/RRRRRRRRRR\n");
-       ret = privilege_info_get_privilege_display_name_by_package_type("http://tizen.org/privilege/RRRRRRRRRR", "2.3", PRVMGR_PACKAGE_TYPE_CORE, &display_name);
+       ret = privilege_info_get_privilege_display_name_by_package_type(
+               "http://tizen.org/privilege/RRRRRRRRRR",
+               "2.3",
+               PRVMGR_PACKAGE_TYPE_CORE,
+               &display_name);
        __check_get_privilege_display_name_result(PRVMGR_ERR_NO_EXIST_PRIVILEGE, ret, display_name, expected_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("api_version : 2.3\n");
+       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);
+       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("api_version : 2.3\n");
+       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);
+       free(display_name);
+       __print_line();
 }
 
 int __check_privilege_info_foreach_list_callback(const char *name, void* user_data)
@@ -957,6 +1074,7 @@ void __test_privilege_info_foreach_privilege_group_list_by_pkgid()
        GList* group_list_user_data = NULL;
        int ret;
 
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_foreach_privilege_group_list_by_pkgid expect true");
        char *pkgid = "attach-panel-camera";
        char *privilege_group_1 = "http://tizen.org/privilege/group/group0";
        char *privilege_group_2 = "http://tizen.org/privilege/group/group5";
@@ -977,6 +1095,38 @@ void __test_privilege_info_foreach_privilege_group_list_by_pkgid()
 
        __check_the_return_code('m', expected_result, ret);
        gfree(group_list_user_data);
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_group_list_by_pkgid with empty group_list_user_data");
+       pkgid = "attach-panel-camera";
+
+       printf("pkgid : %s\n", pkgid);
+       printf("group_list_user_data : <empty>\n");
+
+       expected_result = PRVMGR_ERR_INTERNAL_ERROR;
+
+       ret = privilege_info_foreach_privilege_group_list_by_pkgid(
+               pkgid,
+               __check_privilege_info_foreach_list_callback,
+               group_list_user_data);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(group_list_user_data);
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_group_list_by_pkgid without callback function parameter");
+       pkgid = "attach-panel-camera";
+
+       printf("pkgid : %s\n", pkgid);
+       printf("group_list_user_data : <empty>\n");
+
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
+
+       ret = privilege_info_foreach_privilege_group_list_by_pkgid(
+               pkgid,
+               NULL,
+               group_list_user_data);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(group_list_user_data);
 }
 
 void __test_privilege_info_foreach_privilege_group_list_by_pkgid_and_uid()
@@ -988,7 +1138,7 @@ void __test_privilege_info_foreach_privilege_group_list_by_pkgid_and_uid()
        char *privilege_group_1 = "http://tizen.org/privilege/group/group0";
        char *privilege_group_2 = "http://tizen.org/privilege/group/group4";
 
-       __tcinfo(goal, POS_TC_PREFIX "foreach privilege group list by pkgid and uid");
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_foreach_privilege_group_list_by_pkgid_and_uid expect true");
 
        printf("pkgid : %s\n", pkgid);
        printf("privilege group : %s\n", privilege_group_1);
@@ -1007,6 +1157,36 @@ void __test_privilege_info_foreach_privilege_group_list_by_pkgid_and_uid()
 
        __check_the_return_code('m', expected_result, ret);
        gfree(group_list_user_data);
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_group_list_by_pkgid_and_uid with empty group_list_user_data");
+
+       printf("pkgid : %s\n", pkgid);
+
+       expected_result = PRVMGR_ERR_INTERNAL_ERROR;
+
+       ret = privilege_info_foreach_privilege_group_list_by_pkgid_and_uid(
+               pkgid,
+               0,
+               __check_privilege_info_foreach_list_callback,
+               group_list_user_data);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(group_list_user_data);
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_group_list_by_pkgid_and_uid without callback function parameter");
+
+       printf("pkgid : %s\n", pkgid);
+
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
+
+       ret = privilege_info_foreach_privilege_group_list_by_pkgid_and_uid(
+               pkgid,
+               0,
+               NULL,
+               group_list_user_data);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(group_list_user_data);
 }
 
 void __test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group()
@@ -1018,7 +1198,7 @@ void __test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group()
        char *privilege_group = "http://tizen.org/privilege/group/group0";
        char *privilege = "http://tizen.org/privilege/camera";
 
-       __tcinfo(goal, POS_TC_PREFIX "foreach privilege list by pkgid and privilege group");
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group expect true");
 
        printf("pkgid : %s\n", pkgid);
        printf("privilege_group : %s\n", privilege_group);
@@ -1037,9 +1217,9 @@ void __test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group()
        __check_the_return_code('m', expected_result, ret);
        gfree(privilege_list);
 
-       privilege = "http://tizen.org/privilege/audiorecorder";
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group without callback function");
 
-       __tcinfo(goal, POS_TC_PREFIX "foreach privilege list by pkgid and privilege group");
+       privilege = "http://tizen.org/privilege/audiorecorder";
 
        printf("pkgid : %s\n", pkgid);
        printf("privilege_group : %s\n", privilege_group);
@@ -1047,11 +1227,27 @@ void __test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group()
 
        privilege_list = g_list_append(privilege_list, privilege);
 
-       expected_result = PRVMGR_ERR_NONE;
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
 
        ret = privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group(
                pkgid,
                privilege_group,
+               NULL,
+               privilege_list);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(privilege_list);
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group with null privilege_group");
+
+       printf("pkgid : %s\n", pkgid);
+       printf("privilege_group : NULL\n");
+
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
+
+       ret = privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group(
+               pkgid,
+               NULL,
                __check_privilege_info_foreach_list_callback,
                privilege_list);
 
@@ -1068,7 +1264,7 @@ void __test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_a
        char *privilege_group = "http://tizen.org/privilege/group/group0";
        char *privilege = "http://tizen.org/privilege/camera";
 
-       __tcinfo(goal, POS_TC_PREFIX "foreach privilege list by pkgid and privilege group and uid");
+       __tcinfo(goal, POS_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid expect true");
 
        printf("pkgid : %s\n", pkgid);
        printf("privilege_group : %s\n", privilege_group);
@@ -1088,22 +1284,63 @@ void __test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_a
        __check_the_return_code('m', expected_result, ret);
        gfree(privilege_list);
 
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid without callback function");
+
        privilege = "http://tizen.org/privilege/d2d.datasharing";
+       printf("pkgid : %s\n", pkgid);
+       printf("privilege_group : %s\n", privilege_group);
+       printf("privilege : %s\n", privilege);
+
+       privilege_list = g_list_append(privilege_list, privilege);
+
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
+
+       ret = privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid(
+               pkgid,
+               0,
+               privilege_group,
+               NULL,
+               privilege_list);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(privilege_list);
 
-       __tcinfo(goal, POS_TC_PREFIX "foreach privilege list by pkgid and privilege group and uid");
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid with null pkgid");
 
+       privilege = "http://tizen.org/privilege/d2d.datasharing";
+       printf("pkgid : null\n");
+       printf("privilege_group : %s\n", privilege_group);
+       printf("privilege : %s\n", privilege);
+
+       privilege_list = g_list_append(privilege_list, privilege);
+
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
+
+       ret = privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid(
+               NULL,
+               0,
+               privilege_group,
+               __check_privilege_info_foreach_list_callback,
+               privilege_list);
+
+       __check_the_return_code('m', expected_result, ret);
+       gfree(privilege_list);
+
+       __tcinfo(goal, NEG_TC_PREFIX "__test_privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid with null privilege_group");
+
+       privilege = "http://tizen.org/privilege/d2d.datasharing";
        printf("pkgid : %s\n", pkgid);
        printf("privilege_group : %s\n", privilege_group);
        printf("privilege : %s\n", privilege);
 
        privilege_list = g_list_append(privilege_list, privilege);
 
-       expected_result = PRVMGR_ERR_NONE;
+       expected_result = PRVMGR_ERR_INVALID_PARAMETER;
 
        ret = privilege_info_foreach_privilege_list_by_pkgid_and_privilege_group_and_uid(
                pkgid,
                0,
-               privilege_group,
+               NULL,
                __check_privilege_info_foreach_list_callback,
                privilege_list);