From 2b6b6bf8adab67b6832146931975a15204c9392e Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 26 Aug 2017 20:39:26 +0300 Subject: [PATCH] Silence warnings in tests about unused variables and local typedefs. --- include/boost/pending/iterator_tests.hpp | 8 ++++++++ test/counting_iterator_test.cpp | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index d515e12..1640310 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -25,6 +25,7 @@ # include # include // for detail::dummy_constructor # include +# include namespace boost { @@ -59,6 +60,7 @@ void trivial_iterator_test(const Iterator i, const Iterator j, T val) typename std::iterator_traits::value_type v = *i; #endif assert(v == val); + boost::ignore_unused(v); #if 0 // hmm, this will give a warning for transform_iterator... perhaps // this should be separated out into a stand-alone test since there @@ -71,6 +73,7 @@ void trivial_iterator_test(const Iterator i, const Iterator j, T val) assert(k == i); assert(k != j); assert(*k == val); + boost::ignore_unused(k); } @@ -108,6 +111,7 @@ void input_iterator_test(Iterator i, T v1, T v2) // we cannot test for equivalence of (void)++i & (void)i++ // as i is only guaranteed to be single pass. assert(*i++ == v1); + boost::ignore_unused(i1); i1 = i; @@ -116,6 +120,7 @@ void input_iterator_test(Iterator i, T v1, T v2) assert(*i1 == v2); assert(*i == v2); + boost::ignore_unused(i1); // i is dereferencable, so it must be incrementable. ++i; @@ -216,6 +221,7 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) int c; typedef typename std::iterator_traits::value_type value_type; + boost::ignore_unused(); for (c = 0; c < N-1; ++c) { assert(i == j + c); @@ -236,6 +242,7 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) assert(*i == vals[N - 1 - c]); assert(*i == boost::implicit_cast(j[N - 1 - c])); Iterator q = k - c; + boost::ignore_unused(q); assert(*i == *q); assert(i > j); assert(i >= j); @@ -259,6 +266,7 @@ void const_nonconst_iterator_test(Iterator i, ConstIterator j) k = i; assert(k == i); assert(i == k); + boost::ignore_unused(k); } } // namespace iterators diff --git a/test/counting_iterator_test.cpp b/test/counting_iterator_test.cpp index 7770af5..855ea21 100644 --- a/test/counting_iterator_test.cpp +++ b/test/counting_iterator_test.cpp @@ -153,7 +153,6 @@ template void test_aux(CountingIterator start, CountingIterator finish, Value v1) { typedef typename CountingIterator::iterator_category category; - typedef typename CountingIterator::value_type value_type; // If it's a RandomAccessIterator we can do a few delicate tests category_test(start, finish, v1, category());