Fix warning in test.
[awesomized/libmemcached] / libtest / unittest.cc
index b96fea06486a311b6e00744b065dd02568c16448..c7be63fa49c90a693e7110e8911b3788fea2cfac 100644 (file)
@@ -184,11 +184,11 @@ static test_return_t test_throw_fail_TEST(void *)
 static test_return_t ASSERT_FALSE__TEST(void *)
 {
   try {
-    ASSERT_FALSE_(true, __func__);
+    ASSERT_FALSE(true);
   }
   catch (const libtest::__failure& e)
   {
-    ASSERT_STREQ(e.what(), "Assertion '!true' [ ASSERT_FALSE__TEST ]");
+    ASSERT_STREQ(e.what(), "Assertion '!true'");
     return TEST_SUCCESS;
   }
   catch (...)
@@ -199,6 +199,31 @@ static test_return_t ASSERT_FALSE__TEST(void *)
   return TEST_FAILURE;
 }
 
+static test_return_t ASSERT_NEQ_FAIL_TEST(void *)
+{
+  try {
+    ASSERT_NEQ(1,1);
+  }
+  catch (const libtest::__failure& e)
+  {
+    ASSERT_STREQ(e.what(), "Assertion '1' == '1'");
+    return TEST_SUCCESS;
+  }
+  catch (...)
+  {
+    return TEST_FAILURE;
+  }
+
+  return TEST_FAILURE;
+}
+
+static test_return_t ASSERT_NEQ_TEST(void *)
+{
+  ASSERT_NEQ(1,0);
+
+  return TEST_SUCCESS;
+}
+
 static test_return_t ASSERT_FALSE_TEST(void *)
 {
   try {
@@ -1012,6 +1037,8 @@ test_st tests_log[] ={
   {"FAIL", false, test_throw_fail_TEST },
   {"ASSERT_FALSE_", false, ASSERT_FALSE__TEST },
   {"ASSERT_FALSE", false, ASSERT_FALSE_TEST },
+  {"ASSERT_NEQ", false, ASSERT_NEQ_TEST },
+  {"ASSERT_NEQ FAIL", false, ASSERT_NEQ_FAIL_TEST },
   {0, 0, 0}
 };