diff --git a/tests/basictest.cpp b/tests/basictest.cpp index d1b377a..8f26902 100644 --- a/tests/basictest.cpp +++ b/tests/basictest.cpp @@ -656,7 +656,7 @@ TEST_CASE("decimal_point_parsing") { answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options(fast_float::chars_format::general, ',', 10)); + fast_float::parse_options({fast_float::chars_format::general, ',', 10})); CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success"); CHECK_MESSAGE(answer.ptr == input.data() + input.size(), "Parsing should have stopped at end"); @@ -666,7 +666,8 @@ TEST_CASE("decimal_point_parsing") { std::string const input = "1.25"; auto answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options(fast_float::chars_format::general, ',', 10)); + fast_float::parse_options({fast_float::chars_format::general, ',', + 10})); CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success"); CHECK_MESSAGE(answer.ptr == input.data() + 1, "Parsing should have stopped at dot"); @@ -1323,8 +1324,8 @@ TEST_CASE("double.general") { TEST_CASE("double.decimal_point") { constexpr auto options = [] { - return fast_float::parse_options(fast_float::chars_format::general, ',', - 10); + return fast_float::parse_options({fast_float::chars_format::general, ',', + 10}); }(); // infinities @@ -1641,8 +1642,8 @@ TEST_CASE("float.general") { TEST_CASE("float.decimal_point") { constexpr auto options = [] { - return fast_float::parse_options(fast_float::chars_format::general, ',', - 10); + return fast_float::parse_options({fast_float::chars_format::general, ',', + 10}); }(); // infinity diff --git a/tests/example_comma_test.cpp b/tests/example_comma_test.cpp index 40d6ec3..b77ad57 100644 --- a/tests/example_comma_test.cpp +++ b/tests/example_comma_test.cpp @@ -9,7 +9,7 @@ int main() { double result; auto answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options{fast_float::chars_format::general, ','}); + fast_float::parse_options({fast_float::chars_format::general, ','})); if ((answer.ec != std::errc()) || ((result != 3.1416))) { std::cerr << "parsing failure\n"; return EXIT_FAILURE; diff --git a/tests/fortran.cpp b/tests/fortran.cpp index 0c7477f..2f49946 100644 --- a/tests/fortran.cpp +++ b/tests/fortran.cpp @@ -11,9 +11,9 @@ int main_readme() { double result; auto answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options { + fast_float::parse_options ({ fast_float::chars_format::fortran | - fast_float::chars_format::allow_leading_plus}); + fast_float::chars_format::allow_leading_plus})); if ((answer.ec != std::errc()) || ((result != 10000))) { std::cerr << "parsing failure\n" << result << "\n"; return EXIT_FAILURE; @@ -37,9 +37,9 @@ int main() { double result; auto answer{fast_float::from_chars_advanced(f.data(), f.data() + f.size(), result, - fast_float::parse_options { + fast_float::parse_options ({ fast_float::chars_format::fortran | - fast_float::chars_format::allow_leading_plus})}; + fast_float::chars_format::allow_leading_plus}))}; if (answer.ec != std::errc() || result != expected[std::size_t(d)]) { std::cerr << "parsing failure on " << f << std::endl; return EXIT_FAILURE; @@ -51,9 +51,9 @@ int main() { double result; auto answer{fast_float::from_chars_advanced(f.data(), f.data() + f.size(), result, - fast_float::parse_options { + fast_float::parse_options ({ fast_float::chars_format::fortran | - fast_float::chars_format::allow_leading_plus})}; + fast_float::chars_format::allow_leading_plus}))}; if (answer.ec != std::errc() || result != expected[std::size_t(d)]) { std::cerr << "parsing failure on " << f << std::endl; return EXIT_FAILURE; @@ -65,9 +65,9 @@ int main() { double result; auto answer{fast_float::from_chars_advanced(f.data(), f.data() + f.size(), result, - fast_float::parse_options { + fast_float::parse_options ({ fast_float::chars_format::fortran | - fast_float::chars_format::allow_leading_plus})}; + fast_float::chars_format::allow_leading_plus}))}; if (answer.ec != std::errc() || result != expected[std::size_t(d)]) { std::cerr << "parsing failure on " << f << std::endl; return EXIT_FAILURE; diff --git a/tests/json_fmt.cpp b/tests/json_fmt.cpp index 10994db..bf3b402 100644 --- a/tests/json_fmt.cpp +++ b/tests/json_fmt.cpp @@ -9,9 +9,9 @@ int main_readme() { double result; auto answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options options{ + fast_float::parse_options options({ fast_float::chars_format::json | - fast_float::chars_format::allow_leading_plus} // should be ignored + fast_float::chars_format::allow_leading_plus}) // should be ignored ); if (answer.ec == std::errc()) { std::cerr << "should have failed\n"; @@ -25,9 +25,9 @@ int main_readme2() { double result; auto answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options options{ + fast_float::parse_options options({ fast_float::chars_format::json | - fast_float::chars_format::allow_leading_plus} // should be ignored + fast_float::chars_format::allow_leading_plus}) // should be ignored ); if (answer.ec == std::errc()) { std::cerr << "should have failed\n"; @@ -42,9 +42,9 @@ int main_readme3() { double result; auto answer = fast_float::from_chars_advanced( input.data(), input.data() + input.size(), result, - fast_float::parse_options options{ + fast_float::parse_options options({ fast_float::chars_format::json_or_infnan | - fast_float::chars_format::allow_leading_plus}; // should be ignored + fast_float::chars_format::allow_leading_plus}); // should be ignored ); if (answer.ec != std::errc() || (!std::isinf(result))) { std::cerr << "should have parsed infinity\n"; @@ -136,9 +136,9 @@ int main() { auto const &expected_reason = reject[i].reason; auto answer = fast_float::parse_number_string( f.data(), f.data() + f.size(), - fast_float::parse_options( + fast_float::parse_options({ fast_float::chars_format::json | - fast_float::chars_format::allow_leading_plus)); // should be ignored + fast_float::chars_format::allow_leading_plus})); // should be ignored if (answer.valid) { std::cerr << "json parse accepted invalid json " << f << std::endl; return EXIT_FAILURE;