X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fframework.cc;h=92aacfeea30a37f117efabfa514285b1ae9f50bb;hb=39fb7a2961c2375233cea7e6ee46d92e0b00e8c0;hp=f8bc78c916375b9cfc8019733b9cfc2a5c647ad9;hpb=858824dce02bade6464c404beef41da9321d58ef;p=awesomized%2Flibmemcached diff --git a/libtest/framework.cc b/libtest/framework.cc index f8bc78c9..92aacfee 100644 --- a/libtest/framework.cc +++ b/libtest/framework.cc @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -67,7 +68,7 @@ Framework::Framework(libtest::SignalThread& signal_, get_world(this); } -void Framework::collections(collection_st* collections_) +void Framework::collections(collection_st collections_[]) { for (collection_st *next= collections_; next and next->name; next++) { @@ -86,12 +87,8 @@ Framework::~Framework() delete _runner; - for (std::vector::iterator iter= _collection.begin(); - iter != _collection.end(); - ++iter) - { - delete *iter; - } + std::for_each(_collection.begin(), _collection.end(), DeleteFromVector()); + _collection.clear(); } bool Framework::match(const char* arg) @@ -136,12 +133,12 @@ void Framework::exec() break; } } - catch (libtest::fatal& e) + catch (const libtest::fatal& e) { _failed++; stream::cerr(e.file(), e.line(), e.func()) << e.what(); } - catch (libtest::disconnected& e) + catch (const libtest::disconnected& e) { _failed++; Error << "Unhandled disconnection occurred:" << e.what();