Fix Debian issues.
[awesomized/libmemcached] / libtest / framework.cc
index 8bc6e65c234f0aff50f200c466c66b8a5b2d914e..92aacfeea30a37f117efabfa514285b1ae9f50bb 100644 (file)
  *
  */
 
-#include <config.h>
+#include "libtest/yatlcon.h"
 
 #include <libtest/common.h>
 #include <libtest/collection.h>
 #include <libtest/signal.h>
 
+#include <algorithm>
 #include <fnmatch.h>
 #include <iostream>
 
@@ -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<Collection*>::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.mesg();
+      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();