}
if (package_type == PRVMGR_PACKAGE_TYPE_WRT) {
char *tmp_api_version = strdup(api_version);
+ TryReturn(tmp_api_version != NULL, , PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] tmp_api_version's strdup is failed.");
+ size_t new_size = snprintf(0, 0, "%s%s", tmp_api_version, API_VERSION_PADDING) + 1;
+ tmp_api_version = realloc(tmp_api_version, new_size * sizeof(char));
+ TryReturn(tmp_api_version != NULL, free(tmp_api_version), PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] tmp_api_version's realloc is failed.");
strncat(tmp_api_version, ".0", strlen(".0"));
for (i = 0; i < 5; i++) {
ADD_DEFINITIONS("-DPROFILE_TYPE_TV")
ENDIF()
-SET(requires glib-2.0 dlog security-manager)
+SET(requires glib-2.0 dlog)
INCLUDE(FindPkgConfig)
pkg_check_modules(${PACKAGE_NAME} REQUIRED ${requires})
FOREACH(flag ${${PACKAGE_NAME}_CFLAGS})
ADD_EXECUTABLE(${TC2_NAME} ${TC2_SRCS})
ADD_EXECUTABLE(${TC3_NAME} ${TC3_SRCS})
-TARGET_LINK_LIBRARIES(${TC1_NAME}
+TARGET_LINK_LIBRARIES(${TC1_NAME}
"capi-security-privilege-manager"
- "security-manager-client"
- "security-manager-commons"
)
TARGET_LINK_LIBRARIES(${TC2_NAME} "capi-security-privilege-manager")
TARGET_LINK_LIBRARIES(${TC3_NAME} "capi-security-privilege-manager")
#include <stdio.h>
#include <privilege_db_manager.h>
-#include <security-manager.h>
#define BRIGHTNESS 0
#define RED 31
printf("mapped_privilege_name = %s\n", privilege_name);
}
- printf("-----------------------------------------------------------\n");
- printf("Compare with security_manager_get_privileges_mapping(const char *from_version, const char *to_version, char const * const *privileges, size_t privileges_count, char ***privileges_mappings, size_t *mappings_count)\n");
-
- printf("privilege : http://tizen.org/privilege/internal/default/public\n");
- printf("privilege : http://tizen.org/privilege/mediacapture\n");
- printf("privilege : http://tizen.org/privilege/content.read\n");
- printf("privilege : http://tizen.org/privilege/internal/webappdefault\n");
-
- char **input_privileges = (char **)malloc(sizeof(char*) * 20);
- size_t input_size = 0;
- input_privileges[input_size++] = strdup("http://tizen.org/privilege/internal/webappdefault");
- input_privileges[input_size++] = strdup("http://tizen.org/privilege/internal/default/public");
- input_privileges[input_size++] = strdup("http://tizen.org/privilege/mediacapture");
- input_privileges[input_size++] = strdup("http://tizen.org/privilege/content.read");
- char **output_privileges = NULL;
- size_t output_size;
- ret = security_manager_get_privileges_mapping("2.2.1", "3.0", input_privileges, input_size, &output_privileges, &output_size);
- int i;
- printf("output_size = %d\n", output_size);
- for (i = 0; i < output_size; i++)
- printf("mapped_privilege_name = %s\n", output_privileges[i]);
+ g_list_free(privilege_list);
+ g_list_free(mapped_privilege_list);
__change_color_to_green();
printf("test success\n");
int main()
{
-/* __change_color_to_yellow();
- printf("Test function : privilege_db_manager_get_privilege_list\n");
- __change_color_to_origin();
- __test_privilege_db_manager_get_privilege_list();*/
+ __change_color_to_yellow();
+ printf("Test function : privilege_db_manager_get_privilege_list\n");
+ __change_color_to_origin();
+ __test_privilege_db_manager_get_privilege_list();
__change_color_to_yellow();
printf("Test function : privilege_db_manager_get_mapped_privilege_list\n");
__change_color_to_origin();
__test_privilege_db_manager_get_mapped_privilege_list();
-/* __change_color_to_yellow();
- printf("Test function : privilege_db_manager_get_privilege_display\n");
- __change_color_to_origin();
- __test_privilege_db_manager_get_privilege_display();
-
- __change_color_to_yellow();
- printf("Test function : privilege_db_manager_get_privilege_description\n");
- __change_color_to_origin();
- __test_privilege_db_manager_get_privilege_description();
-
- __change_color_to_green();
- printf("Test Complete\n");
- printf("success : %d, ", success_cnt);
- __change_color_to_red();
- printf("fail : %d\n", fail_cnt);
- __change_color_to_origin();*/
+ __change_color_to_yellow();
+ printf("Test function : privilege_db_manager_get_privilege_display\n");
+ __change_color_to_origin();
+ __test_privilege_db_manager_get_privilege_display();
+
+ __change_color_to_yellow();
+ printf("Test function : privilege_db_manager_get_privilege_description\n");
+ __change_color_to_origin();
+ __test_privilege_db_manager_get_privilege_description();
+
+ __change_color_to_green();
+ printf("Test Complete\n");
+ printf("success : %d, ", success_cnt);
+ __change_color_to_red();
+ printf("fail : %d\n", fail_cnt);
+ __change_color_to_origin();
return 0;
}