Merge unordered.

Warning fixes, support for incomplete types and tweak some test.


[SVN r57998]
This commit is contained in:
Daniel James
2009-11-28 11:40:08 +00:00
parent f709c16d70
commit 144d8963a3
50 changed files with 651 additions and 410 deletions
+12 -1
View File
@@ -8,7 +8,18 @@ import testing ;
#alias framework : /boost/test//boost_unit_test_framework ;
alias framework : ;
project unordered-test/exception-tests ;
project unordered-test/exception-tests
: requirements
<warnings>all
<toolset>intel:<warnings>on
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter"
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter"
<toolset>gcc:<define>_GLIBCXX_DEBUG
<toolset>darwin:<define>_GLIBCXX_DEBUG
<toolset>msvc:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on
<toolset>darwin:<warnings-as-errors>on
;
test-suite unordered-exception
:
+10 -2
View File
@@ -3,10 +3,16 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
#include "../helpers/invariants.hpp"
#if defined(BOOST_MSVC)
#pragma warning(disable:4512) // assignment operator could not be generated
#endif
test::seed_t seed(12847);
template <class T>
@@ -18,7 +24,8 @@ struct self_assign_base : public test::exception_base
typedef T data_type;
T init() const { return T(values.begin(), values.end()); }
void run(T& x) const { x = x; }
void check(T const& x) const { test::check_equivalent_keys(x); }
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const
{ test::check_equivalent_keys(x); }
};
template <class T>
@@ -48,7 +55,8 @@ struct assign_base : public test::exception_base
typedef T data_type;
T init() const { return T(x); }
void run(T& x1) const { x1 = y; }
void check(T const& x1) const { test::check_equivalent_keys(x1); }
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x1) const
{ test::check_equivalent_keys(x1); }
};
template <class T>
@@ -3,6 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
#include "../helpers/input_iterator.hpp"
+2
View File
@@ -3,6 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
+3 -1
View File
@@ -3,6 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
#include "../helpers/invariants.hpp"
@@ -22,7 +24,7 @@ struct erase_test_base : public test::exception_base
return T(values.begin(), values.end());
}
void check(T const& x) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const {
std::string scope(test::scope);
BOOST_TEST(scope.find("hash::") != std::string::npos ||
+5 -3
View File
@@ -3,6 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include <string>
#include "../helpers/random_values.hpp"
@@ -27,7 +29,7 @@ struct insert_test_base : public test::exception_base
return T();
}
void check(T const& x, strong_type const& strong) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x, strong_type const& strong) const {
std::string scope(test::scope);
if(scope.find("hash::operator()") == std::string::npos)
@@ -92,7 +94,7 @@ struct insert_test3 : public insert_test_base<T>
x.insert(this->values.begin(), this->values.end());
}
void check(T const& x) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const {
test::check_equivalent_keys(x);
}
};
@@ -215,7 +217,7 @@ struct insert_test_rehash3 : public insert_test_base<T>
BOOST_TEST(x.bucket_count() != bucket_count);
}
void check(T const& x) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const {
if(x.size() < rehash_bucket_count) {
//BOOST_TEST(x.bucket_count() == original_bucket_count);
}
+5 -1
View File
@@ -3,6 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include <string>
#include "../helpers/random_values.hpp"
@@ -28,7 +30,9 @@ struct rehash_test_base : public test::exception_base
return x;
}
void check(T const& x, strong_type const& strong) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x,
strong_type const& strong) const
{
std::string scope(test::scope);
if(scope.find("hash::operator()") == std::string::npos &&
+8 -2
View File
@@ -3,10 +3,16 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "../helpers/prefix.hpp"
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
#include "../helpers/invariants.hpp"
#if defined(BOOST_MSVC)
#pragma warning(disable:4512) // assignment operator could not be generated
#endif
test::seed_t seed(9387);
template <class T>
@@ -18,7 +24,7 @@ struct self_swap_base : public test::exception_base
typedef T data_type;
T init() const { return T(values.begin(), values.end()); }
void run(T& x) const { x.swap(x); }
void check(T const& x) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const {
std::string scope(test::scope);
#if BOOST_UNORDERED_SWAP_METHOD != 2
@@ -73,7 +79,7 @@ struct swap_base : public test::exception_base
d.x.swap(d.y);
} catch (std::runtime_error) {}
}
void check(data_type const& d) const {
void check BOOST_PREVENT_MACRO_SUBSTITUTION(data_type const& d) const {
std::string scope(test::scope);
#if BOOST_UNORDERED_SWAP_METHOD != 2