summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2013-07-18Start of a unit test for options_validate.Nick Mathewson
I added this so I could write a unit test for ServerTransportOptions, but it incidentally exercises the succeed-on-defaults case of options_validate too.
2013-07-18Add a test for n_cells_in_circuit_queuesNick Mathewson
2013-07-18Unit tests for cell queues.Nick Mathewson
This removes some INLINE markers from functions that probably didn't need them.
2013-07-18Fix a wide line in test_pt.cNick Mathewson
2013-07-18Merge branch 'bug8978_rebase_2'Nick Mathewson
Conflicts: src/test/test_pt.c
2013-07-18Merge branch 'bug8929_rebase_2'Nick Mathewson
2013-07-18Improve test coverage of 8929 codeNick Mathewson
2013-07-18Fix memory leaks in test_config_parse_transport_options_lineNick Mathewson
2013-07-18Rename tor_escape_str_for_socks_arg() to something more generic.George Kadianakis
Since we are going to be using that function to also escape parameters passed to transport proxies using environment variables.
2013-07-18Pass characters to be escaped to tor_escape_str_for_socks_arg().George Kadianakis
This is in preparation for using tor_escape_str_for_socks_arg() to escape server-side pluggable transport parameters.
2013-07-18Write unit tests for the ServerTransportOptions parsing function.George Kadianakis
2013-07-18Add a basic unit test for pt_get_extra_info_descriptor_string.Nick Mathewson
2013-07-18Add a unit test for smethod lines with arguments.Nick Mathewson
2013-07-16Merge remote-tracking branch 'asn/bug9265'Nick Mathewson
2013-07-16Remove an unused variable in test_replaycache_scrubNick Mathewson
2013-07-16Add more replaycache.c unit tests, bringing coverage to 100% for that fileAndrea Shepard
2013-07-16Test deeper in test_pt_parsing().George Kadianakis
We used to test parse_{c,s}method_line() without actually testing that the resulting transport_t was well formed.
2013-07-15Appease "make check-spaces"Nick Mathewson
2013-07-15Lightly refactor and test format_hex_number_sigsafeNick Mathewson
Better tests for upper bounds, and for failing cases. Also, change the function's interface to take a buffer length rather than a maximum length, and then NUL-terminate: functions that don't NUL-terminate are trouble waiting to happen.
2013-07-15HEX_ERRNO_SIZE is no longer the correct upper limit for ↵Nick Mathewson
format_hex_number_sigsafe
2013-07-15Expose format_hex_number_..., and rename it to ..._sigsafe().Nick Mathewson
There are some other places in the code that will want a signal-safe way to format numbers, so it shouldn't be static to util.c.
2013-07-15Don't build format_helper_exit_status on win32Nick Mathewson
The only thing that used format_helper_exit_status on win32 was the unit tests. This caused an error when we tried to leave a static format_helper_exit_status lying around in a production object file. The easiest solution is to admit that this way of dealing with process exit status is Unix-only.
2013-07-15Avoid compiler warning 'unused param'.Linus Nordberg
Fixes #9261.
2013-07-10Add some basic unit tests for the circuit map data structure.Nick Mathewson
These show off the new mocking code by mocking the circuitmux code so that we can test the circuit map code in isolation.
2013-07-10Coverage support: build with --enable-coverage to have tests run with gcovNick Mathewson
If you pass the --enable-coverage flag on the command line, we build our testing binaries with appropriate options eo enable coverage testing. We also build a "tor-cov" binary that has coverage enabled, for integration tests. On recent OSX versions, test coverage only works with clang, not gcc. So we warn about that. Also add a contrib/coverage script to actually run gcov with the appropriate options to generate useful .gcov files. (Thanks to automake, the .o files will not have the names that gcov expects to find.) Also, remove generated gcda and gcno files on clean.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-07-10Start work on fancy compiler tricks to expose extra stuff to our testsNick Mathewson
This is mainly a matter of automake trickery: we build each static library in two versions now: one with the TOR_UNIT_TESTS macro defined, and one without. When TOR_UNIT_TESTS is defined, we can enable mocking and expose more functions. When it's not defined, we can lock the binary down more. The alternatives would be to have alternate build modes: a "testing configuration" for building the libraries with test support, and a "production configuration" for building them without. I don't favor that approach, since I think it would mean more people runnning binaries build for testing, or more people not running unit tests.
2013-06-29Merge remote-tracking branch 'linus/bug8530'Nick Mathewson
2013-06-18Check more return values in the unit testsNick Mathewson
2013-06-18Attempt to un-confuse coverity about (false) double-free in bench_onion_ntor.Nick Mathewson
2013-06-18Fix a couple of resource leaks in test_config.cNick Mathewson
Spotted by Coverity Scan. Not in any released Tor.
2013-06-18Invoke binaries in $PATH rather than by absolute path.Linus Nordberg
That security measure costs more than it gives. So, keep your PATH sane and we can run this script on more than one system.
2013-06-14Use CHUTNEY_PATH to find Chutney.Linus Nordberg
2013-06-13Add make target test-network running traffic tests in a Chutney network.Linus Nordberg
This implements ticket #8530.
2013-06-12Fix #9043 - simplyfy the code and use EVP_PKEY_cmp instead of pkey_eq / ↵Marek Majkowski
tor_tls_evp_pkey_eq
2013-06-12Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-06-12Expand microdesc cache testsNick Mathewson
Is it possible that *every* attempt to replace the microdesc cache on windows 7 is going to fail because of our lack of FILE_SHARE_DELETE while opening the file? If so, this test will catch #2077 and let us know when it's fixed.
2013-06-10Fix "make check-spaces"Nick Mathewson
2013-06-10Bug #5170 - make pkey_eq testable, introduce test_tortls.cMarek Majkowski
2013-06-10Bug #5170 - test crypto_pk_get_all_digestsMarek Majkowski
2013-05-29Fix windows compilation warning in test_config.cNick Mathewson
bugfix on 78cc5833a1da038331186ddf07f4add7f8f1094b; bug not in any released Tor. Spotted by weasel using Jenkins.
2013-05-24Tweak 4282 unit tests for style, safety, correctness.Nick Mathewson
We do our filesystem wrangling relative to get_fname() results, so that if we fail or crash, we can always clean up.
2013-05-24Unit tests for check_or_create_data_subdir and write_to_data_subdir.Peter Retzlaff
2013-05-17Remove PK_PKCS1_PADDINGArlo Breault
See #8792
2013-05-15Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-05-15Fix unit tests to pass after fix for #8879Nick Mathewson
2013-05-11Remove strcpy from unit tests.Arlo Breault
See #8790.
2013-05-10Merge branch 'maint-0.2.4'Andrea Shepard
2013-05-10Merge bug5595-v2-squashed into maint-0.2.4Andrea Shepard
2013-05-09Add some unit tests for fp_pair_map_t to test/containers.c based on the ↵Andrea Shepard
strmap tests