mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'ticket32825_squashed'
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
o Minor features (portability, android):
|
||||
- When building for Android, disable some tests that depend on
|
||||
$HOME and/or pwdb, which Android doesn't have. Closes ticket 32825.
|
||||
Patch from Hans-Christoph Steiner.
|
||||
+17
-10
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user