aboutsummaryrefslogtreecommitdiff
path: root/src/test/test.c
AgeCommit message (Collapse)Author
2018-05-09Merge branch 'ticket26009'Nick Mathewson
2018-05-06Add unit test for ..get_start_of_next_voting_interval().Nick Mathewson
This functionality was covered only accidentally by our voting-test code, and as such wasn't actually tested at all. The tests that called it made its coverage nondeterministic, depending on what time of day you ran the tests. Closes ticket 26014.
2018-05-03Merge remote-tracking branch 'github/ticket25995'Nick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-05-03Basic unit tests for update_current_time().Nick Mathewson
This function is about to get more complicated, so we should track how it's working.
2018-05-01Use a deterministic PRNG in test_circuit_timeout()Nick Mathewson
I'd prefer not to do this for randomized tests, but as things stand with this test, it produces nondeterministic test coverage. Closes ticket 25995; bugfix on 0.2.2.2-alpha when this test was introduced.
2018-04-23test: Add periodic events unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-13Merge branch 'token_bucket_refactor_squashed'Nick Mathewson
2018-04-13Add a new token-bucket backend abstraction, with testsNick Mathewson
This differs from our previous token bucket abstraction in a few ways: 1) It is an abstraction, and not a collection of fields. 2) It is meant to be used with monotonic timestamps, which should produce better results than calling gettimeofday over and over.
2018-04-10Merge remote-tracking branch 'isis-github/bug25425_squashed2'Nick Mathewson
2018-04-09test: Add testing module and some unittests for bridges.c.Isis Lovecruft
This roughly doubles our test coverage of the bridges.c module. * ADD new testing module, .../src/test/test_bridges.c. * CHANGE a few function declarations from `static` to `STATIC`. * CHANGE one function in transports.c, transport_get_by_name(), to be mockable. * CLOSES #25425: https://bugs.torproject.org/25425
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-04-05Merge remote-tracking branch 'public/split_relay_crypto'Nick Mathewson
2018-03-24Basic unit tests for relay_crypto.cNick Mathewson
These tests handle incoming and outgoing cells on a three-hop circuit, and make sure that the crypto works end-to-end. They don't yet test spec conformance, leaky-pipe, or various error cases.
2018-03-15Split geoip tests into a separate module.Nick Mathewson
2018-02-15Merge remote-tracking branch 'isis/bug25171' into maint-0.3.3Nick Mathewson
2018-02-16tests: Remove duplicate included header file in src/test/test.c.Isis Lovecruft
* FIXES #25271: https://bugs.torproject.org/25271
2018-02-09Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-08Merge branch 'ticket25183_029_01' into ticket24902_029_05David Goulet
2018-02-08test: Add unit tests for addressset.cDavid Goulet
This also adds one that tests the integration with the nodelist. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-02Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-02Merge branch 'ticket25122_029_02' into ticket24902_029_05David Goulet
2018-02-02geoip: Hook the client history cache into the OOM handlerDavid Goulet
If the cache is using 20% of our maximum allowed memory, clean 10% of it. Same behavior as the HS descriptor cache. Closes #25122 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-30Merge branch 'ticket24902_029_05' into ticket24902_033_02David Goulet
2018-01-30test: Add unit tests for the DoS subsystemGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-08Merge remote-tracking branch 'mikeperry/bug23114_squashed2'Nick Mathewson
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Switch to a safer FREE_AND_NULL implementationNick Mathewson
This one only evaluates the input once, so it cannot mess up even if there are side effects.
2017-12-08Update free functions into macros: src/or/ part 1Nick Mathewson
This covers addressmap.h (no change needed) through confparse.h
2017-12-07Add tests for circuitstats.cMike Perry
These tests primarily test the relaxed and measured behavior of circuitstats.c, to make sure we did not break it with #23100 or #23114.
2017-12-05test: Add HS_DESC v3 unit testsDavid Goulet
This introduces the test_hs_control.c file which at this commit contains basic unit test for the HS_DESC event. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-27Merge branch 'protover-rust-impl_squashed'Nick Mathewson
2017-10-27move to allocating c strings from rustChelsea Holland Komlo
2017-10-24Merge branch 'feature18329_029_squashed' into maint-0.3.2Nick Mathewson
2017-10-24test: Add unittest for descriptors with BridgeDistribution option.Isis Lovecruft
2017-09-27Let's get 100% coverage for proto_http while we're at it.Nick Mathewson
There was some coverage before, but it was mostly accidental.
2017-09-27Add unit tests for var_cell and control0 proto functions.Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-08-24Ensure that `make check-spaces` is happy.Alexander Færøy
The `test-operator-cleanup` patch, and related coccinelle patches, don't do any checks for line length. This patch fixes the line length issues caused by the previous commits.
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-08-19prop224: Refactor parse_extended_hostname() to parse v3 addrs.George Kadianakis
We need this func so that we recognize SOCKS conns to v3 addresses. - Also rename rend_valid_service_id() to rend_valid_v2_service_id() - Also move parse_extended_hostname() tests to their own unittest, and add a v3 address to the test as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add test_hs_common unit testsDavid Goulet
Move tests from test_hs_service.c to this file. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add test_hs_ntor unit testsDavid Goulet
Move the ntor test from test_hs_service.c to this file. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add test_hs_cell unit testsDavid Goulet
Move ESTABLISH_INTRO tests from test_hs_service.c to this new file. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
We need to keep these around for TAP and old-style hidden services, but they're obsolete, and we shouldn't encourage anyone to use them. So I've added "obsolete" to their names, and a comment explaining what the problem is. Closes ticket 23026.
2017-07-13test: Add HS v2 service configuration unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-07test: Add client-side unittests for e2e rend circuits.George Kadianakis
2017-05-19Merge branch 'add_rust_squashed'Nick Mathewson