[PATCH] D45715: [libcxx] [test] Remove nonportable that errc::is_a_directory produces "Is a directory" from ios_base::failure tests
Billy Robert O'Neal III via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 16 20:39:20 PDT 2018
BillyONeal updated this revision to Diff 142733.
BillyONeal added a comment.
Added missing <system_error> include in one of the tests.
https://reviews.llvm.org/D45715
Files:
test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
Index: test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
===================================================================
--- test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
+++ test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
@@ -15,6 +15,7 @@
#include <ios>
#include <string>
+#include <system_error>
#include <cassert>
int main()
@@ -28,7 +29,8 @@
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");
Index: test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
===================================================================
--- test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
+++ test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp
@@ -15,6 +15,7 @@
#include <ios>
#include <string>
+#include <system_error>
#include <cassert>
int main()
@@ -25,7 +26,8 @@
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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45715.142733.patch
Type: text/x-patch
Size: 2008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180417/302aa4d3/attachment.bin>
More information about the cfe-commits
mailing list