| 241 | } |
| 242 | |
| 243 | void testFloatingPoint() |
| 244 | { |
| 245 | testParseInto( 0.25f ); |
| 246 | testParseInto( 1.125 ); |
| 247 | // value_from doesn't support long double |
| 248 | // testParseInto( 2.25L ); |
| 249 | { |
| 250 | double d1 = 12; |
| 251 | std::string json = serialize( value_from( 12 ) ); |
| 252 | |
| 253 | system::error_code ec; |
| 254 | double d2; |
| 255 | parse_into(d2, json, ec); |
| 256 | BOOST_TEST( !ec.failed() ); |
| 257 | BOOST_TEST( d1 == d2 ); |
| 258 | |
| 259 | d1 = double(UINT64_MAX); |
| 260 | json = serialize( value_from( UINT64_MAX ) ); |
| 261 | parse_into(d2, json, ec); |
| 262 | BOOST_TEST( !ec.failed() ); |
| 263 | BOOST_TEST( d1 == d2 ); |
| 264 | } |
| 265 | |
| 266 | testParseIntoErrors< double >( error::not_double, { {"value", 12.1 } } ); |
| 267 | } |
| 268 | |
| 269 | void testString() |
| 270 | { |
nothing calls this directly
no test coverage detected