[libcxx-commits] [libcxx] 7fb02d2 - [libc++][AIX] Add AIX error message as expected output
Zarko Todorovski via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 22 11:34:41 PST 2022
Author: Zarko Todorovski
Date: 2022-02-22T14:34:36-05:00
New Revision: 7fb02d2752c06a9000edd969a11eae1e08864b77
URL: https://github.com/llvm/llvm-project/commit/7fb02d2752c06a9000edd969a11eae1e08864b77
DIFF: https://github.com/llvm/llvm-project/commit/7fb02d2752c06a9000edd969a11eae1e08864b77.diff
LOG: [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
Added:
Modified:
libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
index e01df7f1f1967..8114bcd841ab5 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -8,7 +8,6 @@
// XFAIL: suse-linux-enterprise-server-11
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-// XFAIL: LIBCXX-AIX-FIXME
// <system_error>
@@ -28,7 +27,11 @@ void test_message_for_bad_value() {
const std::error_category& e_cat1 = std::generic_category();
const std::string msg = e_cat1.message(-1);
// 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);
+ #endif
assert(errno == E2BIG);
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
index 6eeb3175a9e7a..5597900dcd58b 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -14,7 +14,6 @@
// XFAIL: suse-linux-enterprise-server-11
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-// XFAIL: LIBCXX-AIX-FIXME
#include <system_error>
#include <cassert>
@@ -28,7 +27,11 @@ void test_message_for_bad_value() {
const std::error_category& e_cat1 = std::system_category();
const std::string msg = e_cat1.message(-1);
// 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);
+ #endif
assert(errno == E2BIG);
}
More information about the libcxx-commits
mailing list