forked from OSchip/llvm-project
[libc++][AIX] Add AIX error message as expected output
AIX's libc generates "Error -1 occurred" instead of the "Unknown Error" expected by these test cases. Add this as expected output for AIX only. Reviewed By: daltenty, #powerpc, #libc, zibi, Quuxplusone Differential Revision: https://reviews.llvm.org/D119982
This commit is contained in:
parent
cb8e9bea95
commit
7fb02d2752
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
// XFAIL: suse-linux-enterprise-server-11
|
// XFAIL: suse-linux-enterprise-server-11
|
||||||
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
|
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
|
||||||
// XFAIL: LIBCXX-AIX-FIXME
|
|
||||||
|
|
||||||
// <system_error>
|
// <system_error>
|
||||||
|
|
||||||
|
@ -28,7 +27,11 @@ void test_message_for_bad_value() {
|
||||||
const std::error_category& e_cat1 = std::generic_category();
|
const std::error_category& e_cat1 = std::generic_category();
|
||||||
const std::string msg = e_cat1.message(-1);
|
const std::string msg = e_cat1.message(-1);
|
||||||
// Exact message format varies by platform.
|
// Exact message format varies by platform.
|
||||||
|
#if defined(_AIX)
|
||||||
|
LIBCPP_ASSERT(msg.rfind("Error -1 occurred", 0) == 0);
|
||||||
|
#else
|
||||||
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
|
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
|
||||||
|
#endif
|
||||||
assert(errno == E2BIG);
|
assert(errno == E2BIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
// XFAIL: suse-linux-enterprise-server-11
|
// XFAIL: suse-linux-enterprise-server-11
|
||||||
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
|
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
|
||||||
// XFAIL: LIBCXX-AIX-FIXME
|
|
||||||
|
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -28,7 +27,11 @@ void test_message_for_bad_value() {
|
||||||
const std::error_category& e_cat1 = std::system_category();
|
const std::error_category& e_cat1 = std::system_category();
|
||||||
const std::string msg = e_cat1.message(-1);
|
const std::string msg = e_cat1.message(-1);
|
||||||
// Exact message format varies by platform.
|
// Exact message format varies by platform.
|
||||||
|
#if defined(_AIX)
|
||||||
|
LIBCPP_ASSERT(msg.rfind("Error -1 occurred", 0) == 0);
|
||||||
|
#else
|
||||||
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
|
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
|
||||||
|
#endif
|
||||||
assert(errno == E2BIG);
|
assert(errno == E2BIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue