aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-10 15:01:42 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-06 14:54:04 -0500
commit06a6130666315cb1d385b89d7c95df42ac17db1a (patch)
tree59336636e904ffb39180dbcfcf9d7fa1b913d38a /src/test/test_util.c
parent6104c407e077175087b7ae117c0ace5ce3897bcf (diff)
downloadtor-06a6130666315cb1d385b89d7c95df42ac17db1a.tar.gz
tor-06a6130666315cb1d385b89d7c95df42ac17db1a.zip
Use parentheses to avoid mis-indentations of stringified macro args
clang-format sometimes thinks that "#name" should be written as "# name" if it appears at the start of a line. Using () appears to suppress this, while confusing Coccinelle.
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r--src/test/test_util.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 07c31f02d6..0226517d7b 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -6305,42 +6305,42 @@ test_util_map_anon_nofork(void *arg)
#ifndef COCCI
#define UTIL_LEGACY(name) \
- { #name, test_util_ ## name , 0, NULL, NULL }
+ { (#name), test_util_ ## name , 0, NULL, NULL }
#define UTIL_TEST(name, flags) \
- { #name, test_util_ ## name, flags, NULL, NULL }
+ { (#name), test_util_ ## name, flags, NULL, NULL }
#define COMPRESS(name, identifier) \
- { "compress/" #name, test_util_compress, 0, &compress_setup, \
+ { ("compress/" #name), test_util_compress, 0, &compress_setup, \
(char*)(identifier) }
#define COMPRESS_CONCAT(name, identifier) \
- { "compress_concat/" #name, test_util_decompress_concatenated, 0, \
+ { ("compress_concat/" #name), test_util_decompress_concatenated, 0, \
&compress_setup, \
(char*)(identifier) }
#define COMPRESS_JUNK(name, identifier) \
- { "compress_junk/" #name, test_util_decompress_junk, 0, \
+ { ("compress_junk/" #name), test_util_decompress_junk, 0, \
&compress_setup, \
(char*)(identifier) }
#define COMPRESS_DOS(name, identifier) \
- { "compress_dos/" #name, test_util_decompress_dos, 0, \
+ { ("compress_dos/" #name), test_util_decompress_dos, 0, \
&compress_setup, \
(char*)(identifier) }
-#endif /* !defined(COCCI) */
#ifdef _WIN32
#define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f))
#else
-#define UTIL_TEST_WIN_ONLY(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
+#define UTIL_TEST_WIN_ONLY(n, f) { (#n), NULL, TT_SKIP, NULL, NULL }
#endif
#ifdef DISABLE_PWDB_TESTS
-#define UTIL_TEST_PWDB(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
+#define UTIL_TEST_PWDB(n, f) { (#n), NULL, TT_SKIP, NULL, NULL }
#else
#define UTIL_TEST_PWDB(n, f) UTIL_TEST(n, (f))
#endif
+#endif
struct testcase_t util_tests[] = {
UTIL_LEGACY(time),