aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_addr.c
AgeCommit message (Collapse)Author
2019-09-12Workaround for GCC "note" about "variable tracking size limit"Nick Mathewson
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.
2019-09-12Remove variable declarations from macros in test_addr_parse()Nick Mathewson
Instead, put them in the function itself. This is an attempt to fix the gcc warning about the "variable tracking size limit exceeded".
2019-06-26test/addr: test that tor_addr_port_lookup() handles IP addresses and portsteor
And that it does something sensible with host and host:port. Also reorder the tests into valid, invalid, and ambiguous. And add some missing cases. Note: tor_addr_port_lookup() handles ip, ip:port, host, and host:port. Tests for 30721.
2019-06-26test/addr: test that tor_addr_lookup() handles IP addressesteor
And that it fails on IP:port and host:port, and does something sensible with host. Tests for 30721.
2019-06-26test/addr: test that tor_lookup_hostname() handles IPv4 addressesteor
And that it fails on IPv6 and host:port, and does something sensible with host. Tests for 30721.
2019-06-26test/addr: Add some ambiguous IPv6 cases to test_addr_parse()teor
Test some strings which could be parsed as IPv6 addresses, or as IPv6:port strings. Additional tests for 30721.
2019-06-26test/addr: Increase coverage in test_addr_parse()teor
Do as many tests as possible for each input string. Then remove some redundant test cases. Cleanup after 30721.
2019-06-26test/addr: Stop repeating so much code in test_addr_parse()teor
Cleanup after 30721.
2019-06-26test/addr: Add unit tests for the fixes in 30721teor
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-30Use prefilled_rng in test_addr.c in place of existing code.Nick Mathewson
2019-03-12Merge branch 'tor-github/pr/763' into maint-0.4.0George Kadianakis
2019-03-08Merge remote-tracking branch 'bug28525_029' into maint-0.3.5teor
2019-03-08Make tor_addr_is_internal_() RFC6598 (Carrier Grade NAT) awareNeel Chauhan
Fixes 28525.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-08-31Add tests for tor_addr_parse, separate from tor_addr_port_parse.David Fifield
2018-07-10Isolate resolve.h usage in the modules that really need it.Nick Mathewson
(Almost none of Tor should actually need to touch the platform resolver.)
2018-07-10Remove all users of addr_port_lookup outside of address.cNick Mathewson
This function has a nasty API, since whether or not it invokes the resolver depends on whether one of its arguments is NULL. That's a good way for accidents to happen. This patch incidentally makes tor-resolve support socks hosts on IPv6.
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-01Remove system headers from or.hNick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-08Fix compilation of test_addr.cNick Mathewson
This needs to include crypto_rand.h (which it didn't before it was merged).
2018-05-08More unit tests for addressmap_get_virtual_address().Nick Mathewson
Previously the coverage on this function was mostly accidental, coming as it did from test_entryconn.c. These new tests use mocking to ensure that we actually hit the different failure and retry cases of addressmap_get_virtual_address(), and make our test coverage a bit more deterministic. Closes ticket 25993.
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-07-05Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-07-05Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-07-05Merge branch 'maint-0.2.7-redux' into maint-0.2.8Nick Mathewson
2017-07-05Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-07-05Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-07-03Fix assertion failure related to openbsd strtol().Nick Mathewson
Fixes bug 22789; bugfix on 0.2.3.8-alpha.
2017-05-26Mock tor_addr_lookup() during part of addr/basic test.Nick Mathewson
If this function isn't mocked, then our unit tests break on stupid networks where localhost is broken or absent. Fixes bug 6298; bugfix on 0.0.9pre2.
2017-03-15Run the copyright update script.Nick Mathewson
2016-10-11Fix a bug in displaying IPv6 addrs in test_op_ipv6_ with --verboseNick Mathewson
The test code, if it failed, or if it was run in verbose mode, would use the wrong variable for its loop. Patch from rubiate uploaded to 19999.
2016-09-06checkSpace.pl now forbids more identifiers.Nick Mathewson
The functions it warns about are: assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc, strdup, strndup, calloc. Also, fix a few lingering instances of these in the code. Use other conventions to indicate _intended_ use of assert and malloc/realloc/etc.
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-02-27Update the copyright year.Nick Mathewson
2016-01-03Test another codepath in inet_ntopNick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-12Merge remote-tracking branch 'public/bug7484'Nick Mathewson
Conflicts: src/test/test_addr.c
2014-11-12Fix wide lines (from 13172)Nick Mathewson
2014-11-12Replace operators used as macro arguments with OP_XX macrosNick Mathewson
Part of fix for 13172
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-16clean up eol whitespace from coccinelle-generated patchesNick Mathewson
2014-09-16Remove the legacy_test_helper and legacy_setup wrappersNick Mathewson
These wrappers went into place when the default type for our unit test functions changed from "void fn(void)" to "void fn(void *arg)". To generate this patch, I did the same hokey-pokey as before with replacing all operators used as macro arguments, then I ran a coccinelle script, then I ran perl script to fix up everything that used legacy_test_helper, then I manually removed the legacy_test_helper functions, then I ran a final perl script to put the operators back how they were. ============================== #!/usr/bin/perl -w -i -p s/==,/_X_EQ_,/g; s/!=,/_X_NE_,/g; s/<,/_X_LT_,/g; s/>,/_X_GT_,/g; s/>=,/_X_GEQ_,/g; s/<=,/_X_LEQ_,/g; -------------------- @@ identifier func =~ "test_.*$"; statement S, S2; @@ static void func ( -void +void *arg ) { ... when != S2 +(void) arg; S ... } -------------------- #!/usr/bin/perl -w -i -p s/, *legacy_test_helper, *([^,]+), *\&legacy_setup, *([^\}]+) *}/, $2, $1, NULL, NULL }/g; -------------------- #!/usr/bin/perl -w -i -p s/_X_NEQ_/!=/g; s/_X_NE_/!=/g; s/_X_EQ_/==/g; s/_X_GT_/>/g; s/_X_LT_/</g; s/_X_GEQ_/>=/g; s/_X_LEQ_/<=/g; --------------------