Age | Commit message (Collapse) | Author |
|
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.
|
|
Instead, put them in the function itself.
This is an attempt to fix the gcc warning about the "variable
tracking size limit exceeded".
|
|
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.
|
|
And that it fails on IP:port and host:port, and does something sensible with
host.
Tests for 30721.
|
|
And that it fails on IPv6 and host:port, and does something sensible with
host.
Tests for 30721.
|
|
Test some strings which could be parsed as IPv6 addresses,
or as IPv6:port strings.
Additional tests for 30721.
|
|
Do as many tests as possible for each input string.
Then remove some redundant test cases.
Cleanup after 30721.
|
|
Cleanup after 30721.
|
|
|
|
|
|
|
|
|
|
|
|
Fixes 28525.
|
|
|
|
|
|
|
|
(Almost none of Tor should actually need to touch the platform resolver.)
|
|
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.
|
|
I am very glad to have written this script.
|
|
|
|
|
|
|
|
|
|
This needs to include crypto_rand.h (which it didn't before it was
merged).
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes bug 22789; bugfix on 0.2.3.8-alpha.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
This is a partial fix for 18902.
|
|
|
|
|
|
|
|
Conflicts:
src/test/test_addr.c
|
|
|
|
Part of fix for 13172
|
|
Because in 95 years, we or our successors will surely care about
enforcing the BSD license terms on this code. Right?
|
|
|
|
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;
--------------------
|