[libcxx] r330791 - [libcxx] [test] Remove nonportable that errc::is_a_directory produces "Is a directory" from ios_base::failure tests
Billy Robert O'Neal III via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 24 18:58:55 PDT 2018
Author: bion
Date: Tue Apr 24 18:58:55 2018
New Revision: 330791
URL: http://llvm.org/viewvc/llvm-project?rev=330791&view=rev
Log:
[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
Modified:
libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
Modified: libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp?rev=330791&r1=330790&r2=330791&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp Tue Apr 24 18:58:55 2018
@@ -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");
Modified: libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp?rev=330791&r1=330790&r2=330791&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp Tue Apr 24 18:58:55 2018
@@ -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");
More information about the cfe-commits
mailing list