Skip to content

Commit

Permalink
Validate ptr pos
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Dec 11, 2023
1 parent 387a423 commit 6de191f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/to_chars_float.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void test_floff()
<< "\n Printf: " << printf_buffer << std::endl;
}

for (int i = 0; i < 1000; ++i)
for (int i = 0; i < 10; ++i)
{
for (auto dist : dists)
{
Expand All @@ -227,7 +227,7 @@ void test_floff()
char rand_printf_buffer[256] {};
const auto num = std::snprintf(rand_printf_buffer, sizeof(rand_printf_buffer), printf_format.c_str(), rand_val);

if (!BOOST_TEST_CSTR_EQ(rand_buffer, rand_printf_buffer) && BOOST_TEST(r_small) && !BOOST_TEST(num == static_cast<int>(r_small.ptr - rand_buffer)))
if (!(BOOST_TEST_CSTR_EQ(rand_buffer, rand_printf_buffer) && BOOST_TEST(r_small) && BOOST_TEST(num == static_cast<int>(r_small.ptr - rand_buffer))))
{
std::cerr << "Precision: " << prec
<< std::setprecision(prec + 1) << "\n Val: " << rand_val
Expand Down

0 comments on commit 6de191f

Please sign in to comment.