aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2020-09-09 22:08:54 +0000
committerDavid Goulet <dgoulet@torproject.org>2020-09-10 10:51:57 -0400
commit1c4b140427aeb36d80475e92fe57154fcc8abcf3 (patch)
tree068b66118c83ee5503bac61d6a34c78edd57bb61 /src/test
parent12c758312651c09eb68e9f4e04a7fd3ad9c3a811 (diff)
downloadtor-1c4b140427aeb36d80475e92fe57154fcc8abcf3.tar.gz
tor-1c4b140427aeb36d80475e92fe57154fcc8abcf3.zip
Check if glob() is available at build-time.
This patch disables the glob() support in the path library if glob() is unavailable at build-time. This currently happens with the Android NDK used for Tor Browser. See: https://bugs.torproject.org/tpo/core/tor/40114
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 0e2550d5c5..3ce7103ade 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -4440,6 +4440,7 @@ test_util_glob(void *ptr)
{
(void)ptr;
+#ifdef HAVE_GLOB
smartlist_t *results = NULL;
int r, i;
char *dir1 = NULL, *dir2 = NULL, *forbidden = NULL, *dirname = NULL;
@@ -4656,6 +4657,11 @@ test_util_glob(void *ptr)
SMARTLIST_FOREACH(results, char *, f, tor_free(f));
smartlist_free(results);
}
+#else
+ tt_skip();
+ done:
+ return;
+#endif
}
static void
@@ -4663,6 +4669,7 @@ test_util_get_glob_opened_files(void *ptr)
{
(void)ptr;
+#ifdef HAVE_GLOB
smartlist_t *results = NULL;
int r, i;
char *dir1 = NULL, *dir2 = NULL, *forbidden = NULL, *dirname = NULL;
@@ -4843,6 +4850,11 @@ test_util_get_glob_opened_files(void *ptr)
SMARTLIST_FOREACH(results, char *, f, tor_free(f));
smartlist_free(results);
}
+#else
+ tt_skip();
+ done:
+ return;
+#endif
}
static void