libmemcached-1.0: fix subscripting on empty vector
[awesomized/libmemcached] / libtest / test.h
index 5c449ab02f9e3c0341b4c1638f3f70f83c93fa3d..3c3c37d1b0d10e97ca1d0821e3631b554416d25a 100644 (file)
@@ -40,6 +40,8 @@
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 #endif
 
+#include <libtest/lite.h>
+
 /**
   A structure describing the test case.
 */
@@ -61,17 +63,6 @@ do \
   } \
 } while (0)
 
-#define test_assert(A, B) \
-do \
-{ \
-  if ((A)) { \
-    fprintf(stderr, "\n%s:%d: Assertion failed %s, with message %s, in %s", __FILE__, __LINE__, (B), #A, __func__ );\
-    fprintf(stderr, "\n"); \
-    libtest::create_core(); \
-    assert((A)); \
-  } \
-} while (0)
-
 #define test_truth(A) \
 do \
 { \
@@ -170,7 +161,7 @@ do \
 #define test_zero(__actual) \
 do \
 { \
-  if (not libtest::_compare_zero(__FILE__, __LINE__, __func__, ((__actual)))) \
+  if (libtest::_compare_zero(__FILE__, __LINE__, __func__, ((__actual))) == false) \
   { \
     libtest::create_core(); \
     return TEST_FAILURE; \