summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2016-07-01prop250: Add unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-06-20Coverage hack for test_switch_id.shNick Mathewson
This hack provides a way to make sure we can see coverage from test-switch-id. If you set OVERRIDE_GCDA_PERMISSIONS_HACK, we temporarily make the .gcda files mode 0666 before we run the test scripts, and then we set them to 0644 again afterwards. That's necessary because the test_switch_id.sh script does a setuid() to 'nobody' part way through, and drops the ability to change its mind back.
2016-06-20Small coverage improvements on compat.cNick Mathewson
2016-06-20More coverage in backtrace.cNick Mathewson
2016-06-20Merge remote-tracking branch 'dgoulet/bug19465_029_01'Nick Mathewson
2016-06-20Fix unit test crash on 32-bit.Nick Mathewson
2016-06-20test: Increase offset to rendcache descriptor timeDavid Goulet
Slow system can sometime take more than 10 seconds to reach the test callsite resulting in the unit test failing when using time in the future or in the past. Fixes #19465 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-20Merge branch 'bug14013_029_01_squashed'Nick Mathewson
2016-06-20Make base16_decodes return number of decoded bytesnikkolasg
base16_decodes() now returns the number of decoded bytes. It's interface changes from returning a "int" to a "ssize_t". Every callsite now checks the returned value. Fixes #14013 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-19Fix #19063: Add check in utility macroU+039b
2016-06-19Merge branch 'zlib_coverage_squashed'Nick Mathewson
2016-06-19Unindent blockNick Mathewson
2016-06-19Remove support for zlib <= 1.1Nick Mathewson
zlib 1.2 came out in 2003; earlier versions should be dead by now. Our workaround code was only preventing us from using the gzip encoding (if we decide to do so), and having some dead code linger around in torgzip.c
2016-06-19Merge remote-tracking branch 'public/thread_coverage'Nick Mathewson
2016-06-18Keep make check-spaces happyAndrea Shepard
2016-06-17Merge branch 'bug18280_029_03_nm_squashed'Nick Mathewson
2016-06-17test: Add base32_encode/decode unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-16Coverage on parse_config_line_from_str_verbose.Nick Mathewson
2016-06-16Remove parse_config_line_from_str aliasNick Mathewson
All of our code just uses parse_config_line_from_str_verbose.
2016-06-16Mark code unreachable in unescape_string()Nick Mathewson
Also, add tests for it in case someday it does become reachable.
2016-06-16On Windows, tv_sec is long, not time_t.Nick Mathewson
I'm not angry, Windows: just very disappointed.
2016-06-16Try to fix memarea test on 32-bit systemsNick Mathewson
2016-06-16Tests for message rate-limitingNick Mathewson
Also note a bug in the rate-limiting message.
2016-06-16tests for size_mul_check__()Nick Mathewson
it's important, and we should make sure we got it right.
2016-06-16Correct the rounding behavior on tv_mdiff.Nick Mathewson
Fix for bug 19428.
2016-06-16Improve coverage on tv_udiff, and tv_mdiff.Nick Mathewson
I found some bugs in tv_mdiff; separate commit for that
2016-06-16Improve coverage on esc_for_log, esc_for_log_lenNick Mathewson
2016-06-16Reach 100% line coverage on memarea.cNick Mathewson
2016-06-14whoops; blank lineNick Mathewson
2016-06-14Use ENABLE/DISABLE_GCC_WARNING in masater.Nick Mathewson
2016-06-14Merge branch 'maint-0.2.8'Nick Mathewson
2016-06-14Resolve the remaining openssl "-Wredundant-decls" warnings.Nick Mathewson
Another part of 19406
2016-06-14use new-form macros to disable -Wredundant-declsNick Mathewson
2016-06-14Merge branch 'maint-0.2.8'Nick Mathewson
2016-06-14Bug 19406: Fix the unit tests to work with OpenSSL 1.1.xYawning Angel
Just as it says on the tin. Don't need to fully disable any tests and reduce coverage either. Yay me.
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add clang's -Wstring-conversion, and fix the one place it hitsNick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-06-11Add the -Wextra-semi warning from clang, and fix the cases where it triggersNick Mathewson
2016-06-11Resolve some warnings from OSX clang.Nick Mathewson
2016-06-11Use autoconf, not gcc version, to decide which warnings we haveNick Mathewson
This gives more accurate results under Clang, which can only help us detect more warnings in more places. Fixes bug 19216; bugfix on 0.2.0.1-alpha
2016-06-11Enable -Woverlength-strings for GCC>=4.6 on MOST of the code.Nick Mathewson
IMO it's fine for us to make exceptions to this rule in the unit tests, but not in the code at large.
2016-06-11Use -Wdouble-promotion in GCC >= 4.6Nick Mathewson
This warning triggers on silently promoting a float to a double. In our code, it's just a sign that somebody used a float by mistake, since we always prefer double.
2016-06-11Add -Wfloat-conversion for GCC >= 4.9Nick Mathewson
This caught quite a few minor issues in our unit tests and elsewhere in our code.
2016-06-11Enable -Wnull-dereference (GCC >=6.1), and fix the easy casesNick Mathewson
This warning, IIUC, means that the compiler doesn't like it when it sees a NULL check _after_ we've already dereferenced the variable. In such cases, it considers itself free to eliminate the NULL check. There are a couple of tricky cases: One was the case related to the fact that tor_addr_to_in6() can return NULL if it gets a non-AF_INET6 address. The fix was to create a variant which asserts on the address type, and never returns NULL.
2016-06-09Reduce make check-spaces noiseAndrea Shepard
2016-06-08Unit tests for our zlib code to test and reject compression bombs.Nick Mathewson
2016-06-08Add several test scripts wrapping test_workqueueNick Mathewson
This is a fairly easy way for us to get our test coverage up on compat_threads.c and workqueue.c -- I already implemented these tests, so we might as well enable them.
2016-06-06Repair test_crypto_openssl_version with LibreSSLNick Mathewson
2016-06-06Check tor_sscanf return value in test_crypto.cNick Mathewson
Coverity noticed that we check tor_sscanf's return value everywhere else.