[libcxx-commits] [libcxx] a9c2273 - [libc++] Remove incorrect assertion in the filesystem tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 31 07:07:58 PDT 2020


Author: Louis Dionne
Date: 2020-03-31T10:07:48-04:00
New Revision: a9c22739e675ad26093a8e584ab6bbc24f6a7bb3

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

LOG: [libc++] Remove incorrect assertion in the filesystem tests

Based on the current discussion in https://llvm.org/PR45307, it seems
that it's legitimate for `temp_directory_path()` to return a path with
a trailing slash. Since `p.parent_path()` will never contain a trailing
slash, comparing it to the result of `temp_directory_path()` will fail
depending on whether `temp_directory_path()` returns a trailing slash
or not.

Added: 
    

Modified: 
    libcxx/test/support/filesystem_test_helper.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h
index d92778793318..ef66405d351d 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -251,7 +251,6 @@ struct scoped_test_env
     static inline fs::path random_path() {
         fs::path tmp = fs::temp_directory_path();
         fs::path p = fs::path(tmp) / unique_path_suffix();
-        assert(p.parent_path() == tmp);
         return p;
     }
 


        


More information about the libcxx-commits mailing list