Skip to content

Commit 0c03d72

Browse files
Address @mordante's review comments
- Uses a simpler RNG. - Improves comments.
1 parent 49a0099 commit 0c03d72

File tree

3 files changed

+48
-320
lines changed

3 files changed

+48
-320
lines changed

libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,14 @@ TEST_CONSTEXPR_CXX26 void test(RandSrc& randomness) {
9696
test_one<Iter>(3, 2, randomness);
9797
test_one<Iter>(3, 3, randomness);
9898
test<Iter>(4, randomness);
99-
test<Iter>(50, randomness);
100-
#if defined(_LIBCPP_HARDENING_MODE)
101-
if (!TEST_IS_CONSTANT_EVALUATED) // avoid blowing past constant evaluation limit
102-
#endif
103-
{
104-
test<Iter>(100, randomness);
105-
}
106-
if (!TEST_IS_CONSTANT_EVALUATED) { // avoid blowing past constant evaluation limit
99+
test<Iter>(100, randomness);
100+
if (!TEST_IS_CONSTANT_EVALUATED) { // avoid exceeding the constant evaluation step limit
107101
test<Iter>(1000, randomness);
108102
}
109103
}
110104

111105
TEST_CONSTEXPR_CXX26 bool test() {
112-
support::minstd_rand randomness;
106+
support::simple_random_generator randomness;
113107

114108
test<bidirectional_iterator<int*> >(randomness);
115109
test<random_access_iterator<int*> >(randomness);

libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ TEST_CONSTEXPR_CXX26 void test(RandSrc& randomness) {
115115
test<Iter>(20, randomness);
116116
test<Iter>(50, randomness);
117117
#if defined(_LIBCPP_HARDENING_MODE)
118-
if (!TEST_IS_CONSTANT_EVALUATED) // avoid blowing past constant evaluation limit
118+
if (!TEST_IS_CONSTANT_EVALUATED) // avoid exceeding the constant evaluation step limit
119119
#endif
120120
{
121121
test<Iter>(100, randomness);
122122
}
123-
if (!TEST_IS_CONSTANT_EVALUATED) { // avoid blowing past constant evaluation limit
123+
if (!TEST_IS_CONSTANT_EVALUATED) { // avoid exceeding the constant evaluation step limit
124124
test<Iter>(1000, randomness);
125125
}
126126
}
@@ -145,7 +145,7 @@ TEST_CONSTEXPR_CXX26 void test_PR31166() {
145145
}
146146

147147
TEST_CONSTEXPR_CXX26 bool test() {
148-
support::minstd_rand randomness;
148+
support::simple_random_generator randomness;
149149

150150
test<bidirectional_iterator<int*> >(randomness);
151151
test<random_access_iterator<int*> >(randomness);

0 commit comments

Comments
 (0)