Skip to content

Commit 0f6ac4f

Browse files
committed
Handle compiler warnings and cover-misses
1 parent 5be58d6 commit 0f6ac4f

File tree

12 files changed

+19
-17
lines changed

12 files changed

+19
-17
lines changed

test/link_1.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
void test_odr_use(const boost::decimal::rounding_mode*);
88

9+
// LCOV_EXCL_START
910
template <typename T>
1011
void test()
1112
{
@@ -18,3 +19,4 @@ void f1()
1819
test<boost::decimal::decimal64>();
1920
test<boost::decimal::decimal128>();
2021
}
22+
// LCOV_EXCL_STOP

test/link_2.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
void test_odr_use(const boost::decimal::rounding_mode*);
88

9+
// LCOV_EXCL_START
910
template <typename T>
1011
void test()
1112
{
@@ -18,3 +19,4 @@ void f2()
1819
test<boost::decimal::decimal64>();
1920
test<boost::decimal::decimal128>();
2021
}
22+
// LCOV_EXCL_STOP

test/link_3.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <boost/decimal.hpp>
66

7+
// LCOV_EXCL_START
78
void f1();
89
void f2();
910

@@ -16,3 +17,4 @@ int main()
1617
void test_odr_use(const boost::decimal::rounding_mode*)
1718
{
1819
}
20+
// LCOV_EXCL_STOP

test/test_acosh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace local
5656

5757
if(b == static_cast<NumericType>(0))
5858
{
59-
result_is_ok = (fabs(a - b) < tol);
59+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
6060
}
6161
else
6262
{

test/test_asinh.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <boost/core/lightweight_test.hpp>
2323

2424
auto my_zero() -> boost::decimal::decimal32&;
25-
auto my_one () -> boost::decimal::decimal32&;
2625

2726
namespace local
2827
{
@@ -56,7 +55,7 @@ namespace local
5655

5756
if(b == static_cast<NumericType>(0))
5857
{
59-
result_is_ok = (fabs(a - b) < tol);
58+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
6059
}
6160
else
6261
{
@@ -268,4 +267,3 @@ auto main() -> int
268267
}
269268

270269
auto my_zero() -> boost::decimal::decimal32& { static boost::decimal::decimal32 val_zero { 0, 0 }; return val_zero; }
271-
auto my_one () -> boost::decimal::decimal32& { static boost::decimal::decimal32 val_one { 1, 0 }; return val_one; }

test/test_atanh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace local
5656

5757
if(b == static_cast<NumericType>(0))
5858
{
59-
result_is_ok = (fabs(a - b) < tol);
59+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
6060
}
6161
else
6262
{

test/test_edges_and_behave.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace local
6262

6363
if(b == static_cast<NumericType>(0))
6464
{
65-
result_is_ok = (fabs(a - b) < tol);
65+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
6666
}
6767
else
6868
{

test/test_expm1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace local
5555

5656
if(b == static_cast<NumericType>(0))
5757
{
58-
result_is_ok = (fabs(a - b) < tol);
58+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
5959
}
6060
else
6161
{

test/test_frexp_ldexp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace local
5353

5454
if(b == static_cast<NumericType>(0))
5555
{
56-
result_is_ok = (fabs(a - b) < tol);
56+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
5757
}
5858
else
5959
{

test/test_pow.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace local
5858

5959
if(b == static_cast<NumericType>(0))
6060
{
61-
result_is_ok = (fabs(a - b) < tol);
61+
result_is_ok = (fabs(a - b) < tol); // LCOV_EXCL_LINE
6262
}
6363
else
6464
{
@@ -324,9 +324,9 @@ namespace local
324324
decimal_type { 1, 25},
325325
}};
326326

327-
for(auto i = 0; i < std::tuple_size<ctrl_val_array_type>::value; ++i)
327+
for(auto i = static_cast<std::size_t>(UINT8_C(0)); i < std::tuple_size<ctrl_val_array_type>::value; ++i)
328328
{
329-
const int n = i + 1;
329+
const int n = static_cast<int>(i + static_cast<std::size_t>(UINT8_C(1)));
330330

331331
decimal_type p10 = pow(pow(::my_ten<decimal_type>(), n), n);
332332

@@ -346,9 +346,9 @@ namespace local
346346
decimal_type { 1, -25},
347347
}};
348348

349-
for(auto i = 0; i < std::tuple_size<ctrl_val_array_type>::value; ++i)
349+
for(auto i = static_cast<std::size_t>(UINT8_C(0)); i < std::tuple_size<ctrl_val_array_type>::value; ++i)
350350
{
351-
const int n = i + 1;
351+
const int n = static_cast<int>(i + static_cast<std::size_t>(UINT8_C(1)));
352352

353353
decimal_type p10 = pow(pow(::my_ten<decimal_type>(), -n), n);
354354

0 commit comments

Comments
 (0)