]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
test: Hide some test-declaration macro definitions to COCCI.
authorNick Mathewson <nickm@torproject.org>
Wed, 9 Oct 2019 14:58:03 +0000 (10:58 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Oct 2019 13:32:13 +0000 (09:32 -0400)
(These ones cause parsing failures.)

src/test/test_addr.c
src/test/test_confparse.c
src/test/test_connection.c
src/test/test_controller.c
src/test/test_crypto.c
src/test/test_crypto_slow.c
src/test/test_dir.c
src/test/test_entrynodes.c
src/test/test_link_handshake.c
src/test/test_options.c
src/test/test_util.c

index 0f50a436158bbd66bdcabfeb24b386eafd2f28f4..50543293c4d070598a9a30c1564558ef04553716 100644 (file)
@@ -1662,8 +1662,10 @@ test_addr_rfc6598(void *arg)
   ;
 }
 
+#ifndef COCCI
 #define ADDR_LEGACY(name)                                               \
   { #name, test_addr_ ## name , 0, NULL, NULL }
+#endif
 
 struct testcase_t addr_tests[] = {
   ADDR_LEGACY(basic),
index bd2b5cdf1b2b8f41a04a06c880ddfa1ce893c34e..454b38c6466ec2cfac8ce9b992924d9edb7a843b 100644 (file)
@@ -1027,12 +1027,14 @@ test_confparse_find_option_name(void *arg)
   config_mgr_free(mgr);
 }
 
+#ifndef COCCI
 #define CONFPARSE_TEST(name, flags)                          \
   { #name, test_confparse_ ## name, flags, NULL, NULL }
 
 #define BADVAL_TEST(name)                               \
   { "badval_" #name, test_confparse_assign_badval, 0,   \
       &passthrough_setup, (void*)&bv_ ## name }
+#endif
 
 struct testcase_t confparse_tests[] = {
   CONFPARSE_TEST(init, 0),
index ebe7c6d36f766a954135dd7529187dcf0af36a3a..3148c1af6694e0ba98c356ea3564a6ea825e94ce 100644 (file)
@@ -881,12 +881,14 @@ test_failed_orconn_tracker(void *arg)
   ;
 }
 
+#ifndef COCCI
 #define CONNECTION_TESTCASE(name, fork, setup)                           \
   { #name, test_conn_##name, fork, &setup, NULL }
 
 /* where arg is an expression (constant, variable, compound expression) */
 #define CONNECTION_TESTCASE_ARG(name, fork, setup, arg)                  \
   { #name "_" #arg, test_conn_##name, fork, &setup, (void *)arg }
+#endif
 
 struct testcase_t connection_tests[] = {
   CONNECTION_TESTCASE(get_basic, TT_FORK, test_conn_get_basic_st),
index b9cbe0a14df3dc3dd9a885308146f0f4f87cd467..df595055f52c819626dd53cf066bfa0731aeba36 100644 (file)
@@ -119,6 +119,7 @@ test_controller_parse_cmd(void *arg)
   control_cmd_args_free(result);
 }
 
+#ifndef COCCI
 #define OK(inp, out) \
   { inp "\r\n", out, NULL }
 #define ERR(inp, err) \
@@ -128,6 +129,7 @@ test_controller_parse_cmd(void *arg)
   { &syntax,                                     \
       ARRAY_LENGTH(array),                       \
       array }
+#endif
 
 static const parser_testcase_t one_to_three_tests[] = {
    ERR("", "Need at least 1 argument(s)"),
@@ -1818,9 +1820,11 @@ test_getinfo_md_all(void *arg)
   return;
 }
 
+#ifndef COCCI
 #define PARSER_TEST(type)                                             \
   { "parse/" #type, test_controller_parse_cmd, 0, &passthrough_setup, \
       (void*)&parse_ ## type ## _params }
+#endif
 
 struct testcase_t controller_tests[] = {
   PARSER_TEST(one_to_three),
index 178a9a5097083154750188c5186548c65f920068..7288e6ee895b8dfc087df98f2e205da610f87b7e 100644 (file)
@@ -2971,6 +2971,7 @@ test_crypto_failure_modes(void *arg)
   ;
 }
 
+#ifndef COCCI
 #define CRYPTO_LEGACY(name)                                            \
   { #name, test_crypto_ ## name , 0, NULL, NULL }
 
@@ -2981,6 +2982,7 @@ test_crypto_failure_modes(void *arg)
 #define ED25519_TEST(name, fl)                  \
   ED25519_TEST_ONE(name, (fl), "donna"),        \
   ED25519_TEST_ONE(name, (fl), "ref10")
+#endif
 
 struct testcase_t crypto_tests[] = {
   CRYPTO_LEGACY(formats),
index 3b20dfa587bde6278aa19cb8edac1ed3a342c04f..4f0cfbc641160774b015d6dbaa0ca650b562450a 100644 (file)
@@ -584,6 +584,7 @@ test_crypto_ed25519_fuzz_donna(void *arg)
   ;
 }
 
+#ifndef COCCI
 #define CRYPTO_LEGACY(name)                                            \
   { #name, test_crypto_ ## name , 0, NULL, NULL }
 
@@ -594,6 +595,7 @@ test_crypto_ed25519_fuzz_donna(void *arg)
 #define ED25519_TEST(name, fl)                  \
   ED25519_TEST_ONE(name, (fl), "donna"),        \
   ED25519_TEST_ONE(name, (fl), "ref10")
+#endif
 
 struct testcase_t slow_crypto_tests[] = {
   CRYPTO_LEGACY(s2k_rfc2440),
index 17d6db1e4d0f0290a6fab8c675f8c0a4f9972ed7..bdcd785451d28adc2e09e1fcb02e841a928ed928 100644 (file)
@@ -7210,6 +7210,7 @@ test_dir_format_versions_list(void *arg)
   teardown_capture_of_logs();
 }
 
+#ifndef COCCI
 #define DIR_LEGACY(name)                             \
   { #name, test_dir_ ## name , TT_FORK, NULL, NULL }
 
@@ -7219,6 +7220,7 @@ test_dir_format_versions_list(void *arg)
 /* where arg is a string constant */
 #define DIR_ARG(name,flags,arg)                      \
   { #name "_" arg, test_dir_##name, (flags), &passthrough_setup, (void*) arg }
+#endif
 
 struct testcase_t dir_tests[] = {
   DIR_LEGACY(nicknames),
index c8dd4b03ea96bc3ab4d3af709ac04349d6a6b2ec..81d9eb9ab3c40cd2fb77a7db62f54b240bd79df3 100644 (file)
@@ -3038,6 +3038,7 @@ static const struct testcase_setup_t upgrade_circuits = {
   upgrade_circuits_setup, upgrade_circuits_cleanup
 };
 
+#ifndef COCCI
 #define NO_PREFIX_TEST(name) \
   { #name, test_ ## name, 0, NULL, NULL }
 
@@ -3060,6 +3061,7 @@ static const struct testcase_setup_t upgrade_circuits = {
     &upgrade_circuits, (void*)(arg REASONABLY_FUTURE) }, \
   { #name "_reasonably_past", test_entry_guard_ ## name, TT_FORK, \
     &upgrade_circuits, (void*)(arg REASONABLY_PAST) }
+#endif
 
 struct testcase_t entrynodes_tests[] = {
   NO_PREFIX_TEST(node_preferred_orport),
index 5e78e1ce4df6b4ad569f89ba783351c94e8d8b69..1371e1ef74a45a494b6da8516645d058737dba9f 100644 (file)
@@ -1492,6 +1492,7 @@ AUTHENTICATE_FAIL(missing_ed_auth,
                     "authentication certificate";
                 })
 
+#ifndef COCCI
 #define TEST_RSA(name, flags)                                           \
   { #name , test_link_handshake_ ## name, (flags),                      \
       &passthrough_setup, (void*)"RSA" }
@@ -1527,6 +1528,7 @@ AUTHENTICATE_FAIL(missing_ed_auth,
 #define TEST_AUTHENTICATE_ED(name)                                      \
   { "authenticate/" #name "_ed25519" , test_link_handshake_auth_ ## name, \
       TT_FORK, &setup_authenticate, (void*)3 }
+#endif
 
 struct testcase_t link_handshake_tests[] = {
   TEST_RSA(certs_ok, TT_FORK),
index a6bccdc524935b7b0e89bdc2544f22754d51132d..62d477a63504e515d2a70bb1306e3106dc970fc8 100644 (file)
@@ -4163,8 +4163,10 @@ test_options_validate__accel(void *ignored)
   tor_free(msg);
 }
 
+#ifndef COCCI
 #define LOCAL_VALIDATE_TEST(name) \
   { "validate__" #name, test_options_validate__ ## name, TT_FORK, NULL, NULL }
+#endif
 
 struct testcase_t options_tests[] = {
   { "validate", test_options_validate, TT_FORK, NULL, NULL },
index c56d3488ba6ddf58ef82f50f6a6def2e91d67c81..b34a9e0ab916ef34fdd599557a9af593c2de7ddf 100644 (file)
@@ -304,6 +304,7 @@ test_util_write_chunks_to_file(void *arg)
   tor_free(temp_str);
 }
 
+#ifndef COCCI
 #define _TFE(a, b, f)  tt_int_op((a).f, OP_EQ, (b).f)
 /** test the minimum set of struct tm fields needed for a unique epoch value
  * this is also the set we use to test tor_timegm */
@@ -316,6 +317,7 @@ test_util_write_chunks_to_file(void *arg)
             _TFE(a, b, tm_min ); \
             _TFE(a, b, tm_sec ); \
           TT_STMT_END
+#endif
 
 static void
 test_util_time(void *arg)
@@ -6256,6 +6258,7 @@ test_util_map_anon_nofork(void *arg)
 #endif /* defined(_WIN32) */
 }
 
+#ifndef COCCI
 #define UTIL_LEGACY(name)                                               \
   { #name, test_util_ ## name , 0, NULL, NULL }
 
@@ -6280,6 +6283,7 @@ test_util_map_anon_nofork(void *arg)
   { "compress_dos/" #name, test_util_decompress_dos, 0,                 \
     &compress_setup,                                                    \
     (char*)(identifier) }
+#endif
 
 #ifdef _WIN32
 #define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL }