mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-09 11:16:45 +08:00
cleanup test for the best compilation and more aggressive optimization to test errors in the code.
This commit is contained in:
parent
654d721f3d
commit
58bfb0375d
@ -8,9 +8,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
struct test_data {
|
struct test_data {
|
||||||
std::string input;
|
const std::string_view input;
|
||||||
bool expected_success;
|
const bool expected_success;
|
||||||
double expected_result;
|
const double expected_result;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool eddelbuettel() {
|
bool eddelbuettel() {
|
||||||
@ -51,10 +51,10 @@ bool eddelbuettel() {
|
|||||||
{"-+inf", false, 0.0},
|
{"-+inf", false, 0.0},
|
||||||
{"-+nan", false, 0.0},
|
{"-+nan", false, 0.0},
|
||||||
};
|
};
|
||||||
for (size_t i = 0; i < test_datas.size(); i++) {
|
for (const auto &i : test_datas) {
|
||||||
auto const &input = test_datas[i].input;
|
auto const &input = i.input;
|
||||||
auto const expected_success = test_datas[i].expected_success;
|
auto const expected_success = i.expected_success;
|
||||||
auto const expected_result = test_datas[i].expected_result;
|
auto const expected_result = i.expected_result;
|
||||||
double result;
|
double result;
|
||||||
// answer contains a error code and a pointer to the end of the
|
// answer contains a error code and a pointer to the end of the
|
||||||
// parsed region (on success).
|
// parsed region (on success).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user