diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-14 12:42:19 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-14 12:42:19 -0500 |
commit | dec11793ba2fdaeb975e1566b68846431fb85110 (patch) | |
tree | f7438a205d25d220ffda591fc624fe917be7db5c /src/test/test_util.c | |
parent | 75741c6b3a2c180788a89a7eaca6d790e5d0606c (diff) | |
parent | 8ab9f93993dd53ae0fdadae88da48a660ad3f4e3 (diff) | |
download | tor-dec11793ba2fdaeb975e1566b68846431fb85110.tar.gz tor-dec11793ba2fdaeb975e1566b68846431fb85110.zip |
Merge branch 'ticket32825_squashed'
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index d8bb5302e3..07c31f02d6 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -72,6 +72,11 @@ #include <ctype.h> #include <float.h> +/* These platforms don't have meaningful pwdb or homedirs. */ +#if defined(_WIN32) || defined(__ANDROID__) +#define DISABLE_PWDB_TESTS +#endif + #define INFINITY_DBL ((double)INFINITY) #define NAN_DBL ((double)NAN) @@ -1845,7 +1850,7 @@ test_util_config_line_crlf(void *arg) tor_free(k); tor_free(v); } -#ifndef _WIN32 +#ifndef DISABLE_PWDB_TESTS static void test_util_expand_filename(void *arg) { @@ -5686,7 +5691,7 @@ test_util_touch_file(void *arg) ; } -#ifndef _WIN32 +#ifndef DISABLE_PWDB_TESTS static void test_util_pwdb(void *arg) { @@ -5758,7 +5763,7 @@ test_util_pwdb(void *arg) tor_free(dir); teardown_capture_of_logs(); } -#endif /* !defined(_WIN32) */ +#endif /* !(defined(_WIN32) || defined (__ANDROID__)) */ static void test_util_calloc_check(void *arg) @@ -6326,14 +6331,16 @@ test_util_map_anon_nofork(void *arg) #endif /* !defined(COCCI) */ #ifdef _WIN32 -#define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL } #define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f)) -#define UTIL_LEGACY_NO_WIN(n) UTIL_TEST_NO_WIN(n, 0) #else -#define UTIL_TEST_NO_WIN(n, f) UTIL_TEST(n, (f)) #define UTIL_TEST_WIN_ONLY(n, f) { #n, NULL, TT_SKIP, NULL, NULL } -#define UTIL_LEGACY_NO_WIN(n) UTIL_LEGACY(n) -#endif /* defined(_WIN32) */ +#endif + +#ifdef DISABLE_PWDB_TESTS +#define UTIL_TEST_PWDB(n, f) { #n, NULL, TT_SKIP, NULL, NULL } +#else +#define UTIL_TEST_PWDB(n, f) UTIL_TEST(n, (f)) +#endif struct testcase_t util_tests[] = { UTIL_LEGACY(time), @@ -6343,7 +6350,7 @@ struct testcase_t util_tests[] = { UTIL_LEGACY(config_line_comment_character), UTIL_LEGACY(config_line_escaped_content), UTIL_LEGACY(config_line_crlf), - UTIL_LEGACY_NO_WIN(expand_filename), + UTIL_TEST_PWDB(expand_filename, 0), UTIL_LEGACY(escape_string_socks), UTIL_LEGACY(string_is_key_value), UTIL_LEGACY(strmisc), @@ -6428,7 +6435,7 @@ struct testcase_t util_tests[] = { UTIL_TEST(writepid, 0), UTIL_TEST(get_avail_disk_space, 0), UTIL_TEST(touch_file, 0), - UTIL_TEST_NO_WIN(pwdb, TT_FORK), + UTIL_TEST_PWDB(pwdb, TT_FORK), UTIL_TEST(calloc_check, 0), UTIL_TEST(monotonic_time, 0), UTIL_TEST(monotonic_time_ratchet, TT_FORK), |