aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_dns.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2015-09-27 19:51:04 +0300
committerrl1987 <rl1987@sdf.lonestar.org>2015-10-24 14:30:20 +0300
commit2f5d0ea13341367e086d2c7a795894ba34029bcb (patch)
tree7bc43bbef1e39222fe09282418bba4e2831ee90b /src/test/test_dns.c
parent2929986049780bd28fb39ae8d0a67e703e5193ef (diff)
downloadtor-2f5d0ea13341367e086d2c7a795894ba34029bcb.tar.gz
tor-2f5d0ea13341367e086d2c7a795894ba34029bcb.zip
Use NS_SUBMODULEs in test_dns.c
Diffstat (limited to 'src/test/test_dns.c')
-rw-r--r--src/test/test_dns.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/test/test_dns.c b/src/test/test_dns.c
index ad81914ccb..6549339397 100644
--- a/src/test/test_dns.c
+++ b/src/test/test_dns.c
@@ -6,8 +6,12 @@
#include "dns.h"
#include "connection.h"
+#define NS_MODULE dns
+
+#define NS_SUBMODULE clip_ttl
+
static void
-test_dns_clip_ttl(void *arg)
+NS(test_main)(void *arg)
{
(void)arg;
@@ -21,8 +25,12 @@ test_dns_clip_ttl(void *arg)
return;
}
+#undef NS_SUBMODULE
+
+#define NS_SUBMODULE expiry_ttl
+
static void
-test_dns_expiry_ttl(void *arg)
+NS(test_main)(void *arg)
{
(void)arg;
@@ -36,6 +44,10 @@ test_dns_expiry_ttl(void *arg)
return;
}
+#undef NS_SUBMODULE
+
+#define NS_SUBMODULE resolve
+
static int resolve_retval = 0;
static int resolve_made_conn_pending = 0;
static char *resolved_name = NULL;
@@ -130,7 +142,7 @@ connection_free_replacement(connection_t *conn)
}
static void
-test_dns_resolve_outer(void *arg)
+NS(test_main)(void *arg)
{
(void) arg;
int retval;
@@ -302,10 +314,14 @@ test_dns_resolve_outer(void *arg)
return;
}
+#undef NS_SUBMODULE
+
struct testcase_t dns_tests[] = {
- { "clip_ttl", test_dns_clip_ttl, 0, NULL, NULL },
- { "expiry_ttl", test_dns_expiry_ttl, 0, NULL, NULL },
- { "resolve_outer", test_dns_resolve_outer, TT_FORK, NULL, NULL },
+ TEST_CASE(clip_ttl),
+ TEST_CASE(expiry_ttl),
+ TEST_CASE(resolve),
END_OF_TESTCASES
};
+#undef NS_MODULE
+