X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ftest.h;h=42443d9ac17cf5f52acc7b1b3d96f85f7ba4eb0b;hb=299c04f7d92895d0ec5e1cce437d19b3334b75ac;hp=b5f7e47d3cad9ddd7c37d68d3c51ac3778457a29;hpb=47f45992107361ad58c170bdf78fdc92523fab06;p=m6w6%2Flibmemcached diff --git a/libtest/test.h b/libtest/test.h index b5f7e47d..42443d9a 100644 --- a/libtest/test.h +++ b/libtest/test.h @@ -196,7 +196,7 @@ do \ #define test_compare_got(__expected, __actual, __hint) \ do \ { \ - if (not libtest::_compare_hint(__FILE__, __LINE__, __func__, (__expected), (__actual), (__hint))) \ + if (libtest::_compare_hint(__FILE__, __LINE__, __func__, (__expected), (__actual), (__hint)) == false) \ { \ libtest::create_core(); \ return TEST_FAILURE; \ @@ -230,16 +230,10 @@ do \ } while (0) -#define test_strcmp(A,B) \ +#define test_strcmp(__expected, __actual) \ do \ { \ - if ((A) == NULL or (B) == NULL or strcmp((A), (B))) \ - { \ - if ((B) == NULL) fprintf(stderr, "\n%s:%d: Expected %s, got \n", __FILE__, __LINE__, (A)); \ - else fprintf(stderr, "\n%s:%d: Expected %s, got \"%s\"\n", __FILE__, __LINE__, (A), (B)); \ - libtest::create_core(); \ - return TEST_FAILURE; \ - } \ + void(libtest::_compare_strcmp(__FILE__, __LINE__, __func__, (__expected), (__actual))); \ } while (0) #define test_memcmp(A,B,C) \