From 7ada62b1ff433551a72acc66a8dc360c02b46882 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 7 Dec 2015 08:58:35 +0100 Subject: [PATCH] Reduce some test cases, generate html test files --- dist-build/emscripten.sh | 9 ++++++--- test/default/box_easy2.c | 2 +- test/default/onetimeauth7.c | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index 9e600cd6..be3739cc 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -51,10 +51,13 @@ if [ "x$BROWSER_TESTS" != "x" ]; then ( cd test/default && \ mkdir -p browser && \ + rm -f browser/tests.txt && \ for file in *.js; do - fgrep -v "#! /usr/bin/env {NODE}" "$file" > "browser/${file}.tmp" - chmod -x "browser/${file}.tmp" - mv -f "browser/${file}.tmp" "browser/${file}" + fgrep -v "#! /usr/bin/env {NODE}" "$file" > "browser/${file}" + tname=$(echo "$file" | sed 's/.js$//') + cp -f "${tname}.exp" "browser/${tname}.exp" + sed "s/{{tname}}/${tname}/" index.html.tpl > "browser/${tname}.html" + echo "${tname}.html" >> "browser/tests.txt" done ) else diff --git a/test/default/box_easy2.c b/test/default/box_easy2.c index 71fe5ead..9293d783 100644 --- a/test/default/box_easy2.c +++ b/test/default/box_easy2.c @@ -22,7 +22,7 @@ int main(void) size_t c_size; int ret; - m2_size = m_size = 1U + randombytes_uniform(10000); + m2_size = m_size = 1U + randombytes_uniform(1000); c_size = crypto_box_MACBYTES + m_size; m = (unsigned char *) sodium_malloc(m_size); m2 = (unsigned char *) sodium_malloc(m2_size); diff --git a/test/default/onetimeauth7.c b/test/default/onetimeauth7.c index 6c193fe1..a999482c 100644 --- a/test/default/onetimeauth7.c +++ b/test/default/onetimeauth7.c @@ -3,14 +3,14 @@ #include "cmptest.h" static unsigned char key[32]; -static unsigned char c[10000]; +static unsigned char c[1000]; static unsigned char a[16]; int main(void) { int clen; - for (clen = 0; clen < 10000; ++clen) { + for (clen = 0; clen < 1000; ++clen) { randombytes_buf(key, sizeof key); randombytes_buf(c, clen); crypto_onetimeauth(a, c, clen, key);