cleanup test for the best compilation and more aggressive optimization to test errors in the code.

This commit is contained in:
IRainman 2026-01-20 23:44:34 +03:00
parent 654d721f3d
commit 58bfb0375d

View File

@ -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).