[libcxx] [test] Remove nonportable that errc::is_a_directory produces "Is a directory" from ios_base::failure tests

These io_error asserts that std::errc::is_a_directory has message "Is a directory". On MSVC++ it reports "is a directory" (with a lowercase I). That doesn't matter for the ios_failure component being tested, so just implement in terms of system_category().message().

Reviewed as https://reviews.llvm.org/D45715

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Billy Robert O'Neal III
2018-04-25 01:58:55 +00:00
parent 52cd8e497a
commit 58bcf28c63
2 changed files with 6 additions and 2 deletions

View File

@@ -15,6 +15,7 @@
#include <ios>
#include <string>
#include <system_error>
#include <cassert>
int main()
@@ -25,7 +26,8 @@ int main()
assert(se.code() == std::make_error_code(std::errc::is_a_directory));
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
assert(what_message.find("Is a directory") != std::string::npos);
assert(what_message.find(std::generic_category().message(static_cast<int>
(std::errc::is_a_directory))) != std::string::npos);
}
{
std::string what_arg("io test message");

View File

@@ -15,6 +15,7 @@
#include <ios>
#include <string>
#include <system_error>
#include <cassert>
int main()
@@ -28,7 +29,8 @@ int main()
assert(se.code() == std::make_error_code(std::errc::is_a_directory));
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
assert(what_message.find("Is a directory") != std::string::npos);
assert(what_message.find(std::generic_category().message(static_cast<int>
(std::errc::is_a_directory))) != std::string::npos);
}
{
std::string what_arg("io test message");