From 43c25a343b05c5f6b451b0976976b86c604e04cd Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 7 Dec 2015 09:43:34 +0100 Subject: [PATCH] Reduce box8 even more --- test/default/box8.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/default/box8.c b/test/default/box8.c index d03d4666..ea00da51 100644 --- a/test/default/box8.c +++ b/test/default/box8.c @@ -16,7 +16,7 @@ int main(void) size_t mlen; size_t mlen_max = 600; size_t i; - int caught; + int faults; int ret; m = sodium_malloc(mlen_max); @@ -29,8 +29,12 @@ int main(void) randombytes_buf(m + crypto_box_ZEROBYTES, mlen); ret = crypto_box(c, m, mlen + crypto_box_ZEROBYTES, n, bobpk, alicesk); assert(ret == 0); - caught = 0; - while (caught < 10) { +#ifdef BROWSER_TESTS + faults = 1; +#else + faults = 5; +#endif + while (faults > 0) { c[rand() % (mlen + crypto_box_ZEROBYTES)] = rand(); if (crypto_box_open(m2, c, mlen + crypto_box_ZEROBYTES, n, alicepk, bobsk) == 0) { @@ -41,7 +45,7 @@ int main(void) } } } else { - caught++; + faults--; } } }