[libcxx-commits] [libcxx] 545fb7a - [libcxx] [test] Mark bits of fs.enum tests as libcpp specific

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 21 23:12:03 PDT 2020


Author: Martin Storsjö
Date: 2020-10-22T09:00:57+03:00
New Revision: 545fb7a71c0c7e73b1d40ba1263d603ac6b17968

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

LOG: [libcxx] [test] Mark bits of fs.enum tests as libcpp specific

The individual enum values in copy_options and file_type aren't
specified in the standard.

The standard doesn't require fs::path::format to be a scoped enum.

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

Added: 
    

Modified: 
    libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
index c5d73eb96c44..52903efb0d5f 100644
--- a/libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
@@ -35,26 +35,27 @@ int main(int, char**) {
   typedef check_bitmask_type<E, E::skip_existing, E::update_existing> BitmaskTester;
   assert(BitmaskTester::check());
 
-  static_assert(
+  // The standard doesn't specify the numeric values of the enum.
+  LIBCPP_STATIC_ASSERT(
           E::none == ME(0),
         "Expected enumeration values do not match");
   // Option group for copy_file
-  static_assert(
+  LIBCPP_STATIC_ASSERT(
           E::skip_existing      == ME(1) &&
           E::overwrite_existing == ME(2) &&
           E::update_existing    == ME(4),
         "Expected enumeration values do not match");
   // Option group for copy on directories
-  static_assert(
+  LIBCPP_STATIC_ASSERT(
           E::recursive == ME(8),
         "Expected enumeration values do not match");
   // Option group for copy on symlinks
-  static_assert(
+  LIBCPP_STATIC_ASSERT(
           E::copy_symlinks == ME(16) &&
           E::skip_symlinks == ME(32),
         "Expected enumeration values do not match");
   // Option group for changing form of copy
-  static_assert(
+  LIBCPP_STATIC_ASSERT(
           E::directories_only    == ME(64) &&
           E::create_symlinks     == ME(128) &&
           E::create_hard_links   == ME(256),

diff  --git a/libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
index dd2a868f2d0a..81e7227deaeb 100644
--- a/libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
@@ -31,7 +31,8 @@ int main(int, char**) {
 
   LIBCPP_ONLY(static_assert(std::is_same<UT, signed char>::value, "")); // Implementation detail
 
-  static_assert(
+  // The standard doesn't specify the numeric values of the enum.
+  LIBCPP_STATIC_ASSERT(
           E::none == ME(0) &&
           E::not_found == ME(-1) &&
           E::regular == ME(1) &&

diff  --git a/libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
index fc9fa1936119..f32816783337 100644
--- a/libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
@@ -25,7 +25,7 @@ int main(int, char**) {
 
   // Check that E is a scoped enum by checking for conversions.
   typedef std::underlying_type<E>::type UT;
-  static_assert(!std::is_convertible<E, UT>::value, "");
+  LIBCPP_STATIC_ASSERT(!std::is_convertible<E, UT>::value, "");
 
   LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char>::value, "")); // Implementation detail
 


        


More information about the libcxx-commits mailing list