Commit Graph

293 Commits

Author SHA1 Message Date
Esteban Manchado Velázquez fa4ca5ddc1 Add test for broken escapes in parse_config_... 2012-03-08 21:16:45 -05:00
Esteban Manchado Velázquez 8bb68011f0 Add some unit tests for parse_iso_time 2012-03-08 21:16:45 -05:00
Esteban Manchado Velázquez c097401879 Add tests for string_is_C_identifier 2012-03-08 21:16:45 -05:00
Esteban Manchado Velázquez 1f6e3ec500 Improve coverage in string-related unit tests 2012-03-08 21:16:45 -05:00
Esteban Manchado Velázquez 03258529d8 Improve coverage in time-related unit tests 2012-03-08 21:16:45 -05:00
Esteban Manchado Velázquez a3679d30c0 Remove unreliable assertion
* This assertion fails when executing the whole suite, but not when executing
  this test by itself
* Ideally I'd prefer starting with a guaranteed empty directory, but it's not
  very important in this case as non-existence of other paths is being checked
  explicitly
2012-03-08 20:49:26 -05:00
Esteban Manchado Velázquez 8d62e42fd3 Add extra tests for wrap_string 2012-03-08 20:49:26 -05:00
Esteban Manchado Velázquez 9ae7d511f4 Add extra tests for get_parent_directory 2012-03-08 20:49:26 -05:00
Esteban Manchado Velázquez fa1d6f812c Tweak test case text so it's clearer 2012-03-08 20:49:26 -05:00
Esteban Manchado Velázquez 4beebea698 Improve eat_whitespace* unit tests 2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez 3e4a977781 Put expected first in n_bits_set_u8 unit tests 2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez afb89b83f2 Improve tor_split_lines unit tests
* Add some more test cases
* Switch to test_assert et al
2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez 699af29bae Use test_streq in join_win_cmdline unit tests 2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez 7b8a7556a8 Use test_eq et al in spawn_background unit tests 2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez 6b3854f8a3 Use test_streq in format_helper_exit_status tests 2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez 22a915bcd2 Improve get_parent_directory unit tests
* Add more test cases to the get_parent_directory tests
* Switch the parameter order so that the expected value is the first one
2012-03-08 20:49:25 -05:00
Esteban Manchado Velázquez 275b81ec5d Improve listdir unit tests 2012-03-08 20:49:24 -05:00
Esteban Manchado Velázquez 667f30e465 Improve a bit asprintf unit tests 2012-03-08 20:49:24 -05:00
Esteban Manchado Velázquez 781c6676ca Rewrite the find_str_at_start_of_line unit tests 2012-03-08 20:49:24 -05:00
Esteban Manchado Velázquez 667f5ea409 Improve/extend strtok_r unit tests
* Add several failing tests (embedded in an "#if 0" block) for behaviour that
  doesn't match strtok_r
