extern void __test_privilege_db_manager_get_privilege_display();
extern void __test_privilege_db_manager_get_privilege_description();
extern void __test_privilege_db_manager_get_privacy_by_privilege();
+extern void __test_privilege_db_manager_get_privacy_id_by_privilege();
extern void __test_privilege_db_manager_is_privacy_white_list();
extern void __test_privilege_db_manager_get_privacy_id();
extern void __test_privilege_db_manager_is_user_settable();
__tcinfo(function, "privilege_db_manager_get_privilege_description");
__test_privilege_db_manager_get_privilege_description();
- __tcinfo(function, "privilege_db_manager_get_privacy_id_by_privilege, privilege_db_manager_get_privacy_by_privilege");
+ __tcinfo(function, "privilege_db_manager_get_privacy_by_privilege");
__test_privilege_db_manager_get_privacy_by_privilege();
+ __tcinfo(function, "privilege_db_manager_get_privacy_id_by_privilege");
+ __test_privilege_db_manager_get_privacy_id_by_privilege();
+
__tcinfo(function, "privilege_db_manager_is_privacy_white_list");
__test_privilege_db_manager_is_privacy_white_list();
return ret;
}
+static bool __check_result_code_and_integer(
+ char type,
+ int expected_result,
+ int achieved_result,
+ int expected_ret,
+ int achieved_ret)
+{
+ bool isFalse = __check_the_return_code(type, expected_result, achieved_result);
+
+ if (isFalse)
+ return false;
+
+ printf("\texpected data: %d\n\tactual data: %d\n", expected_ret, achieved_ret);
+
+ if (expected_ret == achieved_ret) {
+ printf("---> VALID\n");
+ return true;
+ } else {
+ printf("---> INVALID\n");
+ printf_red("TEST RESULT: FAILED\n");
+ fail_cnt++;
+ success_cnt--;
+ return false;
+ }
+}
+
void __check_result_code_and_list(
GList *expected_list,
GList *achieved_list,
privacy_name = NULL;
}
+void __test_privilege_db_manager_get_privacy_id_by_privilege()
+{
+ __print_line();
+
+ int privacy_id;
+ int expected_privacy_id;
+ char *privilege = "http://tizen.org/privilege/account.read";
+
+ __tcinfo(goal, POS_TC_PREFIX "get privacy id by privilege");
+
+ expected_privacy_id = 0;
+ printf("privilege: %s\n", privilege);
+
+ int ret = privilege_db_manager_get_privacy_id_by_privilege(privilege, &privacy_id);
+ __check_result_code_and_integer('d', PRIVILEGE_DB_MANAGER_ERR_NONE, ret, expected_privacy_id, privacy_id);
+
+ __tcinfo(goal, NEG_TC_PREFIX "get privacy id by privilege with privilege parameter does not exist");
+
+ privilege = "http://tizen.org/privilege/fakeData";
+ expected_privacy_id = 99999;
+ privacy_id = 99999;
+
+ printf("privilege: %s\n", privilege);
+
+ ret = privilege_db_manager_get_privacy_id_by_privilege(privilege, &privacy_id);
+ __check_result_code_and_integer('d', PRIVILEGE_DB_MANAGER_ERR_NO_EXIST_RESULT, ret, expected_privacy_id, privacy_id);
+
+}
+
void __test_privilege_db_manager_is_privacy_white_list()
{
int ret = 0;