Update for OSX Lion build.
[awesomized/libmemcached] / libtest / comparison.hpp
index 09106d9f62134faf7f04e2a1babc40ce8fe0652f..a04038b6c9ab0de7a86708f9f6cbcdc23568a889 100644 (file)
@@ -22,7 +22,6 @@
 #pragma once
 
 #include <typeinfo>
-#include <libtest/strerror.h>
 
 #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
 #include <libmemcached/memcached.h>
@@ -35,7 +34,7 @@
 namespace libtest {
 
 template <class T_comparable, class T_hint>
-bool _compare_true_hint(const char *file, int line, const char *func, T_comparable __expected, const char *assertation_label,  T_hint __hint)
+bool _compare_truth_hint(const char *file, int line, const char *func, T_comparable __expected, const char *assertation_label,  T_hint __hint)
 {
   if (__expected == false)
   {
@@ -102,6 +101,18 @@ bool _compare_zero(const char *file, int line, const char *func, T_comparable __
   return true;
 }
 
+template <class T_comparable>
+bool _truth(const char *file, int line, const char *func, T_comparable __truth)
+{
+  if (bool(__truth))
+  {
+    libtest::stream::make_cerr(file, line, func) << "Assertion failed for " << func << "() with \"" << __truth << "\"";
+    return false;
+  }
+
+  return true;
+}
+
 template <class T_comparable, class T_hint>
 bool _compare_hint(const char *file, int line, const char *func, T_comparable __expected, T_comparable __actual, T_hint __hint)
 {