aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitbuild.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-04-01 21:14:51 +1000
committerteor <teor@torproject.org>2020-04-09 11:00:04 +1000
commit3334f63516e8461e287fafa1a80e5ff893c8c70e (patch)
tree018679db3241d8ad8f770e034eed145e1dc40c06 /src/test/test_circuitbuild.c
parentec632b01db69dbaac04542837cfe9dd9c9323e6b (diff)
downloadtor-3334f63516e8461e287fafa1a80e5ff893c8c70e.tar.gz
tor-3334f63516e8461e287fafa1a80e5ff893c8c70e.zip
test/circuitbuild: Refactor test case array
Avoid repeating test names. Part of 33633.
Diffstat (limited to 'src/test/test_circuitbuild.c')
-rw-r--r--src/test/test_circuitbuild.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/test/test_circuitbuild.c b/src/test/test_circuitbuild.c
index 10d78abc35..6a83d2f8bd 100644
--- a/src/test/test_circuitbuild.c
+++ b/src/test/test_circuitbuild.c
@@ -180,12 +180,17 @@ test_upgrade_from_guard_wait(void *arg)
entry_guard_free_(guard);
}
+#define TEST(name, flags, setup, cleanup) \
+ { #name, test_ ## name, flags, setup, cleanup }
+
+#define TEST_NEW_ROUTE_LEN(name, flags) \
+ { #name, test_new_route_len_ ## name, flags, NULL, NULL }
+
struct testcase_t circuitbuild_tests[] = {
- { "noexit", test_new_route_len_noexit, 0, NULL, NULL },
- { "safe_exit", test_new_route_len_safe_exit, 0, NULL, NULL },
- { "unsafe_exit", test_new_route_len_unsafe_exit, 0, NULL, NULL },
- { "unhandled_exit", test_new_route_len_unhandled_exit, 0, NULL, NULL },
- { "upgrade_from_guard_wait", test_upgrade_from_guard_wait, TT_FORK,
- &helper_pubsub_setup, NULL },
+ TEST_NEW_ROUTE_LEN(noexit, 0),
+ TEST_NEW_ROUTE_LEN(safe_exit, 0),
+ TEST_NEW_ROUTE_LEN(unsafe_exit, 0),
+ TEST_NEW_ROUTE_LEN(unhandled_exit, 0),
+ TEST(upgrade_from_guard_wait, TT_FORK, &helper_pubsub_setup, NULL),
END_OF_TESTCASES
};