diff --git a/test/exception/constructor_exception_tests.cpp b/test/exception/constructor_exception_tests.cpp index ef3119e4..96d5c1f2 100644 --- a/test/exception/constructor_exception_tests.cpp +++ b/test/exception/constructor_exception_tests.cpp @@ -9,6 +9,8 @@ #include "../helpers/random_values.hpp" #include "../helpers/input_iterator.hpp" +template inline void avoid_unused_warning(T const&) {} + test::seed_t seed(91274); struct objects @@ -24,6 +26,7 @@ struct construct_test1 : public objects, test::exception_base { void run() const { T x; + avoid_unused_warning(x); } }; @@ -32,6 +35,7 @@ struct construct_test2 : public objects, test::exception_base { void run() const { T x(300); + avoid_unused_warning(x); } }; @@ -40,6 +44,7 @@ struct construct_test3 : public objects, test::exception_base { void run() const { T x(0, hash); + avoid_unused_warning(x); } }; @@ -48,6 +53,7 @@ struct construct_test4 : public objects, test::exception_base { void run() const { T x(0, hash, equal_to); + avoid_unused_warning(x); } }; @@ -56,6 +62,7 @@ struct construct_test5 : public objects, test::exception_base { void run() const { T x(50, hash, equal_to, allocator); + avoid_unused_warning(x); } }; @@ -64,6 +71,7 @@ struct construct_test6 : public objects, test::exception_base { void run() const { T x(allocator); + avoid_unused_warning(x); } }; @@ -81,6 +89,7 @@ struct range_construct_test1 : public range, objects { void run() const { T x(this->values.begin(), this->values.end()); + avoid_unused_warning(x); } }; @@ -89,6 +98,7 @@ struct range_construct_test2 : public range, objects { void run() const { T x(this->values.begin(), this->values.end(), 0); + avoid_unused_warning(x); } }; @@ -97,6 +107,7 @@ struct range_construct_test3 : public range, objects { void run() const { T x(this->values.begin(), this->values.end(), 0, hash); + avoid_unused_warning(x); } }; @@ -105,6 +116,7 @@ struct range_construct_test4 : public range, objects { void run() const { T x(this->values.begin(), this->values.end(), 100, hash, equal_to); + avoid_unused_warning(x); } }; @@ -118,6 +130,7 @@ struct range_construct_test5 : public range, objects void run() const { T x(this->values.begin(), this->values.end(), 0, hash, equal_to, allocator); + avoid_unused_warning(x); } }; @@ -131,6 +144,7 @@ struct input_range_construct_test : public range, objects begin = this->values.begin(), end = this->values.end(); T x(test::input_iterator(begin), test::input_iterator(end), 0, hash, equal_to, allocator); + avoid_unused_warning(x); } }; diff --git a/test/exception/copy_exception_tests.cpp b/test/exception/copy_exception_tests.cpp index 36a0d798..0d0e2e14 100644 --- a/test/exception/copy_exception_tests.cpp +++ b/test/exception/copy_exception_tests.cpp @@ -8,6 +8,8 @@ #include "./containers.hpp" #include "../helpers/random_values.hpp" +template inline void avoid_unused_warning(T const&) {} + test::seed_t seed(73041); template @@ -17,6 +19,7 @@ struct copy_test1 : public test::exception_base void run() const { T y(x); + avoid_unused_warning(y); } }; @@ -30,6 +33,7 @@ struct copy_test2 : public test::exception_base void run() const { T y(x); + avoid_unused_warning(y); } }; @@ -43,6 +47,7 @@ struct copy_test3 : public test::exception_base void run() const { T y(x); + avoid_unused_warning(y); } }; @@ -57,6 +62,7 @@ struct copy_with_allocator_test : public test::exception_base void run() const { T y(x, allocator); + avoid_unused_warning(y); } }; diff --git a/test/helpers/list.hpp b/test/helpers/list.hpp index ebb37b8f..991404ee 100644 --- a/test/helpers/list.hpp +++ b/test/helpers/list.hpp @@ -94,7 +94,7 @@ namespace test node* ptr_; public: - list_iterator() : ptr_(0) {}; + list_iterator() : ptr_(0) {} explicit list_iterator(node* x) : ptr_(x) {} T& operator*() const { return ptr_->value_; } diff --git a/test/unordered/compile_tests.hpp b/test/unordered/compile_tests.hpp index 2def5318..d22a9fc0 100644 --- a/test/unordered/compile_tests.hpp +++ b/test/unordered/compile_tests.hpp @@ -138,6 +138,12 @@ void container_test(X& r, T const&) typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; test::check_return_type::equals(a_const.get_allocator()); + + // Avoid unused variable warnings: + + sink(u); + sink(u2); + sink(u3); } template @@ -375,4 +381,16 @@ void unordered_test(X&, Key& k, T& t, Hash& hf, Pred& eq) test::check_return_type::equals(b.max_load_factor()); a.max_load_factor((float) 2.0); a.rehash(100); + + // Avoid unused variable warnings: + + sink(a); + sink(a2); + sink(a3); + sink(a4); + sink(a5); + sink(a6); + sink(a7); + sink(a8); + sink(a9); } diff --git a/test/unordered/constructor_tests.cpp b/test/unordered/constructor_tests.cpp index b157bdbd..e48cecde 100644 --- a/test/unordered/constructor_tests.cpp +++ b/test/unordered/constructor_tests.cpp @@ -142,7 +142,6 @@ void constructor_tests1(T*, std::cerr<<"Construct 11\n"; { - test::random_values v(1000, generator); T x(al); BOOST_TEST(x.empty()); BOOST_TEST(test::equivalent(x.hash_function(), hf));