aboutsummaryrefslogtreecommitdiff
path: root/test/std/algorithms/alg.sorting
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/algorithms/alg.sorting')
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp7
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp9
7 files changed, 27 insertions, 34 deletions
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
index 8e7931f7ea5d..33b8ff9ae43c 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
@@ -18,9 +18,9 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
struct indirect_less
{
@@ -29,7 +29,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::mt19937 randomness;
@@ -53,7 +52,7 @@ int main()
{
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -68,5 +67,5 @@ int main()
}
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
index 38d09ceda6e2..1b1987aa9205 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
@@ -19,9 +19,10 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -29,8 +30,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void test(int N)
@@ -51,7 +50,7 @@ int main()
{
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -65,5 +64,5 @@ int main()
}
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
index c0a05e4209b3..02839abab337 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
@@ -18,9 +18,10 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -28,8 +29,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void test(int N)
@@ -53,7 +52,7 @@ int main()
test(10);
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -65,5 +64,5 @@ int main()
assert(std::is_sorted(ia, ia+N, indirect_less()));
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
index 88249ed78d27..fa30797bd3f9 100644
--- a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void
@@ -78,7 +77,7 @@ int main()
test(1000);
test(1009);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -86,5 +85,5 @@ int main()
std::nth_element(v.begin(), v.begin() + v.size()/2, v.end(), indirect_less());
assert(static_cast<std::size_t>(*v[v.size()/2]) == v.size()/2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
index 847a5829140a..fb7976713719 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void
@@ -84,7 +83,7 @@ int main()
test_larger_sorts(1009);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -93,5 +92,5 @@ int main()
for (int i = 0; static_cast<std::size_t>(i) < v.size()/2; ++i)
assert(*v[i] == i);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
index c77015993c8c..87d66c4723d1 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
@@ -20,9 +20,10 @@
#include <vector>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -30,8 +31,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
{
@@ -43,7 +42,7 @@ int main()
assert(std::is_sorted(v.begin(), v.end()));
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -54,5 +53,5 @@ int main()
assert(*v[1] == 1);
assert(*v[2] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
index 347711bf5e3a..8306cc3b1b12 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
struct first_only
@@ -72,7 +71,7 @@ int main()
{
test();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -83,5 +82,5 @@ int main()
assert(*v[1] == 1);
assert(*v[2] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}