diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-05 17:46:42 -0400 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-09-12 18:07:47 +0300 |
commit | c3b1a25d46273a730529f6bfd2ee49cbdac5197a (patch) | |
tree | 6d44f9c33a2b760d385c866a56d6217837949361 /src/test/test_addr.c | |
parent | 261ec900dbcac91d8da354d93195bbd70a05b483 (diff) | |
download | tor-c3b1a25d46273a730529f6bfd2ee49cbdac5197a.tar.gz tor-c3b1a25d46273a730529f6bfd2ee49cbdac5197a.zip |
Workaround for GCC "note" about "variable tracking size limit"
GCC complains that we are using too many variables here, probably
because of the sheer number of locals used for our tinytest macros.
Eventually we should fix that (see 30968), but this commit just
makes the "note" go away by splitting the test function into two.
Diffstat (limited to 'src/test/test_addr.c')
-rw-r--r-- | src/test/test_addr.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/test/test_addr.c b/src/test/test_addr.c index 1b53bf2739..f99e3be8f5 100644 --- a/src/test/test_addr.c +++ b/src/test/test_addr.c @@ -1123,9 +1123,8 @@ test_addr_ip6_helpers(void *arg) TEST_ADDR_LOOKUP_XFAIL(host_port_str, AF_INET6); \ STMT_END -/** Test tor_addr_parse() and tor_addr_port_parse(). */ static void -test_addr_parse(void *arg) +test_addr_parse_canonical(void *arg) { int r; tor_addr_t addr; @@ -1153,6 +1152,22 @@ test_addr_parse(void *arg) TEST_ADDR_V6_PARSE_CANONICAL("::", 0); TEST_ADDR_V6_PARSE_CANONICAL("2::", 0); TEST_ADDR_V6_PARSE_CANONICAL("11:22:33:44:55:66:77:88", 0); + done: + ; +} + +/** Test tor_addr_parse() and tor_addr_port_parse(). */ +static void +test_addr_parse(void *arg) +{ + int r; + tor_addr_t addr; + uint16_t port; + const char *sv; + uint32_t addr32h; + char buf[TOR_ADDR_BUF_LEN]; + + (void)arg; /* IPv6-mapped IPv4 addresses. Tor doesn't really use these. */ TEST_ADDR_V6_PARSE("11:22:33:44:55:66:1.2.3.4", 0, @@ -1637,6 +1652,7 @@ struct testcase_t addr_tests[] = { ADDR_LEGACY(basic), ADDR_LEGACY(ip6_helpers), ADDR_LEGACY(parse), + ADDR_LEGACY(parse_canonical), { "virtaddr", test_virtaddrmap, 0, NULL, NULL }, { "virtaddr_persist", test_virtaddrmap_persist, TT_FORK, NULL, NULL }, { "localname", test_addr_localname, 0, NULL, NULL }, |