Merge branch 'master' of github.com:FreeRDP/FreeRDP-1.0

This commit is contained in:
Marc-André Moreau 2011-07-25 23:51:21 -04:00
commit 2d3be94c6c
6 changed files with 16 additions and 7 deletions

View File

@ -77,6 +77,7 @@ endif()
find_package(CUnit)
if(CUNIT_FOUND)
add_subdirectory(cunit)
enable_testing()
endif()
# Sub-directories

View File

@ -63,3 +63,4 @@ target_link_libraries(test_freerdp freerdp-gdi)
target_link_libraries(test_freerdp freerdp-utils)
target_link_libraries(test_freerdp freerdp-chanman)
add_test(CUnitTests ${EXECUTABLE_OUTPUT_PATH}/test_freerdp)

View File

@ -108,6 +108,7 @@ int main(int argc, char* argv[])
{
int index = 1;
int *pindex = &index;
int ret = 0;
if (CU_initialize_registry() != CUE_SUCCESS)
return CU_get_error();
@ -201,8 +202,9 @@ int main(int argc, char* argv[])
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
ret = CU_get_number_of_failure_records();
CU_cleanup_registry();
return CU_get_error();
return ret;
}

View File

@ -90,9 +90,11 @@ void test_list(void)
CU_ASSERT(my_list_remove(list, item1) == item1);
my_list_item_free(item1);
xfree(item1);
CU_ASSERT(my_list_remove(list, item2) == item2);
CU_ASSERT(my_list_remove(list, item2) == NULL);
my_list_item_free(item2);
xfree(item2);
my_list_free(list);
}

View File

@ -76,7 +76,12 @@ void test_load_plugin(void)
{
void* entry;
entry = freerdp_load_plugin("cliprdr", "VirtualChannelEntry");
#ifdef _WIN32
/* untested */
entry = freerdp_load_plugin("..\\channels\\cliprdr\\cliprdr", "VirtualChannelEntry");
#else
entry = freerdp_load_plugin("../channels/cliprdr/cliprdr.so", "VirtualChannelEntry");
#endif
CU_ASSERT(entry != NULL);
}

View File

@ -132,12 +132,10 @@ void registry_init(rdpRegistry* registry)
return;
}
length = strlen(home_path);
registry->home = (uint8*) xmalloc(length);
memcpy(registry->home, home_path, length);
registry->home = (uint8*) xstrdup(home_path);
printf("home path: %s\n", registry->home);
registry->path = (uint8*) xmalloc(length + sizeof(registry_dir) + 2);
registry->path = (uint8*) xmalloc(strlen(registry->home) + strlen("/.") + strlen(registry_dir) + 1);
sprintf(registry->path, "%s/.%s", registry->home, registry_dir);
printf("registry path: %s\n", registry->path);
@ -148,7 +146,7 @@ void registry_init(rdpRegistry* registry)
}
length = strlen(registry->path);
registry->file = (uint8*) xmalloc(length + sizeof(registry_file) + 1);
registry->file = (uint8*) xmalloc(strlen(registry->path) + strlen("/") + strlen(registry_file) + 1);
sprintf(registry->file, "%s/%s", registry->path, registry_file);
printf("registry file: %s\n", registry->file);