From 5eadcae2d578fd4d1c27cf664cc9f02c3f74c45b Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Wed, 1 Jan 2020 12:38:02 +0100 Subject: [PATCH] Move factorial check from test section to exam section... ...since it has no randomness and no iterations, cf. tests/FILES. --- tests/Makefile.am | 7 +++---- tests/exam.cc | 4 ++++ tests/{test_I_factorial.cc => exam_I_factorial.cc} | 4 ++-- tests/test_I.cc | 4 ---- 4 files changed, 9 insertions(+), 10 deletions(-) rename tests/{test_I_factorial.cc => exam_I_factorial.cc} (73%) diff --git a/tests/Makefile.am b/tests/Makefile.am index 57c0777..dc8beb0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -60,8 +60,8 @@ exam_SOURCES = exam.h exam.cc \ exam_DF_div.cc exam_DF_floor.cc \ exam_LF.cc exam_LF_plus.cc exam_LF_minus.cc exam_LF_mul.cc \ exam_LF_div.cc exam_LF_floor.cc \ - exam_I_gcd.cc exam_I_sqrtp.cc test_MI.h test.h - + exam_I_gcd.cc exam_I_sqrtp.cc exam_I_factorial.cc test_MI.h test.h + exam_LDADD = ../src/libcln.la tests_SOURCES = test.h tests.cc test_I.cc test_I.h test_I_abs.cc test_I_compare.cc \ @@ -78,12 +78,11 @@ tests_SOURCES = test.h tests.cc test_I.cc test_I.h test_I_abs.cc test_I_compare. test_I_logcount.cc test_I_ilength.cc test_I_ord2.cc \ test_I_power2p.cc test_I_isqrt.cc test_I_sqrtp.cc \ test_I_io.cc test_I_GV.cc \ - test_I_factorial.cc \ test_MI.h test_MI.cc test_MI_canonhom.cc test_MI_plus.cc \ test_MI_minus.cc test_MI_mul.cc test_MI_recip.cc \ test_MI_div.cc test_MI_expt.cc \ test_nt.h test_nt.cc test_nt_jacobi.cc - + tests_LDADD = ../src/libcln.la timemul_SOURCES = timemul.cc diff --git a/tests/exam.cc b/tests/exam.cc index ca1be02..1b4cfe6 100644 --- a/tests/exam.cc +++ b/tests/exam.cc @@ -11,6 +11,8 @@ extern int test_sfloat(); extern int test_ffloat(); extern int test_dfloat(); extern int test_lfloat(); +extern int test_factorial(); +extern int test_doublefactorial(); int test_elementary (void) { @@ -35,6 +37,8 @@ int test_all (void) error |= test_gcd(); error |= test_xgcd(); error |= test_sqrtp(); + error |= test_factorial(); + error |= test_doublefactorial(); return error; } diff --git a/tests/test_I_factorial.cc b/tests/exam_I_factorial.cc similarity index 73% rename from tests/test_I_factorial.cc rename to tests/exam_I_factorial.cc index bae2513..d85629a 100644 --- a/tests/test_I_factorial.cc +++ b/tests/exam_I_factorial.cc @@ -1,13 +1,13 @@ #include "test_I.h" -int test_I_factorial(int /* iterations */) { +int test_factorial() { int error = 0; cl_I result = factorial(14U); ASSERT1(result > cl_I(UINT64_C(1) << 32), result); return error; } -int test_I_doublefactorial(int /* iterations */) { +int test_doublefactorial() { int error = 0; cl_I result = doublefactorial(21U); ASSERT1(result > cl_I(UINT64_C(1) << 32), result); diff --git a/tests/test_I.cc b/tests/test_I.cc index 5338a31..8e5ea63 100644 --- a/tests/test_I.cc +++ b/tests/test_I.cc @@ -45,8 +45,6 @@ extern int test_I_sqrtp (int iterations); // Miscellaneous. extern int test_I_io (int iterations); extern int test_I_GV (int iterations); -extern int test_I_factorial(int iterations); -extern int test_I_doublefactorial(int iterations); #define RUN(tester,iterations) \ std::cout << "Testing "#tester"..." << std::endl; \ @@ -101,7 +99,5 @@ int test_I (int iterations) // Miscellaneous. RUN(test_I_io,iterations); RUN(test_I_GV,iterations); - RUN(test_I_factorial, iterations); - RUN(test_I_doublefactorial, iterations); return error; } -- 2.49.0