Skip to content

Commit

Permalink
Filter-out cov-fail/more lgamma/less test-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Jan 15, 2024
1 parent 23f2599 commit 6f39b5f
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 27 deletions.
12 changes: 9 additions & 3 deletions test/cover/make_gcov_02_files.gmk
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# -----------------------------------------------------------------------------
# Copyright Matt Borland 2023.
# Copyright Christopher Kormanyos 2023.
# Copyright Matt Borland 2023 - 2024.
# Copyright Christopher Kormanyos 2023 - 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
# -----------------------------------------------------------------------------

FILES_PRJ = $(basename $(wildcard $(PATH_SRC)/*.cpp))
FILES_PRJ := $(basename $(wildcard $(PATH_SRC)/*.cpp))

FILES_EXCLUDE := $(PATH_SRC)/concepts_test.cpp

FILES_EXCLUDE := $(basename $(FILES_EXCLUDE))

FILES_PRJ := $(filter-out $(FILES_EXCLUDE),$(FILES_PRJ))
4 changes: 2 additions & 2 deletions test/test_acosh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_asinh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_atanh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_cosh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_exp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x800)) : static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x400)) : static_cast<std::uint32_t>(UINT32_C(0x40));
#else
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x80)) : static_cast<std::uint32_t>(UINT32_C(0x8));
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x40)) : static_cast<std::uint32_t>(UINT32_C(0x4));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_expm1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down
27 changes: 21 additions & 6 deletions test/test_lgamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x400)) : static_cast<std::uint32_t>(UINT32_C(0x40));
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x200)) : static_cast<std::uint32_t>(UINT32_C(0x20));
#else
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x40)) : static_cast<std::uint32_t>(UINT32_C(0x4));
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x20)) : static_cast<std::uint32_t>(UINT32_C(0x4));
#endif

for( ; trials < count; ++trials)
Expand Down Expand Up @@ -286,7 +286,11 @@ namespace local

const auto val_one_or_two = lgamma(n_arg);

const auto result_val_one_or_two_is_ok = (fpclassify(val_one_or_two) == FP_ZERO);
const auto result_val_one_or_two_is_ok =
(
(fpclassify(val_one_or_two) == FP_ZERO)
&& is_close_fraction(val_one_or_two, (::my_zero<decimal_type>() * static_cast<decimal_type>(dist(gen))), decimal_type { 5, -1 })
);

BOOST_TEST(result_val_one_or_two_is_ok);

Expand All @@ -306,7 +310,18 @@ auto main() -> int
using decimal_type = boost::decimal::decimal32;
using float_type = float;

const auto result_lgamma_is_ok = local::test_lgamma<decimal_type, float_type>(512, 0.1L, 0.8L);
const auto result_lgamma_is_ok = local::test_lgamma<decimal_type, float_type>(512, 0.1L, 0.9L);

BOOST_TEST(result_lgamma_is_ok);

result_is_ok = (result_lgamma_is_ok && result_is_ok);
}

{
using decimal_type = boost::decimal::decimal32;
using float_type = float;

const auto result_lgamma_is_ok = local::test_lgamma<decimal_type, float_type>(512, 1.1L, 1.9L);

BOOST_TEST(result_lgamma_is_ok);

Expand All @@ -317,7 +332,7 @@ auto main() -> int
using decimal_type = boost::decimal::decimal32;
using float_type = float;

const auto result_lgamma_is_ok = local::test_lgamma<decimal_type, float_type>(512, 2.2L, 23.4L);
const auto result_lgamma_is_ok = local::test_lgamma<decimal_type, float_type>(512, 2.1L, 123.4L);

BOOST_TEST(result_lgamma_is_ok);

Expand All @@ -328,7 +343,7 @@ auto main() -> int
using decimal_type = boost::decimal::decimal64;
using float_type = double;

const auto result_tgamma_is_ok = local::test_lgamma<decimal_type, float_type>(2048, 2.2L, 23.4L);
const auto result_tgamma_is_ok = local::test_lgamma<decimal_type, float_type>(2048, 2.1L, 123.4L);

BOOST_TEST(result_tgamma_is_ok);

Expand Down
4 changes: 2 additions & 2 deletions test/test_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x800)) : static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x400)) : static_cast<std::uint32_t>(UINT32_C(0x40));
#else
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x80)) : static_cast<std::uint32_t>(UINT32_C(0x8));
constexpr auto count = (sizeof(decimal_type) == static_cast<std::size_t>(UINT8_C(4))) ? static_cast<std::uint32_t>(UINT32_C(0x40)) : static_cast<std::uint32_t>(UINT32_C(0x4));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_log1p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down
4 changes: 2 additions & 2 deletions test/test_sinh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace local
auto trials = static_cast<std::uint32_t>(UINT8_C(0));

#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH)
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x800));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x400));
#else
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x80));
constexpr auto count = static_cast<std::uint32_t>(UINT32_C(0x40));
#endif

for( ; trials < count; ++trials)
Expand Down

0 comments on commit 6f39b5f

Please sign in to comment.