[libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().
authorStephan T. Lavavej <stl@exchange.microsoft.com>
Fri, 18 Nov 2016 21:54:43 +0000 (21:54 +0000)
committerStephan T. Lavavej <stl@exchange.microsoft.com>
Fri, 18 Nov 2016 21:54:43 +0000 (21:54 +0000)
commit09c311b9a46c72ffea99026755db046cc2b0364f
treef80ae06ef8fa4ec2955431485106f7b0208d4809
parentb04c795e24654fc57a94a9032f54ac72e10d0b5e
[libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().

sample() isn't specified with a reproducible algorithm, so expecting
exact output is non-Standard. Mark those tests with LIBCPP_ASSERT.

In test_small_population(), we're guaranteed to get all of the elements,
but not necessarily in their original order. When PopulationCategory is
forward, we're guaranteed stability (and can therefore test equal()).
Otherwise, we can only test is_permutation(). (As it happens, both libcxx
and MSVC's STL provide stability in this scenario for input-only iterators.)

llvm-svn: 287383
libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp