diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-02 14:32:05 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-02 14:32:05 -0400 |
commit | 4458fd0cd8fa259f0ee8195e1aa86d5b7c6f8919 (patch) | |
tree | b7b8886da56232e92a0438edd2a869f6964141a4 /src/test/test_crypto.c | |
parent | 1bfda600c338cd8f7d6b9acc7613b5567e6ee03f (diff) | |
download | tor-4458fd0cd8fa259f0ee8195e1aa86d5b7c6f8919.tar.gz tor-4458fd0cd8fa259f0ee8195e1aa86d5b7c6f8919.zip |
In the unit tests, use "test_eq_ptr" and "test_neq_ptr" consistently
This is part of what's needed to build without warnings on mingw64:
it was warning about the cast from void* to long that happened in
the places we were using test_{n,}eq on pointers.
The alternative here would have been to broaden tt_int_op to accept
a long long or an intptr_t, but that's less correct (since pointers
aren't integers), and would hurt the portability of tinytest a
little.
Fixes part of 7260.
Diffstat (limited to 'src/test/test_crypto.c')
-rw-r--r-- | src/test/test_crypto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index fd983de002..ed1da39670 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -119,9 +119,9 @@ test_crypto_aes(void *arg) memset(data2, 0, 1024); memset(data3, 0, 1024); env1 = crypto_cipher_new(NULL); - test_neq(env1, 0); + test_neq_ptr(env1, 0); env2 = crypto_cipher_new(crypto_cipher_get_key(env1)); - test_neq(env2, 0); + test_neq_ptr(env2, 0); /* Try encrypting 512 chars. */ crypto_cipher_encrypt(env1, data2, data1, 512); @@ -152,7 +152,7 @@ test_crypto_aes(void *arg) memset(data3, 0, 1024); env2 = crypto_cipher_new(crypto_cipher_get_key(env1)); - test_neq(env2, 0); + test_neq_ptr(env2, NULL); for (j = 0; j < 1024-16; j += 17) { crypto_cipher_encrypt(env2, data3+j, data1+j, 17); } |