Skip to content

Commit

Permalink
Remove the use of numeric_limits in appendToStream test (#553)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2023
1 parent a527e14 commit 6460f7c
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/Helpers_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1011,27 +1011,10 @@ TEST(HelpersTest, AppendToStream)
math::appendToStream(out, pi);
EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654");

// Skip end of test for arm64
#if !defined __ARM_ARCH
out << " "
<< std::setprecision(std::numeric_limits<long double>::digits10 + 1);

math::appendToStream(out, pi);
#if defined(_WIN32) && !defined(__amd64__) && !defined(__i386__)
EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793");
#else
EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793239");
#endif

out << " "
<< std::setprecision(3);

math::appendToStream(out, pi);
#if defined(_WIN32) && !defined(__amd64__) && !defined(__i386__)
EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793 3.14");
#else
EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.141592653589793239 3.14");
#endif
// ifndef __ARM_ARCH
#endif
EXPECT_EQ(out.str(), "0 456 0 3.14159 3.141592654 3.14");
}

0 comments on commit 6460f7c

Please sign in to comment.