|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61505 - in trunk/libs/unordered/test: exception helpers unordered
From: daniel_james_at_[hidden]
Date: 2010-04-23 03:26:44
Author: danieljames
Date: 2010-04-23 03:26:43 EDT (Fri, 23 Apr 2010)
New Revision: 61505
URL: http://svn.boost.org/trac/boost/changeset/61505
Log:
Fix clang warnings in unordered tests.
Text files modified:
trunk/libs/unordered/test/exception/constructor_exception_tests.cpp | 14 ++++++++++++++
trunk/libs/unordered/test/exception/copy_exception_tests.cpp | 6 ++++++
trunk/libs/unordered/test/helpers/list.hpp | 2 +-
trunk/libs/unordered/test/unordered/compile_tests.hpp | 18 ++++++++++++++++++
trunk/libs/unordered/test/unordered/constructor_tests.cpp | 1 -
5 files changed, 39 insertions(+), 2 deletions(-)
Modified: trunk/libs/unordered/test/exception/constructor_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/constructor_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/constructor_exception_tests.cpp 2010-04-23 03:26:43 EDT (Fri, 23 Apr 2010)
@@ -9,6 +9,8 @@
#include "../helpers/random_values.hpp"
#include "../helpers/input_iterator.hpp"
+template <typename T> inline void avoid_unused_warning(T const&) {}
+
test::seed_t seed(91274);
struct objects
@@ -24,6 +26,7 @@
{
void run() const {
T x;
+ avoid_unused_warning(x);
}
};
@@ -32,6 +35,7 @@
{
void run() const {
T x(300);
+ avoid_unused_warning(x);
}
};
@@ -40,6 +44,7 @@
{
void run() const {
T x(0, hash);
+ avoid_unused_warning(x);
}
};
@@ -48,6 +53,7 @@
{
void run() const {
T x(0, hash, equal_to);
+ avoid_unused_warning(x);
}
};
@@ -56,6 +62,7 @@
{
void run() const {
T x(50, hash, equal_to, allocator);
+ avoid_unused_warning(x);
}
};
@@ -64,6 +71,7 @@
{
void run() const {
T x(allocator);
+ avoid_unused_warning(x);
}
};
@@ -81,6 +89,7 @@
{
void run() const {
T x(this->values.begin(), this->values.end());
+ avoid_unused_warning(x);
}
};
@@ -89,6 +98,7 @@
{
void run() const {
T x(this->values.begin(), this->values.end(), 0);
+ avoid_unused_warning(x);
}
};
@@ -97,6 +107,7 @@
{
void run() const {
T x(this->values.begin(), this->values.end(), 0, hash);
+ avoid_unused_warning(x);
}
};
@@ -105,6 +116,7 @@
{
void run() const {
T x(this->values.begin(), this->values.end(), 100, hash, equal_to);
+ avoid_unused_warning(x);
}
};
@@ -118,6 +130,7 @@
void run() const {
T x(this->values.begin(), this->values.end(), 0,
hash, equal_to, allocator);
+ avoid_unused_warning(x);
}
};
@@ -131,6 +144,7 @@
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);
}
};
Modified: trunk/libs/unordered/test/exception/copy_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/copy_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/copy_exception_tests.cpp 2010-04-23 03:26:43 EDT (Fri, 23 Apr 2010)
@@ -8,6 +8,8 @@
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
+template <typename T> inline void avoid_unused_warning(T const&) {}
+
test::seed_t seed(73041);
template <class T>
@@ -17,6 +19,7 @@
void run() const {
T y(x);
+ avoid_unused_warning(y);
}
};
@@ -30,6 +33,7 @@
void run() const {
T y(x);
+ avoid_unused_warning(y);
}
};
@@ -43,6 +47,7 @@
void run() const {
T y(x);
+ avoid_unused_warning(y);
}
};
@@ -57,6 +62,7 @@
void run() const {
T y(x, allocator);
+ avoid_unused_warning(y);
}
};
Modified: trunk/libs/unordered/test/helpers/list.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/list.hpp (original)
+++ trunk/libs/unordered/test/helpers/list.hpp 2010-04-23 03:26:43 EDT (Fri, 23 Apr 2010)
@@ -94,7 +94,7 @@
node* ptr_;
public:
- list_iterator() : ptr_(0) {};
+ list_iterator() : ptr_(0) {}
explicit list_iterator(node* x) : ptr_(x) {}
T& operator*() const { return ptr_->value_; }
Modified: trunk/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- trunk/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ trunk/libs/unordered/test/unordered/compile_tests.hpp 2010-04-23 03:26:43 EDT (Fri, 23 Apr 2010)
@@ -138,6 +138,12 @@
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
test::check_return_type<allocator_type>::equals(a_const.get_allocator());
+
+ // Avoid unused variable warnings:
+
+ sink(u);
+ sink(u2);
+ sink(u3);
}
template <class X, class Key>
@@ -375,4 +381,16 @@
test::check_return_type<float>::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);
}
Modified: trunk/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/constructor_tests.cpp 2010-04-23 03:26:43 EDT (Fri, 23 Apr 2010)
@@ -142,7 +142,6 @@
std::cerr<<"Construct 11\n";
{
- test::random_values<T> v(1000, generator);
T x(al);
BOOST_TEST(x.empty());
BOOST_TEST(test::equivalent(x.hash_function(), hf));
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk