From 62512316b1e35e99436b93c6ca701ee10a75b95d Mon Sep 17 00:00:00 2001 From: Keith O'Hara Date: Thu, 20 Jan 2022 21:00:53 -0500 Subject: [PATCH] update tests --- tests/erf.cpp | 10 +++++++--- tests/erf_inv.cpp | 2 ++ tests/incomplete_gamma.cpp | 2 ++ tests/log.cpp | 2 ++ tests/log10.cpp | 2 ++ tests/log2.cpp | 2 ++ tests/signbit.cpp | 2 -- 7 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/erf.cpp b/tests/erf.cpp index e9eb0a9..cb4febf 100644 --- a/tests/erf.cpp +++ b/tests/erf.cpp @@ -18,8 +18,10 @@ ## ################################################################################*/ +#define TEST_ERR_TOL 1e-12 + #define TEST_PRINT_PRECISION_1 3 -#define TEST_PRINT_PRECISION_2 18 +#define TEST_PRINT_PRECISION_2 10 #include "gcem_tests.hpp" @@ -32,11 +34,13 @@ int main() GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -3.0L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -2.5L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -2.11L); - GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -2.05L); + GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -2.099L); + GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -2.0L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, -1.3L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 0.0L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 1.3L); - GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 2.05L); + GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 2.0L); + GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 2.099L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 2.11L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 2.5L); GCEM_TEST_COMPARE_VALS(gcem::erf, std::erf, 3.0L); diff --git a/tests/erf_inv.cpp b/tests/erf_inv.cpp index 0f37863..41560ad 100644 --- a/tests/erf_inv.cpp +++ b/tests/erf_inv.cpp @@ -18,6 +18,8 @@ ## ################################################################################*/ +#define TEST_ERR_TOL 1e-12 + #define TEST_PRINT_PRECISION_1 6 #define TEST_PRINT_PRECISION_2 18 diff --git a/tests/incomplete_gamma.cpp b/tests/incomplete_gamma.cpp index 00fbdd7..88feb97 100644 --- a/tests/incomplete_gamma.cpp +++ b/tests/incomplete_gamma.cpp @@ -18,6 +18,8 @@ ## ################################################################################*/ +#define TEST_ERR_TOL 1e-12 + #define TEST_PRINT_PRECISION_1 3 #define TEST_PRINT_PRECISION_2 18 diff --git a/tests/log.cpp b/tests/log.cpp index 194268d..f7dc8f4 100644 --- a/tests/log.cpp +++ b/tests/log.cpp @@ -38,6 +38,8 @@ int main() GCEM_TEST_COMPARE_VALS(gcem::log,std::log, 41.5L); GCEM_TEST_COMPARE_VALS(gcem::log,std::log, 0.0L); GCEM_TEST_COMPARE_VALS(gcem::log,std::log, -1.0L); + GCEM_TEST_COMPARE_VALS(gcem::log,std::log, 1e-500L); + GCEM_TEST_COMPARE_VALS(gcem::log,std::log, std::numeric_limits::min()); GCEM_TEST_COMPARE_VALS(gcem::log,std::log, -std::numeric_limits::infinity()); GCEM_TEST_COMPARE_VALS(gcem::log,std::log, std::numeric_limits::infinity()); diff --git a/tests/log10.cpp b/tests/log10.cpp index 39a09ed..65ee8e8 100644 --- a/tests/log10.cpp +++ b/tests/log10.cpp @@ -35,6 +35,8 @@ int main() GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, 41.5L); GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, 0.0L); GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, -1.0L); + GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, 1e-500L); + GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, std::numeric_limits::min()); GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, -std::numeric_limits::infinity()); GCEM_TEST_COMPARE_VALS(gcem::log10, std::log10, std::numeric_limits::infinity()); diff --git a/tests/log2.cpp b/tests/log2.cpp index 31e4612..7c9c67b 100644 --- a/tests/log2.cpp +++ b/tests/log2.cpp @@ -35,6 +35,8 @@ int main() GCEM_TEST_COMPARE_VALS(gcem::log2, std::log2, 41.5L); GCEM_TEST_COMPARE_VALS(gcem::log2, std::log2, 0.0L); GCEM_TEST_COMPARE_VALS(gcem::log2, std::log2, -1.0L); + GCEM_TEST_COMPARE_VALS(gcem::log2,std::log2, 1e-500L); + GCEM_TEST_COMPARE_VALS(gcem::log2,std::log2, std::numeric_limits::min()); GCEM_TEST_COMPARE_VALS(gcem::log2, std::log2, -std::numeric_limits::infinity()); GCEM_TEST_COMPARE_VALS(gcem::log2, std::log2, std::numeric_limits::infinity()); diff --git a/tests/signbit.cpp b/tests/signbit.cpp index ac60d5d..cf1d1c5 100644 --- a/tests/signbit.cpp +++ b/tests/signbit.cpp @@ -37,8 +37,6 @@ int main() // - - GCEM_TEST_COMPARE_VALS(gcem::signbit,std_test_fn, 1.0); GCEM_TEST_COMPARE_VALS(gcem::signbit,std_test_fn, -1.0);