@@ -47,7 +47,6 @@ BOOST_AUTO_TEST_CASE(double_serfloat_tests) {
47
47
BOOST_CHECK_EQUAL (TestDouble (4.0 ), 0x4010000000000000ULL );
48
48
BOOST_CHECK_EQUAL (TestDouble (785.066650390625 ), 0x4088888880000000ULL );
49
49
50
- // Roundtrip test on IEC559-compatible systems
51
50
if (std::numeric_limits<double >::is_iec559) {
52
51
BOOST_CHECK_EQUAL (sizeof (double ), 8U );
53
52
BOOST_CHECK_EQUAL (sizeof (uint64_t ), 8U );
@@ -64,8 +63,7 @@ BOOST_AUTO_TEST_CASE(double_serfloat_tests) {
64
63
TestDouble (-std::numeric_limits<double >::signaling_NaN ());
65
64
TestDouble (std::numeric_limits<double >::denorm_min ());
66
65
TestDouble (-std::numeric_limits<double >::denorm_min ());
67
- // Test exact encoding: on currently supported platforms, EncodeDouble
68
- // should produce exactly the same as the in-memory representation for non-NaN.
66
+ // On IEC559-compatible systems, construct doubles to test from the encoding.
69
67
for (int j = 0 ; j < 1000 ; ++j) {
70
68
// Iterate over 9 specific bits exhaustively; the others are chosen randomly.
71
69
// These specific bits are the sign bit, and the 2 top and bottom bits of
@@ -92,8 +90,7 @@ BOOST_AUTO_TEST_CASE(double_serfloat_tests) {
92
90
if (x & 256 ) v |= (uint64_t {1 } << 63 );
93
91
double f;
94
92
memcpy (&f, &v, 8 );
95
- uint64_t v2 = TestDouble (f);
96
- if (!std::isnan (f)) BOOST_CHECK_EQUAL (v, v2);
93
+ TestDouble (f);
97
94
}
98
95
}
99
96
}
0 commit comments