diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-12-20 10:04:56 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-14 12:42:13 -0500 |
commit | ac7d6f3c05c47e1ca2e4d65d9b849ee2907b0f55 (patch) | |
tree | 48c63dbe8b15f49af946f736f23fde173cee3b7b /src/test/test_util.c | |
parent | 5c6fc5250e2ab4f0ffb935d018ece39bfa274f87 (diff) | |
download | tor-ac7d6f3c05c47e1ca2e4d65d9b849ee2907b0f55.tar.gz tor-ac7d6f3c05c47e1ca2e4d65d9b849ee2907b0f55.zip |
Rename UTIL_TEST_NO_WIN to reflect intent
Now that these tests are skipped on windows _and_ android, we should
name the macro that skips them after the functionality that the
tests depend on.
Closes last part of 32825.
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index cd745c4427..b9450b29f8 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) { @@ -5653,7 +5658,7 @@ test_util_touch_file(void *arg) ; } -#if !(defined(_WIN32) || defined (__ANDROID__)) +#ifndef DISABLE_PWDB_TESTS static void test_util_pwdb(void *arg) { @@ -6293,15 +6298,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)) -#elif defined(__ANDROID__) -#define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL } -#define UTIL_TEST_WIN_ONLY(n, f) { #n, NULL, TT_SKIP, NULL, NULL } #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 } -#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), @@ -6311,7 +6317,7 @@ struct testcase_t util_tests[] = { UTIL_LEGACY(config_line_comment_character), UTIL_LEGACY(config_line_escaped_content), UTIL_LEGACY(config_line_crlf), - UTIL_TEST_NO_WIN(expand_filename, 0), + UTIL_TEST_PWDB(expand_filename, 0), UTIL_LEGACY(escape_string_socks), UTIL_LEGACY(string_is_key_value), UTIL_LEGACY(strmisc), @@ -6396,7 +6402,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), |