diff options
author | Pauli <paul.dale@oracle.com> | 2017-03-22 14:27:55 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2017-03-29 08:51:43 +1000 |
commit | 2fae041d6c507315a619e2f29bff86e44cc1d0a1 (patch) | |
tree | 916c82cafe8b198da5ca777b29ea4fab3f036f5b /test/poly1305_internal_test.c | |
parent | a6ac1ed686346d2164c16446624c973e51d3ae92 (diff) | |
download | openssl-2fae041d6c507315a619e2f29bff86e44cc1d0a1.zip openssl-2fae041d6c507315a619e2f29bff86e44cc1d0a1.tar.gz openssl-2fae041d6c507315a619e2f29bff86e44cc1d0a1.tar.bz2 |
Test infrastructure additions.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3011)
Diffstat (limited to 'test/poly1305_internal_test.c')
-rw-r--r-- | test/poly1305_internal_test.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/poly1305_internal_test.c b/test/poly1305_internal_test.c index 547c2fd..af54ac3 100644 --- a/test/poly1305_internal_test.c +++ b/test/poly1305_internal_test.c @@ -1565,14 +1565,14 @@ static int test_poly1305(int idx) size_t expectedlen = test.expected.size; unsigned char out[16]; - if (expectedlen != sizeof(out)) + if (!TEST_size_t_eq(expectedlen, sizeof(out))) return 0; Poly1305_Init(&poly1305, key); Poly1305_Update(&poly1305, in, inlen); Poly1305_Final(&poly1305, out); - if (memcmp(out, expected, expectedlen) != 0) { + if (!TEST_mem_eq(out, expectedlen, expected, expectedlen)) { fprintf(stderr, "Poly1305 test #%d failed.\n", idx); fprintf(stderr, "got: "); hexdump(out, sizeof(out)); @@ -1588,7 +1588,7 @@ static int test_poly1305(int idx) Poly1305_Update(&poly1305, in+1, inlen-1); Poly1305_Final(&poly1305, out); - if (memcmp(out, expected, expectedlen) != 0) { + if (!TEST_mem_eq(out, expectedlen, expected, expectedlen)) { fprintf(stderr, "Poly1305 test #%d/1+(N-1) failed.\n", idx); fprintf(stderr, "got: "); hexdump(out, sizeof(out)); @@ -1607,7 +1607,7 @@ static int test_poly1305(int idx) Poly1305_Update(&poly1305, in+half, inlen-half); Poly1305_Final(&poly1305, out); - if (memcmp(out, expected, expectedlen) != 0) { + if (!TEST_mem_eq(out, expectedlen, expected, expectedlen)) { fprintf(stderr, "Poly1305 test #%d/2 failed.\n", idx); fprintf(stderr, "got: "); hexdump(out, sizeof(out)); @@ -1623,7 +1623,7 @@ static int test_poly1305(int idx) Poly1305_Update(&poly1305, in+half, inlen-half); Poly1305_Final(&poly1305, out); - if (memcmp(out, expected, expectedlen) != 0) { + if (!TEST_mem_eq(out, expectedlen, expected, expectedlen)) { fprintf(stderr, "Poly1305 test #%d/%" OSSLzu "+%" OSSLzu " failed.\n", idx, half, inlen-half); fprintf(stderr, "got: "); |