diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-07-19 00:31:54 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-07-19 00:31:54 +0000 |
commit | c45b673d5db23b9ccc92d371200a386f1bb47b47 (patch) | |
tree | 2a56ebfbc8be387fb8c2738f79f02d6ed0332cb9 /libcxx/test/std/containers | |
parent | 6aa873b392176b4665ebe82918d083bbf68885a2 (diff) | |
download | bcm5719-llvm-c45b673d5db23b9ccc92d371200a386f1bb47b47.tar.gz bcm5719-llvm-c45b673d5db23b9ccc92d371200a386f1bb47b47.zip |
Fix warnings in deque tests
llvm-svn: 242632
Diffstat (limited to 'libcxx/test/std/containers')
10 files changed, 24 insertions, 57 deletions
diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp index 522f839973d..84f04f9d52d 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp @@ -14,6 +14,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class C> @@ -58,7 +59,6 @@ template <class C> void testN(int start, int N, int M) { - typedef typename C::const_iterator CI; C c1 = make<C>(N, start); test(c1, M); } @@ -73,7 +73,7 @@ int main() for (int k = 0; k < N; ++k) testN<std::deque<int> >(rng[i], rng[j], rng[k]); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp index 9eb514ba92f..2bf2423fb9a 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp @@ -14,6 +14,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class C> @@ -58,7 +59,6 @@ template <class C> void testN(int start, int N, int M) { - typedef typename C::const_iterator CI; C c1 = make<C>(N, start); test(c1, M, -10); } @@ -73,7 +73,7 @@ int main() for (int k = 0; k < N; ++k) testN<std::deque<int> >(rng[i], rng[j], rng[k]); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp index fb00069f33b..0cf0387211d 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp @@ -14,6 +14,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class C> @@ -51,7 +52,6 @@ template <class C> void testN(int start, int N) { - typedef typename C::const_iterator CI; C c1 = make<C>(N, start); test(c1); } @@ -65,7 +65,7 @@ int main() for (int j = 0; j < N; ++j) testN<std::deque<int> >(rng[i], rng[j]); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp index 51a37cc33b7..6507f58e119 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp @@ -15,6 +15,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "min_allocator.h" @@ -44,7 +45,6 @@ template <class C> void test(C& c1, const C& c2) { - std::size_t c1_osize = c1.size(); c1.assign(c2.begin(), c2.end()); assert(distance(c1.begin(), c1.end()) == c1.size()); assert(c1 == c2); @@ -54,8 +54,6 @@ template <class C> void testN(int start, int N, int M) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; C c1 = make<C>(N, start); C c2 = make<C>(M); test(c1, c2); @@ -67,7 +65,6 @@ testI(C& c1, const C& c2) { typedef typename C::const_iterator CI; typedef input_iterator<CI> ICI; - std::size_t c1_osize = c1.size(); c1.assign(ICI(c2.begin()), ICI(c2.end())); assert(distance(c1.begin(), c1.end()) == c1.size()); assert(c1 == c2); @@ -77,8 +74,6 @@ template <class C> void testNI(int start, int N, int M) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; C c1 = make<C>(N, start); C c2 = make<C>(M); testI(c1, c2); @@ -95,7 +90,7 @@ int main() testN<std::deque<int> >(rng[i], rng[j], rng[k]); testNI<std::deque<int> >(1500, 2000, 1000); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp index 3ab79a095fc..e00e0442d22 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp @@ -14,6 +14,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "min_allocator.h" @@ -44,7 +45,6 @@ void test(C& c1, int size, int v) { typedef typename C::const_iterator CI; - std::size_t c1_osize = c1.size(); c1.assign(size, v); assert(c1.size() == size); assert(distance(c1.begin(), c1.end()) == c1.size()); @@ -56,8 +56,6 @@ template <class C> void testN(int start, int N, int M) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; C c1 = make<C>(N, start); test(c1, M, -10); } @@ -72,7 +70,7 @@ int main() for (int k = 0; k < N; ++k) testN<std::deque<int> >(rng[i], rng[j], rng[k]); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp index 7a0a2512ee2..713f2159e59 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp @@ -11,13 +11,14 @@ // template <class... Args> iterator emplace(const_iterator p, Args&&... args); +// UNSUPPORTED: c++98, c++03 + #include <deque> #include <cassert> #include "../../../Emplaceable.h" #include "min_allocator.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -45,7 +46,6 @@ template <class C> void test(int P, C& c1) { - typedef typename C::iterator I; typedef typename C::const_iterator CI; std::size_t c1_osize = c1.size(); CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5)); @@ -59,8 +59,6 @@ template <class C> void testN(int start, int N) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; for (int i = 0; i <= 3; ++i) { if (0 <= i && i <= N) @@ -87,11 +85,9 @@ testN(int start, int N) } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); @@ -99,7 +95,6 @@ int main() for (int j = 0; j < N; ++j) testN<std::deque<Emplaceable> >(rng[i], rng[j]); } -#if __cplusplus >= 201103L { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); @@ -107,6 +102,4 @@ int main() for (int j = 0; j < N; ++j) testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp index ecb95d72a21..fbe3cb69ccd 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp @@ -17,6 +17,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "MoveOnly.h" #include "../../../stack_allocator.h" @@ -49,7 +50,6 @@ void test(int P, const C& c0, const C& c2) { { - typedef typename C::iterator I; typedef typename C::const_iterator CI; typedef input_iterator<CI> BCI; C c1 = c0; @@ -67,7 +67,6 @@ test(int P, const C& c0, const C& c2) assert(*i == j); } { - typedef typename C::iterator I; typedef typename C::const_iterator CI; typedef forward_iterator<CI> BCI; C c1 = c0; @@ -85,7 +84,6 @@ test(int P, const C& c0, const C& c2) assert(*i == j); } { - typedef typename C::iterator I; typedef typename C::const_iterator CI; typedef bidirectional_iterator<CI> BCI; C c1 = c0; @@ -108,8 +106,6 @@ template <class C> void testN(int start, int N, int M) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; for (int i = 0; i <= 3; ++i) { if (0 <= i && i <= N) @@ -170,7 +166,6 @@ template <class C> void testI(int P, C& c1, const C& c2) { - typedef typename C::iterator I; typedef typename C::const_iterator CI; typedef input_iterator<CI> ICI; std::size_t c1_osize = c1.size(); @@ -191,8 +186,6 @@ template <class C> void testNI(int start, int N, int M) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; for (int i = 0; i <= 3; ++i) { if (0 <= i && i <= N) @@ -244,7 +237,7 @@ template <class C> void test_move() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 C c; typedef typename C::const_iterator CI; { @@ -263,7 +256,7 @@ test_move() j = 0; for (CI i = c.begin(); i != c.end(); ++i, ++j) assert(*i == MoveOnly(j)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif } int main() @@ -276,11 +269,11 @@ int main() for (int k = 0; k < N; ++k) testN<std::deque<int> >(rng[i], rng[j], rng[k]); testNI<std::deque<int> >(1500, 2000, 1000); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test_move<std::deque<MoveOnly, stack_allocator<MoveOnly, 2000> > >(); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp index b7e73f26502..3c7b0fef28b 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp @@ -11,13 +11,14 @@ // iterator insert (const_iterator p, value_type&& v); +// UNSUPPORTED: c++98, c++03 + #include <deque> #include <cassert> #include "MoveOnly.h" #include "min_allocator.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -45,7 +46,6 @@ template <class C> void test(int P, C& c1, int x) { - typedef typename C::iterator I; typedef typename C::const_iterator CI; std::size_t c1_osize = c1.size(); CI i = c1.insert(c1.begin() + P, MoveOnly(x)); @@ -65,8 +65,6 @@ template <class C> void testN(int start, int N) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; for (int i = 0; i <= 3; ++i) { if (0 <= i && i <= N) @@ -93,11 +91,8 @@ testN(int start, int N) } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); @@ -105,7 +100,6 @@ int main() for (int j = 0; j < N; ++j) testN<std::deque<MoveOnly> >(rng[i], rng[j]); } -#if __cplusplus >= 201103L { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); @@ -113,6 +107,4 @@ int main() for (int j = 0; j < N; ++j) testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp index 2737dfba773..0efe3b44c60 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp @@ -16,6 +16,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class C> @@ -44,7 +45,6 @@ template <class C> void test(int P, C& c1, int size, int x) { - typedef typename C::iterator I; typedef typename C::const_iterator CI; std::size_t c1_osize = c1.size(); CI i = c1.insert(c1.begin() + P, size, x); @@ -64,8 +64,6 @@ template <class C> void testN(int start, int N, int M) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; for (int i = 0; i <= 3; ++i) { if (0 <= i && i <= N) @@ -145,7 +143,7 @@ int main() testN<std::deque<int> >(rng[i], rng[j], rng[k]); self_reference_test<std::deque<int> >(); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp index fbbaad4f89e..04c4ca4f7b2 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp @@ -14,6 +14,7 @@ #include <deque> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class C> @@ -42,7 +43,6 @@ template <class C> void test(int P, C& c1, int x) { - typedef typename C::iterator I; typedef typename C::const_iterator CI; std::size_t c1_osize = c1.size(); CI i = c1.insert(c1.begin() + P, x); @@ -62,8 +62,6 @@ template <class C> void testN(int start, int N) { - typedef typename C::iterator I; - typedef typename C::const_iterator CI; for (int i = 0; i <= 3; ++i) { if (0 <= i && i <= N) @@ -126,7 +124,7 @@ int main() testN<std::deque<int> >(rng[i], rng[j]); self_reference_test<std::deque<int> >(); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; const int N = sizeof(rng)/sizeof(rng[0]); |