[tor-commits] [tor/master] Always define NS_MODULE and NS_SUBMODULE when NS is used.
nickm at torproject.org
nickm at torproject.org
Thu Jan 9 21:02:50 UTC 2020
commit 1ffba2f1217e5025dd2e6fe783517a22e225c63b
Author: Nick Mathewson <nickm at torproject.org>
Date: Thu Jan 9 09:56:41 2020 -0500
Always define NS_MODULE and NS_SUBMODULE when NS is used.
When these macros aren't defined, the expansions of the NS macros
can get particularly ugly.
---
src/test/test_dir.c | 1 +
src/test/test_dir_handle_get.c | 1 +
src/test/test_options.c | 3 ++-
src/test/test_router.c | 3 +++
4 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 3a7ba4292..7065012cf 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -95,6 +95,7 @@
#endif
#define NS_MODULE dir
+#define NS_SUBMODULE tests
static networkstatus_t *
networkstatus_parse_vote_from_string_(const char *s,
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index 49034fd32..cf8711272 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -65,6 +65,7 @@ ENABLE_GCC_WARNING("-Woverlength-strings")
#endif
#define NS_MODULE dir_handle_get
+#define NS_SUBMODULE tests
#define NOT_FOUND "HTTP/1.0 404 Not found\r\n\r\n"
#define BAD_REQUEST "HTTP/1.0 400 Bad request\r\n\r\n"
diff --git a/src/test/test_options.c b/src/test/test_options.c
index 4877827ae..a363eca67 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -35,7 +35,8 @@
#include <sys/param.h>
#endif
-#define NS_MODULE test_options
+#define NS_MODULE opt
+#define NS_SUBMODULE tests
typedef struct {
int severity;
diff --git a/src/test/test_router.c b/src/test/test_router.c
index 79f56eed0..a1ea2967f 100644
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@ -31,6 +31,9 @@
#include "test/test.h"
#include "test/log_test_helpers.h"
+#define NS_MODULE rtr
+#define NS_SUBMODULE tests
+
NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
static routerinfo_t* mock_routerinfo;
More information about the tor-commits
mailing list