diff options
author | Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com> | 2019-09-27 09:14:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-27 09:14:27 +0200 |
commit | b2c87c0d04cb165bca1e078c31a96dff2e127ba8 (patch) | |
tree | 80669480a5730c7d83de5dcd927363e27a4e5640 /test.c | |
parent | Merge pull request #24 from altendky/separate_test_and_main (diff) | |
parent | Initialize any_failed (diff) | |
download | siphash-b2c87c0d04cb165bca1e078c31a96dff2e127ba8.tar.gz siphash-b2c87c0d04cb165bca1e078c31a96dff2e127ba8.tar.xz |
Merge pull request #23 from altendky/return_for_test_failed
Return non-zero when tests fail
Diffstat (limited to '')
-rw-r--r-- | test.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -13,6 +13,7 @@ */ #include "vectors.h" +#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <string.h> @@ -46,6 +47,7 @@ size_t lengths[4] = {8, 16, 4, 8}; int siphash_test() { uint8_t in[64], out[16], k[16]; int i; + bool any_failed = false; #ifndef GETVECTORS int fails = 0; #endif @@ -91,6 +93,7 @@ int siphash_test() { if (memcmp(out, v + (i * len), len)) { printf("fail for %d bytes\n", i); fails++; + any_failed = true; } #endif } @@ -105,5 +108,5 @@ int siphash_test() { #endif } - return 0; + return any_failed; } |