Skip to content

Commit

Permalink
🚧 checking if #714 is now fixed with MSVC
Browse files Browse the repository at this point in the history
Hopefully, #764 fixed this.
  • Loading branch information
nlohmann committed Oct 22, 2017
1 parent b0c380b commit 89650c9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/src/unit-regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,4 +1253,31 @@ TEST_CASE("regression tests")
CHECK( i3 == 3 );
}
}

SECTION("issue #714 - throw std::ios_base::failure exception when failbit set to true")
{
{
std::ifstream is;
is.exceptions(
is.exceptions()
| std::ios_base::failbit
| std::ios_base::badbit
); // handle different exceptions as 'file not found', 'permission denied'

is.open("test/data/regression/working_file.json");
CHECK_NOTHROW(nlohmann::json::parse(is));
}

{
std::ifstream is;
is.exceptions(
is.exceptions()
| std::ios_base::failbit
| std::ios_base::badbit
); // handle different exceptions as 'file not found', 'permission denied'

is.open("test/data/json_nlohmann_tests/all_unicode.json.cbor");
CHECK_NOTHROW(nlohmann::json::from_cbor(is));
}
}
}

0 comments on commit 89650c9

Please sign in to comment.