From a673fbfc636e8e867a691a99b7b457f63be14899 Mon Sep 17 00:00:00 2001 From: Mike Hamburg Date: Wed, 2 Mar 2016 11:43:17 -0800 Subject: [PATCH] test_ct broke because of renaming; fix it --- Makefile | 1 + test/test_ct.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 894274e..5d849fc 100644 --- a/Makefile +++ b/Makefile @@ -321,6 +321,7 @@ test: $(BUILD_IBIN)/test ./$< test_ct: $(BUILD_IBIN)/test_ct + # NB: you must compile with XCFLAGS=-DNDEBUG or you will get lots of extra warnings. valgrind ./$< microbench: $(BUILD_IBIN)/bench diff --git a/test/test_ct.cxx b/test/test_ct.cxx index 4989a87..46595ea 100644 --- a/test/test_ct.cxx +++ b/test/test_ct.cxx @@ -23,7 +23,7 @@ static const long NTESTS = 10; const char *undef_str = "Valgrind thinks this string is undefined."; const Block undef_block(undef_str); -static inline void ignore(decaf_error_t x) { +static inline void ignore_result(decaf_error_t x) { (void)x; } @@ -44,7 +44,7 @@ static void test_arithmetic() { (void)(x+y); (void)(x-y); (void)(x*y); - ignore(x.inverse_noexcept(y)); + ignore_result(x.inverse_noexcept(y)); (void)(x==y); (void)(z=y); x.serialize_into(ser); @@ -61,7 +61,7 @@ static void test_elligator() { for (int i=0; i(ser))); + ignore_result(p.decode(FixedBlock(ser))); (void)(p*y); (void)(p+q); (void)(p-q); @@ -101,7 +101,7 @@ static void test_cfrg() { FixedArrayBuffer priv(rng); Group::DhLadder::generate_key(priv); - ignore(Group::DhLadder::shared_secret_noexcept(pub,pub,priv)); + ignore_result(Group::DhLadder::shared_secret_noexcept(pub,pub,priv)); } } @@ -126,10 +126,10 @@ static void test_crypto() { #if DECAF_CRYPTO_SHARED_SECRET_SHORT_CIRUIT PrivateKey sk2(defrng); - (void)sk1.shared_secretNoexcept(shared,sk2.pub(),i&1); + ignore_result(sk1.shared_secret_noexcept(shared,sk2.pub(),i&1)); #else PrivateKey sk3(rng); - (void)sk1.shared_secretNoexcept(shared,sk3.pub(),i&1); + ignore_result(sk1.shared_secret_noexcept(shared,sk3.pub(),i&1)); #endif } }