diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-21 13:07:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-21 14:39:23 -0400 |
commit | 418e6caeebfb13c66ea1b4904fb331fe57b82b80 (patch) | |
tree | 9189015c838c66a5f1d9d98af8aba69852ed138b /src/test | |
parent | fb34c66e83790bf03b163555128565823a3e58fe (diff) | |
download | tor-418e6caeebfb13c66ea1b4904fb331fe57b82b80.tar.gz tor-418e6caeebfb13c66ea1b4904fb331fe57b82b80.zip |
New function to load windows system libraries
This function uses GetSystemDirectory() to make sure we load the version
of the library from c:\windows\system32 (or local equivalent) rather than
whatever version lives in the cwd.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 8a13597978..116d4f5d8d 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1139,6 +1139,19 @@ test_util_listdir(void *ptr) } } +#ifdef MS_WINDOWS +static void +test_util_load_win_lib(void *ptr) +{ + HANDLE h = load_windows_system_library("advapi32.dll"); + + tt_assert(h); + done: + if (h) + CloseHandle(h); +} +#endif + #define UTIL_LEGACY(name) \ { #name, legacy_test_helper, 0, &legacy_setup, test_util_ ## name } @@ -1162,6 +1175,9 @@ struct testcase_t util_tests[] = { UTIL_TEST(find_str_at_start_of_line, 0), UTIL_TEST(asprintf, 0), UTIL_TEST(listdir, 0), +#ifdef MS_WINDOWS + UTIL_TEST(load_win_lib, 0), +#endif END_OF_TESTCASES }; |