X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ftest.h;h=d349e54ae0ee3603b6f1cc1f101b4168409de13d;hb=fe4757c512265eef4f8905b3392f19d33c436ddf;hp=abd4e2aa4184f2babd6abc9ea1f14d86de925db6;hpb=751e342e158ae65052ce098ccd64aa54e39312db;p=m6w6%2Flibmemcached diff --git a/libtest/test.h b/libtest/test.h index abd4e2aa..d349e54a 100644 --- a/libtest/test.h +++ b/libtest/test.h @@ -89,10 +89,19 @@ do \ } while (0) #define test_true_hint test_true_got -#define test_skip(A,B) \ +#define test_skip(__expected, __actual) \ do \ { \ - if ((A) != (B)) \ + if (libtest::_compare(__FILE__, __LINE__, __func__, ((__expected)), ((__actual)), false) == false) \ + { \ + return TEST_SKIPPED; \ + } \ +} while (0) + +#define test_skip_valgrind() \ +do \ +{ \ + if (libtest::_in_valgrind(__FILE__, __LINE__, __func__)) \ { \ return TEST_SKIPPED; \ } \ @@ -129,10 +138,20 @@ do \ } \ } while (0) +#define test_ne_compare(__expected, __actual) \ +do \ +{ \ + if (libtest::_ne_compare_hint(__FILE__, __LINE__, __func__, ((__expected)), ((__actual)), true) == false) \ + { \ + libtest::create_core(); \ + return TEST_FAILURE; \ + } \ +} while (0) + #define test_compare(__expected, __actual) \ do \ { \ - if (not libtest::_compare(__FILE__, __LINE__, __func__, ((__expected)), ((__actual)))) \ + if (libtest::_compare(__FILE__, __LINE__, __func__, ((__expected)), ((__actual)), true) == false) \ { \ libtest::create_core(); \ return TEST_FAILURE; \ @@ -166,7 +185,7 @@ do \ #define test_compare_warn(__expected, __actual) \ do \ { \ - void(libtest::_compare(__FILE__, __LINE__, __func__, (__expected), (__actual))); \ + void(libtest::_compare(__FILE__, __LINE__, __func__, (__expected), (__actual)), true); \ } while (0) #define test_compare_warn_hint(__expected, __actual, __hint) \