summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/algorithms
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/algorithms')
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp111
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp35
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp18
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp6
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp3
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp3
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp3
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp2
17 files changed, 102 insertions, 97 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
index df9e350f36c..8597b08da8c 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
@@ -15,64 +15,69 @@
#include <algorithm>
#include <functional>
+#include <cstddef>
#include <cassert>
#include "test_iterators.h"
#include "counting_predicates.hpp"
-struct is_odd
-{
- bool operator()(const int& i) const {return i & 1;}
+struct is_odd {
+ bool operator()(const int &i) const { return i & 1; }
};
-int main()
-{
- {
- const int ia[] = {1, 2, 3, 4, 5, 6};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert(!std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 2, 4, 6};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert( std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {2, 4, 6, 1, 3, 5};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert(!std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 2, 4, 6, 7};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert(!std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 2, 4, 6, 7};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert( std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::begin(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::begin(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 7, 9, 11, 2};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert( std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
+int main() {
+ {
+ const int ia[] = {1, 2, 3, 4, 5, 6};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 2, 4, 6};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {2, 4, 6, 1, 3, 5};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 2, 4, 6, 7};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 2, 4, 6, 7};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::begin(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::begin(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 7, 9, 11, 2};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
index b7da7354ca2..515c79761ee 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
@@ -15,10 +15,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -26,7 +25,7 @@ void
test()
{
int ia[] = {0};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ const int sa = static_cast<int>(sizeof(ia)/sizeof(ia[0]));
Iter r = std::rotate(Iter(ia), Iter(ia), Iter(ia));
assert(base(r) == ia);
assert(ia[0] == 0);
@@ -38,7 +37,7 @@ test()
assert(ia[0] == 0);
int ib[] = {0, 1};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ const int sb = static_cast<int>(sizeof(ib)/sizeof(ib[0]));
r = std::rotate(Iter(ib), Iter(ib), Iter(ib+sb));
assert(base(r) == ib+sb);
assert(ib[0] == 0);
@@ -53,7 +52,7 @@ test()
assert(ib[1] == 0);
int ic[] = {0, 1, 2};
- const unsigned sc = sizeof(ic)/sizeof(ic[0]);
+ const int sc = static_cast<int>(sizeof(ic)/sizeof(ic[0]));
r = std::rotate(Iter(ic), Iter(ic), Iter(ic+sc));
assert(base(r) == ic+sc);
assert(ic[0] == 0);
@@ -76,7 +75,7 @@ test()
assert(ic[2] == 2);
int id[] = {0, 1, 2, 3};
- const unsigned sd = sizeof(id)/sizeof(id[0]);
+ const int sd = static_cast<int>(sizeof(id)/sizeof(id[0]));
r = std::rotate(Iter(id), Iter(id), Iter(id+sd));
assert(base(r) == id+sd);
assert(id[0] == 0);
@@ -109,7 +108,7 @@ test()
assert(id[3] == 1);
int ie[] = {0, 1, 2, 3, 4};
- const unsigned se = sizeof(ie)/sizeof(ie[0]);
+ const int se = static_cast<int>(sizeof(ie)/sizeof(ie[0]));
r = std::rotate(Iter(ie), Iter(ie), Iter(ie+se));
assert(base(r) == ie+se);
assert(ie[0] == 0);
@@ -154,7 +153,7 @@ test()
assert(ie[4] == 4);
int ig[] = {0, 1, 2, 3, 4, 5};
- const unsigned sg = sizeof(ig)/sizeof(ig[0]);
+ const int sg = static_cast<int>(sizeof(ig)/sizeof(ig[0]));
r = std::rotate(Iter(ig), Iter(ig), Iter(ig+sg));
assert(base(r) == ig+sg);
assert(ig[0] == 0);
@@ -213,14 +212,14 @@ test()
assert(ig[5] == 2);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
template <class Iter>
void
test1()
{
std::unique_ptr<int> ia[1];
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ const int sa = static_cast<int>(sizeof(ia)/sizeof(ia[0]));
for (int i = 0; i < sa; ++i)
ia[i].reset(new int(i));
Iter r = std::rotate(Iter(ia), Iter(ia), Iter(ia));
@@ -234,7 +233,7 @@ test1()
assert(*ia[0] == 0);
std::unique_ptr<int> ib[2];
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ const int sb = static_cast<int>(sizeof(ib)/sizeof(ib[0]));
for (int i = 0; i < sb; ++i)
ib[i].reset(new int(i));
r = std::rotate(Iter(ib), Iter(ib), Iter(ib+sb));
@@ -251,7 +250,7 @@ test1()
assert(*ib[1] == 0);
std::unique_ptr<int> ic[3];
- const unsigned sc = sizeof(ic)/sizeof(ic[0]);
+ const int sc = static_cast<int>(sizeof(ic)/sizeof(ic[0]));
for (int i = 0; i < sc; ++i)
ic[i].reset(new int(i));
r = std::rotate(Iter(ic), Iter(ic), Iter(ic+sc));
@@ -276,7 +275,7 @@ test1()
assert(*ic[2] == 2);
std::unique_ptr<int> id[4];
- const unsigned sd = sizeof(id)/sizeof(id[0]);
+ const int sd = static_cast<int>(sizeof(id)/sizeof(id[0]));
for (int i = 0; i < sd; ++i)
id[i].reset(new int(i));
r = std::rotate(Iter(id), Iter(id), Iter(id+sd));
@@ -311,7 +310,7 @@ test1()
assert(*id[3] == 1);
std::unique_ptr<int> ie[5];
- const unsigned se = sizeof(ie)/sizeof(ie[0]);
+ const int se = static_cast<int>(sizeof(ie)/sizeof(ie[0]));
for (int i = 0; i < se; ++i)
ie[i].reset(new int(i));
r = std::rotate(Iter(ie), Iter(ie), Iter(ie+se));
@@ -358,7 +357,7 @@ test1()
assert(*ie[4] == 4);
std::unique_ptr<int> ig[6];
- const unsigned sg = sizeof(ig)/sizeof(ig[0]);
+ const int sg = static_cast<int>(sizeof(ig)/sizeof(ig[0]));
for (int i = 0; i < sg; ++i)
ig[i].reset(new int(i));
r = std::rotate(Iter(ig), Iter(ig), Iter(ig+sg));
@@ -419,7 +418,7 @@ test1()
assert(*ig[5] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -428,12 +427,12 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test1<forward_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
index 802d897670c..e0b148499ca 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
@@ -35,7 +35,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
index 8c2b60819b0..bc968f5b2aa 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
@@ -42,7 +42,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
index c2d92d92081..de0bbf25613 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
@@ -43,7 +43,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
index 2608104fca7..1fff1d7f5b6 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
@@ -37,7 +37,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
index 6a5463246c7..4ec5f6c000d 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
@@ -38,7 +38,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
index 106f1499e99..710edb61c9b 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
@@ -37,7 +37,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
index 3fa346131ac..3268075b1b0 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
@@ -38,7 +38,7 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
for (std::size_t i = 0; i < v.size(); ++i)
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp
index 0e16d9bd17c..9d0545f0d9c 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp
@@ -16,13 +16,12 @@
#include <algorithm>
#include <functional>
+#include <memory>
#include <cassert>
+#include "test_macros.h"
#include "counting_predicates.hpp"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#include <memory>
-
struct indirect_less
{
template <class P>
@@ -30,9 +29,8 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
{
@@ -49,7 +47,7 @@ void test(unsigned N)
for (int i = 0; i < N; ++i)
ia[i] = i;
std::make_heap(ia, ia+N, std::ref(pred));
- assert(pred.count() <= 3*N);
+ assert(pred.count() <= 3u*N);
assert(std::is_heap(ia, ia+N, pred));
}
@@ -59,7 +57,7 @@ void test(unsigned N)
for (int i = 0; i < N; ++i)
ia[N-1-i] = i;
std::make_heap(ia, ia+N, std::ref(pred));
- assert(pred.count() <= 3*N);
+ assert(pred.count() <= 3u*N);
assert(std::is_heap(ia, ia+N, pred));
}
@@ -68,7 +66,7 @@ void test(unsigned N)
binary_counting_predicate<std::greater<int>, int, int> pred ((std::greater<int>()));
std::random_shuffle(ia, ia+N);
std::make_heap(ia, ia+N, std::ref(pred));
- assert(pred.count() <= 3*N);
+ assert(pred.count() <= 3u*N);
assert(std::is_heap(ia, ia+N, pred));
}
@@ -86,7 +84,7 @@ int main()
test(10000);
test(100000);
-#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];
@@ -97,5 +95,5 @@ int main()
assert(std::is_heap(ia, ia+N, indirect_less()));
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
index b4d25a93e50..fd9e5f13c26 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
@@ -74,7 +74,7 @@ test_one(unsigned N, unsigned M)
std::inplace_merge(Iter(ia), Iter(ia+M), Iter(ia+N), std::ref(pred));
if(N > 0)
{
- assert(ia[0] == N-1);
+ assert(ia[0] == static_cast<int>(N)-1);
assert(ia[N-1] == 0);
assert(std::is_sorted(ia, ia+N, std::greater<value_type>()));
assert(pred.count() <= (N-1));
@@ -125,10 +125,10 @@ int main()
test<S*>();
{
- unsigned N = 100;
+ int N = 100;
unsigned M = 50;
std::unique_ptr<int>* ia = new std::unique_ptr<int>[N];
- for (unsigned i = 0; i < N; ++i)
+ for (int i = 0; i < N; ++i)
ia[i].reset(new int(i));
std::random_shuffle(ia, ia+N);
std::sort(ia, ia+M, indirect_less());
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
index 2e8e0c30d94..e60e156455f 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -66,7 +67,7 @@ void test_eq0(Iter first, Iter last, Pred p)
void test_eq()
{
- const size_t N = 10;
+ const int N = 10;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 10; // all the same
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
index 0f5c80c0d25..c4c6e31eb6d 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -66,7 +67,7 @@ void test_eq0(Iter first, Iter last, Pred p)
void test_eq()
{
- const size_t N = 10;
+ const int N = 10;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 10; // all the same
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
index fc97778347b..c2805a65613 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
@@ -62,7 +62,7 @@ test()
test<Iter>(10);
test<Iter>(1000);
{
- const unsigned N = 100;
+ const int N = 100;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 5;
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
index a39512f2e63..7840638f742 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -65,7 +66,7 @@ test()
test<Iter>(10);
test<Iter>(1000);
{
- const unsigned N = 100;
+ const int N = 100;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 5;
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
index ea1e7dfe9fa..689433f9e45 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
@@ -63,7 +63,7 @@ test_sort_driver(RI f, RI l, int start)
test_sort_driver_driver(f, l, start, l);
}
-template <unsigned sa>
+template <int sa>
void
test_sort_()
{
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
index 74a876cee19..336fcd0b3dd 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
@@ -63,7 +63,7 @@ test_sort_driver(RI f, RI l, int start)
test_sort_driver_driver(f, l, start, l);
}
-template <unsigned sa>
+template <int sa>
void
test_sort_()
{
OpenPOWER on IntegriCloud