Revert "Revert "Update system_error tests for more platforms.""

This time using old fashioned starts_with.

This reverts commit d4a8c3f251.
This commit is contained in:
Dan Albert 2020-03-13 12:01:59 -07:00
parent 478b06e687
commit adefcc8ab5
2 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,8 @@ void test_message_for_bad_value() {
errno = E2BIG; // something that message will never generate
const std::error_category& e_cat1 = std::generic_category();
const std::string msg = e_cat1.message(-1);
LIBCPP_ASSERT(msg == "Unknown error -1" || msg == "Unknown error");
// Exact message format varies by platform.
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
assert(errno == E2BIG);
}

View File

@ -31,7 +31,8 @@ void test_message_for_bad_value() {
errno = E2BIG; // something that message will never generate
const std::error_category& e_cat1 = std::system_category();
const std::string msg = e_cat1.message(-1);
LIBCPP_ASSERT(msg == "Unknown error -1" || msg == "Unknown error");
// Exact message format varies by platform.
LIBCPP_ASSERT(msg.rfind("Unknown error", 0) == 0);
assert(errno == E2BIG);
}