diff options
author | Adam Langley <agl@chromium.org> | 2014-06-25 03:28:24 +0400 |
---|---|---|
committer | Adam Langley <agl@chromium.org> | 2014-06-25 04:00:54 +0400 |
commit | d54dc249ead32282d4d1d5588a24822752d92a51 (patch) | |
tree | 23cd61419f5edf42902fc2d2d882cba940167c4a /crypto | |
parent | 54cdd120aa654b5eb0647e44bdcd94d2275f8761 (diff) |
Run AEAD test cases at the end of a file.
aead_test reads test vectors from a file but used blank lines to
indicate the end of a test case. If the file ended without a blank line
to terminate the final test case, it would previously have been skipped.
Change-Id: Id8dd34e86f0b912596dfb33234a894f8d9aa0235
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/cipher/aead_test.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/crypto/cipher/aead_test.c b/crypto/cipher/aead_test.c index 0e934cd1..7e401475 100644 --- a/crypto/cipher/aead_test.c +++ b/crypto/cipher/aead_test.c @@ -171,7 +171,7 @@ int main(int argc, char **argv) { unsigned int *buf_len = NULL; if (!fgets(line, sizeof(line), f)) { - break; + line[0] = 0; } line_no++; @@ -189,19 +189,21 @@ int main(int argc, char **argv) { } } - if (!any_values_set) { - continue; - } + if (any_values_set) { + if (!run_test_case(aead, bufs, lengths, line_no)) { + return 4; + } - if (!run_test_case(aead, bufs, lengths, line_no)) { - return 4; - } + for (j = 0; j < NUM_TYPES; j++) { + lengths[j] = 0; + } - for (j = 0; j < NUM_TYPES; j++) { - lengths[j] = 0; + num_tests++; } - num_tests++; + if (line[0] == 0) { + break; + } continue; } |