X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fframework.cc;h=92aacfeea30a37f117efabfa514285b1ae9f50bb;hb=f11376b6b5e8556138a15e01d79222775a0f286d;hp=6cca8450abcbcffbc4a7672518acb96a668c0f0f;hpb=35811e5efa56436f7f0e03c68bc8cf78f2b2c1c4;p=awesomized%2Flibmemcached diff --git a/libtest/framework.cc b/libtest/framework.cc index 6cca8450..92aacfee 100644 --- a/libtest/framework.cc +++ b/libtest/framework.cc @@ -34,12 +34,13 @@ * */ -#include +#include "libtest/yatlcon.h" #include #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) @@ -118,8 +115,7 @@ void Framework::exec() _total++; - try - { + try { switch ((*iter)->exec()) { case TEST_FAILURE: @@ -137,15 +133,15 @@ void Framework::exec() break; } } - catch (libtest::fatal& e) + catch (const libtest::fatal& e) { _failed++; - stream::cerr(e.file(), e.line(), e.func()) << e.mesg(); + stream::cerr(e.file(), e.line(), e.func()) << e.what(); } - catch (libtest::disconnected& e) + catch (const libtest::disconnected& e) { _failed++; - stream::cerr(e.file(), e.line(), e.func()) << "Unhandled disconnection occurred: " << e.mesg(); + Error << "Unhandled disconnection occurred:" << e.what(); throw; } catch (...)