Skip to content

Commit

Permalink
Try to hit a few more cover lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Jan 18, 2025
1 parent 594156f commit 41ddd91
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions test/test_various_edges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,9 @@ namespace local

for(auto index = static_cast<int>(UINT8_C(3)); index <= static_cast<int>(UINT8_C(11)); index += static_cast<int>(UINT8_C(2)))
{
const auto flt_zero_pos = pow(static_cast<float_type>(0.0L), static_cast<float_type>(index));
const float_type val_zero { ::my_zero<float_type>() * static_cast<float_type>(dist(gen)) };

const auto flt_zero_pos = pow(val_zero, static_cast<float_type>(index));

const auto result_val_zero_pos_is_ok = (fpclassify(flt_zero_pos) == FP_ZERO);

Expand All @@ -956,7 +958,9 @@ namespace local

for(auto index = static_cast<int>(INT8_C(-11)); index <= static_cast<int>(INT8_C(-3)); index += static_cast<int>(INT8_C(2)))
{
const auto flt_zero_pos = pow(static_cast<float_type>(0.0L), static_cast<float_type>(index));
const float_type val_zero { ::my_zero<float_type>() * static_cast<float_type>(dist(gen)) };

const auto flt_zero_pos = pow(val_zero, static_cast<float_type>(index));

const auto result_val_zero_pos_is_ok = isinf(flt_zero_pos);

Expand All @@ -967,7 +971,9 @@ namespace local

for(auto index = static_cast<int>(INT8_C(-10)); index <= static_cast<int>(INT8_C(-2)); index += static_cast<int>(INT8_C(2)))
{
const auto flt_zero_pos = pow(static_cast<float_type>(0.0L), static_cast<float_type>(index));
const float_type val_zero { ::my_zero<float_type>() * static_cast<float_type>(dist(gen)) };

const auto flt_zero_pos = pow(val_zero, static_cast<float_type>(index));

const auto result_val_zero_pos_is_ok = isinf(flt_zero_pos);

Expand All @@ -976,6 +982,21 @@ namespace local
result_is_ok = (result_val_zero_pos_is_ok && result_is_ok);
}

for(auto index = static_cast<int>(INT8_C(-11)); index <= static_cast<int>(INT8_C(-3)); index += static_cast<int>(INT8_C(2)))
{
const float_type val_something { ::my_one<float_type>() * static_cast<float_type>(dist(gen)) };

const int n_zero { static_cast<int>(::my_zero<float_type>() * static_cast<float_type>(dist(gen))) };

const auto flt_pow_zero = pow(val_something, n_zero);

const bool result_val_pow_zero_is_ok = { flt_pow_zero == float_type { 1.0F } };

BOOST_TEST(result_val_pow_zero_is_ok);

result_is_ok = (result_val_pow_zero_is_ok && result_is_ok);
}

for(auto i = static_cast<unsigned>(UINT8_C(0)); i < static_cast<unsigned>(UINT8_C(8)); ++i)
{
static_cast<void>(i);
Expand Down

0 comments on commit 41ddd91

Please sign in to comment.