From 19c2885895f8676db41551cc0a6c1d17603203f3 Mon Sep 17 00:00:00 2001 From: jatin Date: Tue, 14 Nov 2023 06:44:07 +0000 Subject: [PATCH] Trying to avoid bad allocations in Windows CI --- test/src/sigmoid_approx_test.cpp | 6 +++++- test/src/tanh_approx_test.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/src/sigmoid_approx_test.cpp b/test/src/sigmoid_approx_test.cpp index cb647ca..9d9033e 100644 --- a/test/src/sigmoid_approx_test.cpp +++ b/test/src/sigmoid_approx_test.cpp @@ -6,7 +6,11 @@ TEST_CASE ("Sigmoid Approx Test") { - const auto all_floats = test_helpers::all_32_bit_floats (-20.0f, 20.0f, 1.0e-3f); +#if ! defined(WIN32) + const auto all_floats = test_helpers::all_32_bit_floats (-10.0f, 10.0f, 1.0e-3f); +#else + const auto all_floats = test_helpers::all_32_bit_floats (-10.0f, 10.0f, 1.0e-1f); +#endif const auto y_exact = test_helpers::compute_all (all_floats, [] (auto x) { return 1.0f / (1.0f + std::exp (-x)); }); diff --git a/test/src/tanh_approx_test.cpp b/test/src/tanh_approx_test.cpp index dcf51e4..d220fec 100644 --- a/test/src/tanh_approx_test.cpp +++ b/test/src/tanh_approx_test.cpp @@ -6,7 +6,11 @@ TEST_CASE ("Tanh Approx Test") { +#if ! defined(WIN32) const auto all_floats = test_helpers::all_32_bit_floats (-10.0f, 10.0f, 1.0e-3f); +#else + const auto all_floats = test_helpers::all_32_bit_floats (-10.0f, 10.0f, 1.0e-1f); +#endif const auto y_exact = test_helpers::compute_all (all_floats, [] (auto x) { return std::tanh (x); });