diff options
Diffstat (limited to 'libcxx/test/strings/string.conversions/stof.pass.cpp')
-rw-r--r-- | libcxx/test/strings/string.conversions/stof.pass.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libcxx/test/strings/string.conversions/stof.pass.cpp b/libcxx/test/strings/string.conversions/stof.pass.cpp index 749d8672e5c..444a69518c6 100644 --- a/libcxx/test/strings/string.conversions/stof.pass.cpp +++ b/libcxx/test/strings/string.conversions/stof.pass.cpp @@ -32,23 +32,24 @@ int main() idx = 0; assert(std::stof(L"10g", &idx) == 10); assert(idx == 2); + idx = 0; try { assert(std::stof("1.e60", &idx) == INFINITY); - assert(idx == 5); + assert(false); } catch (const std::out_of_range&) { - assert(false); + assert(idx == 0); } try { assert(std::stof(L"1.e60", &idx) == INFINITY); - assert(idx == 5); + assert(false); } catch (const std::out_of_range&) { - assert(false); + assert(idx == 0); } idx = 0; try |