Stricter insert exception tests.

[SVN r56559]
This commit is contained in:
Daniel James committed 2009-10-03 16:41:11 +00:00
1 parent 55eafdf0ee
commit 4601f5c51f
2 files changed
+13 -9

No files matched your search

+6 -2
View File
@@ -20,18 +20,22 @@ namespace test
{
typedef test::list<BOOST_DEDUCED_TYPENAME X::value_type> values_type;
values_type values_;
unsigned int allocations_;
public:
void store(X const& x) {
void store(X const& x, unsigned int allocations = 0) {
DISABLE_EXCEPTIONS;
values_.clear();
values_.insert(x.cbegin(), x.cend());
allocations_ = allocations;
}
void test(X const& x) const {
void test(X const& x, unsigned int allocations = 0) const {
if(!(x.size() == values_.size() &&
std::equal(x.cbegin(), x.cend(), values_.begin(),
test::equivalent)))
BOOST_ERROR("Strong exception safety failure.");
if(allocations != allocations_)
BOOST_ERROR("Strong exception failure: extra allocations.");
}
};
}