[PATCH] D26816: [libcxx] [test] Fix non-Standard assumptions when testing sample().

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 13:59:14 PST 2016


STL_MSFT marked an inline comment as done.
STL_MSFT added a comment.

Added the requested comment, will commit.



================
Comment at: test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp:74
   assert(end.base() - oa == std::min(os, is));
-  assert(std::equal(oa, oa + os, oa1));
+  LIBCPP_ASSERT(std::equal(oa, oa + os, oa1));
   end = std::sample(PopulationIterator(ia),
----------------
EricWF wrote:
> Please add a comment here explaining that the algorithm is non-reproducable.
Adding:
  // sample() is deterministic but non-reproducible;
  // its results can vary between implementations.



https://reviews.llvm.org/D26816





More information about the cfe-commits mailing list