X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Ftest.h;h=ac4f8798eb77073b84a1dd84ad7f9999f47c837b;hb=1f3fe256d54ab81d998cd622abda89580cc0b3ff;hp=6d767bb813abb2cb595bb04a6807745b9cbde17f;hpb=06ae818deffa84ec4bc1308051ef411845dd4ce5;p=yaz-moved-to-github.git diff --git a/include/yaz/test.h b/include/yaz/test.h index 6d767bb..ac4f879 100644 --- a/include/yaz/test.h +++ b/include/yaz/test.h @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: test.h,v 1.3 2006-01-29 21:59:12 adam Exp $ + * $Id: test.h,v 1.4 2006-01-30 14:02:06 adam Exp $ */ #ifndef YAZ_TEST_H @@ -22,6 +22,18 @@ } \ } +#define YAZ_CHECK_EQ(left, right) { \ + int lval = left; \ + int rval = right; \ + if (lval == rval) { \ + yaz_check_eq1(YAZ_TEST_TYPE_OK, __FILE__, __LINE__, \ + #left, #right, lval, rval); \ + } else { \ + yaz_check_eq1(YAZ_TEST_TYPE_FAIL, __FILE__, __LINE__, \ + #left, #right, lval, rval); \ + } \ +} + #define YAZ_CHECK_INIT(argc, argv) yaz_check_init1(&argc, &argv) #define YAZ_CHECK_TERM yaz_check_term1(); return 0 @@ -30,8 +42,11 @@ YAZ_EXPORT void yaz_check_init1(int *argc, char ***argv); YAZ_EXPORT void yaz_check_term1(void); YAZ_EXPORT void yaz_check_print1(int type, const char *file, int line, const char *expr); -YAZ_END_CDECL +YAZ_EXPORT void yaz_check_eq1(int type, const char *file, int line, + const char *left, const char *right, + int lval, int rval); +YAZ_END_CDECL #endif /*