[libcxx-commits] [libcxx] a9740ff - Update system_error tests for more platforms.

Dan Albert via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 12 17:37:55 PDT 2020


Author: Dan Albert
Date: 2020-03-12T17:37:46-07:00
New Revision: a9740ff1585a10b9df4296a735512df3e0ff9df5

URL: https://github.com/llvm/llvm-project/commit/a9740ff1585a10b9df4296a735512df3e0ff9df5
DIFF: https://github.com/llvm/llvm-project/commit/a9740ff1585a10b9df4296a735512df3e0ff9df5.diff

LOG: Update system_error tests for more platforms.

Reviewers: EricWF, mclow.lists, #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, libcxx-commits, cfe-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D35732

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 f04427381cbb..22b12be54433 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
@@ -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.starts_with("Unknown error"));
     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 8374c8766b2e..8aae803d322f 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
@@ -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.starts_with("Unknown error"));
     assert(errno == E2BIG);
 }
 


        


More information about the libcxx-commits mailing list