[libcxx-commits] [PATCH] D58299: [libcxx] Portability fix: make std::io_base::xalloc() test independent on initial index value.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 28 16:51:30 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL355160: [libc++] Increase portability of xalloc test (authored by ldionne, committed by ).
Herald added subscribers: llvm-commits, christof.
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D58299?vs=187059&id=188812#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58299/new/

https://reviews.llvm.org/D58299

Files:
  libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp


Index: libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp
===================================================================
--- libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp
+++ libcxx/trunk/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp
@@ -17,11 +17,9 @@
 
 int main(int, char**)
 {
-    assert(std::ios_base::xalloc() == 0);
-    assert(std::ios_base::xalloc() == 1);
-    assert(std::ios_base::xalloc() == 2);
-    assert(std::ios_base::xalloc() == 3);
-    assert(std::ios_base::xalloc() == 4);
+    int index = std::ios_base::xalloc();
+    for (int i = 0; i < 10000; ++i)
+        assert(std::ios_base::xalloc() == ++index);
 
   return 0;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58299.188812.patch
Type: text/x-patch
Size: 771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190301/806fea9c/attachment-0001.bin>


More information about the libcxx-commits mailing list