[libcxx-commits] [libcxx] b3445c8 - [libc++][test] Portability fix of std::strstreambuf constructor test

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 14 14:09:17 PDT 2020


Author: Louis Dionne
Date: 2020-09-14T17:09:09-04:00
New Revision: b3445c839fac0bbe174f85e39e9b08756c847465

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

LOG: [libc++][test] Portability fix of std::strstreambuf constructor test

The standard does not require the constructor `strstreambuf(streamsize alsize_arg = 0)`
leave the stream array unallocated when called with parameter `alsize_arg > 0`.
Conformant implementations of this constructor may allocate minimal `alsize_arg`
number of bytes forcing `str()` method to return non-null pointer.

Thanks to Andrey Maksimov for the patch.

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

Added: 
    

Modified: 
    libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
index a7a3fbcf96f4..6ec30127ae59 100644
--- a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
+++ b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
@@ -26,7 +26,7 @@ int main(int, char**)
     }
     {
         std::strstreambuf s(1024);
-        assert(s.str() == nullptr);
+        LIBCPP_ASSERT(s.str() == nullptr);
         assert(s.pcount() == 0);
     }
 


        


More information about the libcxx-commits mailing list