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
Nick Mathewson
a5704b1c62
Add a sha256 hmac function, with tests
...
(cherry picked from commit fdbb9cdf74
)
2012-02-22 05:46:08 -08: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
Karsten Loesing
4aca55efd2
Count IPv6 connections in bridge and entry stats.
2012-02-09 11:12:30 +01: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
Nick Mathewson
e535c8a460
Tweak the haiku-support patches
2011-12-19 11:27:08 -05:00
Martin Hebnes Pedersen
f783a326b8
-lm should not be hardcoded.
...
On some platforms (Haiku/BeOS) libm lives in libcore.
Also added 'network' to the list of libraries to search for connect().
2011-12-19 11:27:08 -05:00
Peter Palfrader
f6b19ac79c
test_util_spawn_background_ok: fix expectation
...
test_util_spawn_background_ok() hardcoded the expected value
for ENOENT to 2. This isn't portable as error numbers are
platform specific, and particularly the hurd has ENOENT at
0x40000002.
Construct expected string at runtime, using the correct value
for ENOENT (closes : #4733 ).
2011-12-17 12:21:51 -05:00
Sebastian Hahn
c811b8f3a0
Appease check-spaces
2011-12-02 06:16:57 +01:00