Skip to content

Commit 970ae03

Browse files
committed
Add testing of overflow path
1 parent 3878cd8 commit 970ae03

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_from_string.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ void test()
7676
}
7777
}
7878

79+
inline void test_overflow_path()
80+
{
81+
const std::string str {"INF"};
82+
BOOST_TEST_THROWS(recover_value<decimal32_t>(str, nullptr), std::out_of_range);
83+
}
84+
7985
int main()
8086
{
8187
test<decimal32_t>();
@@ -85,6 +91,8 @@ int main()
8591
test<decimal128_t>();
8692
test<decimal_fast128_t>();
8793

94+
test_overflow_path();
95+
8896
return boost::report_errors();
8997
}
9098

0 commit comments

Comments
 (0)