mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 17:26:51 +08:00
More details to basic test error for debugging
This commit is contained in:
parent
5fda2cc240
commit
681eb1ea38
@ -38,7 +38,15 @@ int main()
|
||||
auto answer = fast_float::from_chars(f.data(), f.data() + f.size(), result);
|
||||
|
||||
if (answer.ec != std::errc()) {
|
||||
std::cerr << "1. could not convert to int for input: " << std::quoted(f) << " " << result << " " << answer.ptr << std::endl;
|
||||
if (answer.ec == std::errc::invalid_argument) {
|
||||
std::cerr << "could not convert to int for input: " << std::quoted(f) << "because of invalid arguement, output: " << result << " , ptr: " << answer.ptr << std::endl;
|
||||
}
|
||||
else if (answer.ec == std::errc::result_out_of_range) {
|
||||
std::cerr << "could not convert to int for input: " << std::quoted(f) << "because it's out of range, output: " << result << " , ptr: " << answer.ptr << std::endl;
|
||||
}
|
||||
else {
|
||||
std::cerr << "could not convert to int for input: " << std::quoted(f) << "because of an unknown error, output: " << result << " , ptr: " << answer.ptr << std::endl;
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
else if (result != int_basic_test_expected[i]) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user