Update errcat.objects tests so they test the bug fixed in r272640.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272642 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
index 7afbbd0..65ecc49 100644
--- a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -18,10 +18,13 @@
#include <string>
#include <cerrno>
-void test_message_leaves_errno_unchanged() {
+#include "test_macros.h"
+
+void test_message_for_bad_value() {
errno = E2BIG; // something that message will never generate
const std::error_category& e_cat1 = std::generic_category();
- e_cat1.message(-1);
+ const std::string msg = e_cat1.message(-1);
+ LIBCPP_ASSERT(msg == "Unknown error -1");
assert(errno == E2BIG);
}
@@ -31,6 +34,6 @@
std::string m1 = e_cat1.name();
assert(m1 == "generic");
{
- test_message_leaves_errno_unchanged();
+ test_message_for_bad_value();
}
}
diff --git a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
index 8c1e802..d1a9488 100644
--- a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -18,11 +18,13 @@
#include <string>
#include <cerrno>
+#include "test_macros.h"
-void test_message_leaves_errno_unchanged() {
+void test_message_for_bad_value() {
errno = E2BIG; // something that message will never generate
const std::error_category& e_cat1 = std::system_category();
- e_cat1.message(-1);
+ const std::string msg = e_cat1.message(-1);
+ LIBCPP_ASSERT(msg == "Unknown error -1");
assert(errno == E2BIG);
}
@@ -36,6 +38,6 @@
assert(e_cond.value() == 5000);
assert(e_cond.category() == std::system_category());
{
- test_message_leaves_errno_unchanged();
+ test_message_for_bad_value();
}
}