Age | Commit message (Collapse) | Author | |
---|---|---|---|
2014-09-29 | Parenthesize macro arguments for 13291 fix | Nick Mathewson | |
2014-09-29 | Stop spawn test failures due to a race condition with SIGCHLD on process exit | teor | |
When a spawned process forks, fails, then exits very quickly, (this typically occurs when exec fails), there is a race condition between the SIGCHLD handler updating the process_handle's fields, and checking the process status in those fields. The update can occur before or after the spawn tests check the process status. We check whether the process is running or not running (rather than just checking if it is running) to avoid this issue. | |||
2014-09-17 | Fix a windows unused-arg warning | Nick Mathewson | |
2014-09-16 | clean up eol whitespace from coccinelle-generated patches | Nick Mathewson | |
2014-09-16 | Remove the legacy_test_helper and legacy_setup wrappers | Nick 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; -------------------- | |||
2014-09-15 | Replace the remaining test_assert instances | Nick Mathewson | |
2014-09-15 | Replace the remaining test_n?eq_ptr calls | Nick Mathewson | |
2014-09-15 | Use coccinelle scripts to clean up our unit tests | Nick Mathewson | |
This should get rid of most of the users of the old test_* functions. Some are in macros and will need manual cleanup, though. This patch is for 13119, and was automatically generated with these scripts. The perl scripts are there because coccinelle hates operators as macro arguments. ------------------------------ s/==,/_X_EQ_,/g; s/!=,/_X_NE_,/g; s/<,/_X_LT_,/g; s/>,/_X_GT_,/g; s/>=,/_X_GEQ_,/g; s/<=,/_X_LEQ_,/g; ------------------------------ @@ expression a; identifier func; @@ func (...) { <... -test_fail_msg +TT_DIE ( +( a +) ) ...> } @@ identifier func; @@ func (...) { <... -test_fail() +TT_DIE(("Assertion failed.")) ...> } @@ expression a; identifier func; @@ func (...) { <... -test_assert +tt_assert (a) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_eq +tt_int_op (a, +_X_EQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_neq +tt_int_op (a, +_X_NEQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_streq +tt_str_op (a, +_X_EQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_strneq +tt_str_op (a, +_X_NEQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_eq_ptr +tt_ptr_op (a, +_X_EQ_, b) ...> } @@ expression a, b; identifier func; @@ func() { <... -test_neq_ptr +tt_ptr_op (a, +_X_NEQ_, b) ...> } @@ expression a, b, len; identifier func; @@ func (...) { <... -test_memeq +tt_mem_op (a, +_X_EQ_, b, len) ...> } @@ expression a, b, len; identifier func; @@ func (...) { <... -test_memneq +tt_mem_op (a, +_X_NEQ_, b, len) ...> } ------------------------------ @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a == b +a, _X_EQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a == b +a, _X_EQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a == b +a, _X_EQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a == b +a, _X_EQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a == b +a, _X_EQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a > b +a, _X_GT_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a > b +a, _X_GT_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a > b +a, _X_GT_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a > b +a, _X_GT_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a > b +a, _X_GT_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a < b +a, _X_LT_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a < b +a, _X_LT_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a < b +a, _X_LT_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a < b +a, _X_LT_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a < b +a, _X_LT_, b ) ...> } ------------------------------ 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; s/test_mem_op\(/tt_mem_op\(/g; | |||
2014-09-15 | Don't pass invalid memory regions to digestmap_set/get in test_routerlist | Nick Mathewson | |
Fixes bug in c887e20e6a5a2c17c65; bug in no released Tor version. | |||
2014-09-15 | Clear up another clangalyzer issue | Nick Mathewson | |
"The NULL pointer warnings on the return value of tor_addr_to_in6_addr32() are incorrect. But clang can't work this out itself due to limited analysis depth. To teach the analyser that the return value is safe to dereference, I applied tor_assert to the return value." Patch from teor. Part of 13157. | |||
2014-09-11 | One more whitespace fix | Nick Mathewson | |
2014-09-11 | Whitespace cleanups in test_util | Nick Mathewson | |
2014-09-11 | Merge remote-tracking branch 'public/bug13104_025' | Nick Mathewson | |
2014-09-11 | Fix "comparison is always false" warnings in new test_util_di_ops | Nick Mathewson | |
Having a constant zero means that unsigned < 0 is always false. | |||
2014-09-11 | Merge remote-tracking branch 'public/bug13104_025' | Nick Mathewson | |
2014-09-11 | C90 compliance for #13104 fixes | Nick Mathewson | |
2014-09-11 | Avoid an overflow on negation in format_helper_exit_status | Nick Mathewson | |
Part of 13104; patch from teor. | |||
2014-09-10 | Extra tests for tor_memeq and memcmp | Nick Mathewson | |
(Patch from teor; part of 13104) | |||
2014-09-10 | Avoid overflows and underflows in sscanf and friends | Nick Mathewson | |
(Patch from teor on 13104) | |||
2014-09-02 | Add an assertion to read_file_to_str_until_eof | Nick Mathewson | |
The clangalyzer doesn't believe our math here. I'm pretty sure our math is right. Also, add some unit tests. | |||
2014-08-13 | Apply coccinelle script to replace malloc(a*b)->calloc(a,b) | Nick Mathewson | |
2014-07-28 | Cast long long arguments to (int) for tt_int_op() | Peter Palfrader | |
2014-07-16 | Add a tor_ftruncate to replace ftruncate. | Nick Mathewson | |
(Windows doesn't have ftruncate, and some ftruncates do not move the file pointer to the start of the file.) | |||
2014-07-16 | Fixed fgets_eagain unit test. | cypherpunks | |
On a non-blocking pipe fgets sets EAGAIN when it encounters partial lines. No error is set on full lines or EOF. EOF is reached when the writing end of the pipe is closed. Partial lines and full lines are both returned by fgets, EOF results in NULL. Mention of this behaviour can be found in #1903 and #2045. | |||
2014-06-20 | Thread support is now required | Nick Mathewson | |
Long ago we supported systems where there was no support for threads, or where the threading library was broken. We shouldn't have do that any more: on every OS that matters, threads exist, and the OS supports running threads across multiple CPUs. This resolves tickets 9495 and 12439. It's a prerequisite to making our workqueue code work better, since sensible workqueue implementations don't split across multiple processes. | |||
2014-06-14 | Merge branch 'bug8746_v2_squashed' | Nick Mathewson | |
Conflicts: src/common/include.am | |||
2014-06-14 | refactor win/nix handling for test_spawn_background*() | Nick Mathewson | |
Instead of having a #if ... for every function, just define TEST_CHILD to the right patch and EOL to the expected line terminator. | |||
2014-06-14 | More unit tests for process spawning | Nick Mathewson | |
Try killing a running process; try noticing that a process has exited without checking its output; verify that waitpid_cb (when present) is set to NULL when you would expect it to be. | |||
2014-05-22 | Merge remote-tracking branch 'andrea/bug11476' | Nick Mathewson | |
2014-05-12 | Add --disable-mempools configure option | Andrea Shepard | |
2014-05-11 | Quench clang's complaints with -Wshorten-64-to-32 when time_t is not long. | dana koch | |
On OpenBSD 5.4, time_t is a 32-bit integer. These instances contain implicit treatment of long and time_t as comparable types, so explicitly cast to time_t. | |||
2014-05-08 | One more 64->32 | Nick Mathewson | |
2014-05-08 | Fix numerous 64->32 errors in the unit tests | Nick Mathewson | |
Before the 11825 fix, these were all silently ignored. | |||
2014-05-08 | Fix unearthed problems in unit tests | Nick Mathewson | |
2014-05-08 | Fix test_util_max_mem on 32-bit CPUs | Nick Mathewson | |
2014-04-26 | Fix memory leak in unittest helper function. | Nick Mathewson | |
2014-04-26 | Fix memory leak in test_util_asprintf | Nick Mathewson | |
2014-04-24 | Merge branch 'bug11396_v2_squashed' | Nick Mathewson | |
Conflicts: src/or/main.c | |||
2014-04-24 | get_total_system_memory(): see how much RAM we have | Nick Mathewson | |
2014-04-07 | Fix some harmless/untriggerable memory leaks found by coverity | Nick Mathewson | |
2014-04-07 | Merge remote-tracking branch 'public/bug10363_024_squashed' | Nick Mathewson | |
2014-04-07 | Another 10363 instance: this one in tor_memmem fallback code | Nick Mathewson | |
2014-03-31 | Check return values for tor_munmap_file() in unit tests | Nick Mathewson | |
2014-01-17 | Coverate in util.c: test that tor_parse_* rejects negative base. | Nick Mathewson | |
2013-11-22 | Remove needless fd var from test. CID 1130989. | Nick Mathewson | |
2013-11-18 | Merge branch 'backtrace_squashed' | Nick Mathewson | |
Conflicts: src/common/sandbox.c src/common/sandbox.h src/common/util.c src/or/main.c src/test/include.am src/test/test.c | |||
2013-10-11 | Merge branch 'bug1376' | Nick Mathewson | |
2013-10-11 | Fix some whitespace; tighten the tests. | Nick Mathewson | |
2013-10-10 | Merge remote-tracking branch 'origin/maint-0.2.4' | Nick Mathewson | |
2013-10-10 | Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4 | Nick Mathewson | |