summaryrefslogtreecommitdiff
path: root/src/test/test_util.c
AgeCommit message (Collapse)Author
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-26Add a function to compute millisecond time difference quickly.Nick Mathewson
Our main function, though accurate on all platforms, can be very slow on 32-bit hosts. This one is faster on all 32-bit hosts, and accurate everywhere except apple, where it will typically be off by 1%. But since 32-bit apple is a relic anyway, I think we should be fine.
2018-04-16Helper function to add u32 without overflow.Mike Perry
2018-04-1332-bit compilation warningsNick Mathewson
2018-04-13Expose a function that computes stamp units from msec.Nick Mathewson
(It turns out we can't just expose STAMP_TICKS_PER_SECOND, since Apple doesn't have that.)
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-03-28Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-28Rename string_is_valid_hostname -> string_is_valid_nonrfc_hostnameNick Mathewson
Per discussion on 25055.
2018-03-28Don't explode on NULL or empty stringrl1987
2018-03-28Allow alphanumeric TLDs in test for nowrl1987
2018-03-28Validate hostnames with punycode TLDs correctlyrl1987
2018-03-28Test TLD validationrl1987
2018-03-28Do not consider IP strings valid DNS names. Fixes #25055rl1987
2018-02-15Merge branch '25162_zstd_static'Nick Mathewson
2018-02-07Merge remote-tracking branch 'dgoulet/bug25113_029_01'Nick Mathewson
2018-02-07test: Bump to 10 msec gap in the monotonic testDavid Goulet
On slow system, 1 msec between one read and the other was too tight. For instance, it failed on armel with a 4msec gap: https://buildd.debian.org/status/package.php?p=tor&suite=experimental Increase to 10 msec for now to address slow system. It is important that we keep this OP_LE test in so we make sure the msec/usec/nsec read aren't desynchronized by huge gaps. We'll adjust again if we ever encounter a system that goes slower than 10 msec between calls. Fixes #25113 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-06Make zstd unit tests try running with static-only fns disabledNick Mathewson
Since we're making it so that unstable zstd apis can be disabled, we need to test them. I do this by adding a variant setup/cleanup function for the tests, and teaching it about a fake compression method called "x-zstd:nostatic".
2017-12-20whitespace fixNick Mathewson
2017-12-20Improve add_msec test to cover ms->sec rolloverNick Mathewson
Per mikeperry's suggestion, I'm making sure that the millisecond part of the time will always roll over in this test.
2017-12-13Add a function to add msec to a monotime.Nick Mathewson
We'll use this for the channel padding logic.
2017-12-13Add monotime functions for clearing monotonic timesNick Mathewson
We need this to replace some of our "msec" users with monotime users.
2017-11-27Add a new notion of "stamps" to be a fast 32-bit monotonic timestampNick Mathewson
The goal here is to replace our use of msec-based timestamps with something less precise, but easier to calculate. We're doing this because calculating lots of msec-based timestamps requires lots of 64/32 division operations, which can be inefficient on 32-bit platforms. We make sure that these stamps can be calculated using only the coarse monotonic timer and 32-bit bitwise operations.
2017-09-28Merge remote-tracking branch 'catalyst-oniongit/bug23691'Nick Mathewson
2017-09-28Fix leak in test_util.cTaylor Yu
AddressSanitizer found a leak in test_util_decompress_dos_impl(). Fixes bug #23691.
2017-09-28Enable disabled test that was disabled due to bug #23551Alexander Færøy
See: https://bugs.torproject.org/23551
2017-09-28Improve unit test coverage for compression code.Nick Mathewson
These tests try uncompressing garbage, verify that we won't make compression bombs, and verify that we won't uncompress compression bombs.
2017-09-22Use setup_full_capture_of_logs for 21800Nick Mathewson
setup_capture_of_logs() doesn't actually suppress warnings :p
2017-09-22test_util: capture the log in the correct place.Nick Mathewson
2017-09-21Capture "Result does not fit in tor_timegm()" warnings in util testsNick Mathewson
Fixes bug 21800; bugfix on 0.2.9.x
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-09-12Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-12Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-09-12Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-09-12Avoid sscanf() warnings from openbsd in the unit testsNick Mathewson
OpenBSD doesn't like tricks where you use a too-wide sscanf argument for a too-narrow array, even when you know the input string statically. The fix here is just to use bigger buffers. Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-08-08Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-08Merge remote-tracking branch 'ahf/bugs/22286' into maint-0.3.1Nick Mathewson
2017-07-31Now that "base -1" is a bug, tell our unit tests to expect bug warningsNick Mathewson
Bugfix on accb734c5fc45481231b837; bug not in any released Tor.
2017-06-20Add a unit test for decompressing concatenated inputs.Nick Mathewson
2017-05-19fix a coverity resource leak warningNick Mathewson
2017-05-18Add support for %include funcionality on torrc #1922Daniel Pinto
config_get_lines is now split into two functions: - config_get_lines which is the same as before we had %include - config_get_lines_include which actually processes %include
2017-05-17Check that tor_compress_state_size() returns a value larger than zero.Alexander Færøy
See: https://bugs.torproject.org/22286
2017-05-16Ensure that each compression backend returns a provider version identifier.Alexander Færøy
2017-05-02Merge branch 'compress_none_v2_squashed'Nick Mathewson