summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2011-12-02Appease check-spacesSebastian Hahn
2011-11-30Add an initializer to appease older gccNick Mathewson
2011-11-30Merge branch 'bug933_nm_rebased_v2'Nick Mathewson
Conflicts: src/test/test.c
2011-11-30No new "LEGACY" tests allowed.Nick Mathewson
2011-11-30Fix compilation: get_options() now returns constNick Mathewson
2011-11-30Address nickm's comments at ↵Robert Hogan
https://trac.torproject.org/projects/tor/ticket/933#comment:8 1. Only allow '*.' in MapAddress expressions. Ignore '*ample.com' and '.example.com'. This has resulted in a slight refactoring of config_register_addressmaps. 2. Add some more detail to the man page entry for AddressMap. 3. Fix initialization of a pointer to NULL rather than 0. 4. Update the unit tests to cater for the changes in 1 and test more explicitly for recursive mapping.
2011-11-30Address nickm's comments at ↵Robert Hogan
https://trac.torproject.org/projects/tor/ticket/933#comment:4 1. Implement the following mapping rules: MapAddress a.b.c d.e.f # This is what we have now MapAddress .a.b.c d.e.f # Replaces any address ending with .a.b.c with d.e.f MapAddress .a.b.c .d.e.f # Replaces the .a.b.c at the end of any addr with .d.e.f (Note that 'a.b.c .d.e.f' is invalid, and will be rejected.) 2. Add tests for the new rules. 3. Allow proper wildcard annotation, i.e. '*.d.e' '.d.e' will still work. 4. Update addressmap_entry_t with an is_wildcard member.
2011-11-30bug933 - Match against super-domains in MapAddressRobert Hogan
Allow MapAddress to handle directives such as: MapAddress .torproject.org .torserver.exit MapAddress .org 1.1.1.1 Add tests for addressmap_rewrite.
2011-11-30Resolve a resource leak in test_util_split_linesNick Mathewson
Fixes coverity CID # 488
2011-11-30Initial support for simplest use of prop186 or-address linesNick Mathewson
This lets a routerinfo_t have a single IPv6 or-address, and adds support for formatting and parsing those lines.
2011-11-29Make unit tests run again. Fix bug 4606.Nick Mathewson
2011-11-27Implement consensus method 12 (proposal 178)Sebastian Hahn
2011-11-25Make the pt/transports test not crash.Nick Mathewson
2011-11-25Make process_handle_t private and fix some unit testsNick Mathewson
Let's *not* expose more cross-platform-compatibility structures, or expect code to use them right. Also, don't fclose() stdout_handle and stdin_handle until we do tor_process_handle_destroy, or we risk a double-fclose.
2011-11-25Make AES unit tests cover the AES and the EVP case.Nick Mathewson
2011-11-19Imporved unit test coverage for tor_inet_ptonAnders Sundman
2011-11-18Merge remote-tracking branch 'public/benchmark'Nick Mathewson
2011-11-14Merge remote-tracking branch '4ZM/topic/test/4433_address'Nick Mathewson
2011-11-11Fix test_util.c compilation on MSVCGisle Vanem
"Those '{}' constructs are not well liked by MSVC (cl v.16.xx)." Received on tor-dev; fixes bug on 0.2.3.3-alpha.
2011-11-11All-in-one benchmark test for cell cryptoNick Mathewson
2011-11-11Convert bench_dmap to produce reasonable output.Nick Mathewson
2011-11-11New src/test/bench.c to allow us to actually _run_ benchmark codeNick Mathewson
Yes, the timing functions are suboptimal. Please improve!
2011-11-11Fix the bench_{aes,dmap} test functions to work with TTSebastian Hahn
TT expects them to be named test_bench_{aes,dmap}. Also change the DISABLED macro to reflect that.
2011-11-11Merge remote-tracking branch '4ZM/topic/test/4434_address'Nick Mathewson
2011-11-11Unit tests for tor_addr_to_strAnders Sundman
2011-11-11Unit tests for tor_addr_to_PTR_nameAnders Sundman
2011-11-11Unit tests for tor_inet_ntopAnders Sundman
2011-11-10Unit tests for eat_whitespace functionsAnders Sundman
2011-11-10Unit test for n_bits_set funcAnders Sundman
2011-11-10Unit test for hex_str funcAnders Sundman
Note: Too long input is undefined by contract. That behaviour should not be asserted in test.
2011-10-11Change "reverse_lookup_name" functions to refer to "PTR_name"sNick Mathewson
Under the new convention, having a tor_addr.*lookup function that doesn't do hostname resolution is too close for comfort. I used this script here, and have made no other changes. s/tor_addr_parse_reverse_lookup_name/tor_addr_parse_PTR_name/g; s/tor_addr_to_reverse_lookup_name/tor_addr_to_PTR_name/g;
2011-10-11Fix names of functions that convert strings to addrsNick Mathewson
Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed.
2011-10-10Add a sha256 hmac function, with testsNick Mathewson
2011-10-07Merge remote-tracking branch 'public/bug2003_nm'Nick Mathewson
2011-10-07Merge remote-tracking branch 'asn2/bug3656'Nick Mathewson
Conflicts: src/common/util.c src/common/util.h src/or/config.h src/or/main.c src/test/test_util.c
2011-10-07Revive our beautiful unit tests.George Kadianakis
They broke when the PT_PROTO_INFANT proxy state was added.
2011-09-09Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: configure.in src/or/circuitbuild.c
2011-09-07Make the unit tests pass again after the bug2003 fixNick Mathewson
2011-09-01Handle test case where fgets() sees EOF on the last readSteven Murdoch
On some platforms, with non-blocking IO, on EOF you first get EAGAIN, and then on the second read you get zero bytes and EOF is set. However on others, the EOF flag is set as soon as the last byte is read. This patch fixes the test case in the latter scenario.
2011-09-01Fix double-closing a stdio streamSteven Murdoch
After a stream reached eof, we fclose it, but then test_util_spawn_background_partial_read() reads from it again, which causes an error and thus another fclose(). Some platforms are fine with this, others (e.g. debian-sid-i386) trigger a double-free() error. The actual code used by Tor (log_from_pipe() and tor_check_port_forwarding()) handle this case correctly.
2011-08-31Tweaks on last process-launch patchesNick Mathewson
2011-09-01Make a version of tor_read_all_handle() for non-Windows platformsSteven Murdoch
Mainly used for testing reading from subprocesses. To be more generic we now pass in a pointer to a process_handle_t rather than a Windows- specific HANDLE.
2011-08-31Fix off-by-one error when allocating memory in test_util_split_lines()Steven Murdoch
Triggered "failed OVER picket-fence magic-number check (err 27)" when memory debugging using dmalloc is enabled (at 'low' or higher).
2011-08-30Use %f with printf-style formatting, not %lfNick Mathewson
For printf, %f and %lf are synonymous, since floats are promoted to doubles when passed as varargs. It's only for scanf that we need to say "%lf" for doubles and "%f" for floats. Apparenly, some older compilers think it's naughty to say %lf and like to spew warnings about it. Found by grarpamp.
2011-08-30Rename tor_join_cmdline to tor_join_win_cmdline; tweak doxygenNick Mathewson
2011-08-30Factor out and re-write code for splitting lines from a handleSteven Murdoch
Now handles non-printable characters and will not output a spurious new-line if given a partial line.
2011-08-29Refactor out command line formattingSteven Murdoch
Now correctly handles whitespace, quotes and backslashes. Passes all unit tests.
2011-08-29Replace two magic tristates with #define'd namesSteven Murdoch
- process_handle_t.status - return value of tor_get_exit_code()
2011-08-28Make signature of tor_spawn_background more conventionalSteven Murdoch
Conventionally in Tor, structs are returned as pointers, so change tor_spawn_background() to return the process handle in a pointer rather than as return value.
2011-08-24Appease "make check-spaces"Steven Murdoch