* Add another, passing, more interesting test
* Use test_eq_ptr(NULL, ...) instead of test_assert(NULL == ...)
2012-03-08 20:49:24 -05:00
Esteban Manchado Velázquez ee317256bb Improve tor_sscanf tests
* Add many new test cases, tweak/improve existing ones, reorganize them a bit
* Switch the parameters in all test_eq calls so the expected value is the first
* Change all the "r = tor_sscanf(...);\ntest_eq(1, r)" to the more compact
  "test_eq(1, tor_sscanf(...))". It may be a tiny bit harder to find the
  tor_sscanf calls (it's the long lines anyway), but it saves a lot of lines,
  which should help readability.
2012-03-08 20:49:24 -05:00
Esteban Manchado Velázquez 4e44024ced Improve test case for read_escaped_data unit test 2012-03-08 20:49:23 -05:00
Esteban Manchado Velázquez 3c5a3b33e8 Trivial readability changes in mmap unit tests 2012-03-08 20:49:23 -05:00
Esteban Manchado Velázquez f90406cb01 Clean up and improve gzip unit tests
* Switch some test_eq parameters so the expected is always the first parameter
* Drop some manual checks of compressed format magic numbers (they're pointless
  and they make the unit tests less readable and more fragile, considering
  we're already indirectly checking those magic numbers via the
  detect_compression_method function)
* Add a couple of extra assertions
2012-03-08 20:49:23 -05:00
Esteban Manchado Velázquez f4242d2e4a Add/improve the rest of the strmisc tests 2012-03-08 20:49:23 -05:00
Esteban Manchado Velázquez 14177f03a9 Improve tor_snprintf tests 2012-03-08 20:49:18 -05:00
Esteban Manchado Velázquez 314c851bc2 Add/improve tests for str{,case}cmp{start,end} 2012-03-08 20:49:18 -05:00
Esteban Manchado Velázquez f11be57860 Add more/better tests in test_util_strmisc 2012-03-08 20:49:18 -05:00
Esteban Manchado Velázquez 73d9868232 Trivial cosmetic fix in test comments 2012-03-08 20:49:18 -05:00
Esteban Manchado Velázquez ab39382cf8 Organize test_util_time in blocks
* Separate the tests for different functions with a comment
* Move some test init code further down, closer to where it was actually being
  used
2012-03-08 20:49:18 -05:00
Esteban Manchado Velázquez f81af6d791 Add test for comments in the config parser 2012-03-08 20:49:17 -05:00
Esteban Manchado Velázquez 5a206dbb7a Remove duplicated macro definition 2012-03-08 20:49:17 -05:00
Esteban Manchado Velázquez f9ad35c361 Add test for broken hex parsing
* The test currently fails, but it's commented out (with an "#if 0")
* As a broken octal actually gives a parse error, it seems fair that this
  fails, too
2012-03-08 20:49:17 -05:00
Esteban Manchado Velázquez 72d455b5eb Improve config parser escaped content tests 2012-03-08 20:49:17 -05:00
Esteban Manchado Velázquez 4d9dda9bb9 Add tests for escaped content in config 2012-03-08 20:49:17 -05:00
Esteban Manchado Velázquez 57a4e07665 Add quoted content tests for the config parser 2012-03-08 20:49:16 -05:00
Patrick Mézard 857ae345c8 Fix off-by-one error in test_util_make_environment 2012-02-20 14:12:50 +01:00
Nick Mathewson eaedcba493 Merge branch 'bug5105-v2-squashed'
Conflicts:
	src/or/transports.c
2012-02-17 11:50:10 -05:00
Robert Ransom 773290c09a Add unit tests for easily tested, non-trivial utility functions 2012-02-17 11:42:21 -05:00
Nick Mathewson 8cae9c53b7 Oops; there were a couple of typos in the upstream tinytest 2012-02-13 17:48:43 -05:00
Nick Mathewson 9efee31fae Synchronize with upstream tinytest again: remove _identifiers 2012-02-13 17:45:15 -05:00
Nick Mathewson 3b47a11654 Synchronize with upstream tinytest.
The big change here is a patch (first added to Libevent by Ed Day)
to make sure that the CreateProcess forked-test trick works even
when the main test program is invoked without its .exe suffix.
2012-02-13 17:29:31 -05:00
Nick Mathewson 5cf9167f91 Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32
This commit is completely mechanical; I used this perl script to make it:

 #!/usr/bin/perl -w -i.bak -p

 if (/^\s*\#/) {
     s/MS_WINDOWS/_WIN32/g;
     s/\bWIN32\b/_WIN32/g;
 }
2012-01-31 15:48:47 -05:00
Nick Mathewson 26e789fbfd Rename nonconformant identifiers.
Fixes bug 4893.

These changes are pure mechanical, and were generated with this
perl script:

  /usr/bin/perl -w -i.bak -p

  s/crypto_pk_env_t/crypto_pk_t/g;
  s/crypto_dh_env_t/crypto_dh_t/g;
  s/crypto_cipher_env_t/crypto_cipher_t/g;
  s/crypto_digest_env_t/crypto_digest_t/g;

  s/aes_free_cipher/aes_cipher_free/g;
  s/crypto_free_cipher_env/crypto_cipher_free/g;
  s/crypto_free_digest_env/crypto_digest_free/g;
  s/crypto_free_pk_env/crypto_pk_free/g;

  s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g;
  s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g;
  s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g;
  s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g;

  s/crypto_new_cipher_env/crypto_cipher_new/g;
  s/crypto_new_digest_env/crypto_digest_new/g;
  s/crypto_new_digest256_env/crypto_digest256_new/g;
  s/crypto_new_pk_env/crypto_pk_new/g;

  s/crypto_create_crypto_env/crypto_cipher_new/g;

  s/connection_create_listener/connection_listener_new/g;
  s/smartlist_create/smartlist_new/g;
  s/transport_create/transport_new/g;
2012-01-18 15:53:30 -05:00
Nick Mathewson f729e1e984 Merge branch 'feature3457-v4-nm-squashed'
Conflicts:
	src/or/rendclient.c
2012-01-11 12:10:14 -05:00
Nick Mathewson b5af456685 Use spaceless ISO8601 time format, not sec,usec. 2012-01-11 12:08:01 -05:00
Nick Mathewson d29a390733 Test for broken counter-mode at runtime
To solve bug 4779, we want to avoid OpenSSL 1.0.0's counter mode.
But Fedora (and maybe others) lie about the actual OpenSSL version,
so we can't trust the header to tell us if it's safe.

Instead, let's do a run-time test to see whether it's safe, and if
not, use our built-in version.

fermenthor contributed a pretty essential fixup to this patch. Thanks!
2012-01-10 11:15:35 -05:00
Roger Dingledine ecdea4eeaf Merge branch 'maint-0.2.2' 2012-01-08 12:17:16 -05:00
Roger Dingledine 78e95b7b71 tell me who votes are actually for, not just where they're from 2012-01-08 10:03:46 -05:00
Nick Mathewson aa529f6c32 Use getifaddrs, not connect+getsockname, to find our address
This resolves bug1827, and lets us avoid freaking people out.
Later, we can use it to get a complete list of our interfaces.
2011-12-28 16:34:16 -05:00