Fix test failure regarding int->float conversion

Supply only small integers (< 1^23) to int->float conversion tests,
so they can roundtrip without error.
This commit is contained in:
Daiki Ueno 2014-07-17 18:38:04 +09:00
parent 197ed8c983
commit c203928fae

View File

@ -201,10 +201,8 @@ TYPED_TEST_P(IntegerToFloatingPointTest, simple_buffer)
v.push_back(1); v.push_back(1);
if (numeric_limits<integer_type>::is_signed) v.push_back(-1); if (numeric_limits<integer_type>::is_signed) v.push_back(-1);
else v.push_back(2); else v.push_back(2);
v.push_back(numeric_limits<integer_type>::min());
v.push_back(numeric_limits<integer_type>::max());
for (unsigned int i = 0; i < kLoop; i++) { for (unsigned int i = 0; i < kLoop; i++) {
v.push_back(rand()); v.push_back(rand() % 0x7FFFFF);
} }
for (unsigned int i = 0; i < v.size() ; i++) { for (unsigned int i = 0; i < v.size() ; i++) {
msgpack::sbuffer sbuf; msgpack::sbuffer sbuf;