2 * Copyright (C) 1995-2005, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: test.h,v 1.4 2006-01-30 14:02:06 adam Exp $
11 #include <yaz/yconfig.h>
14 #define YAZ_TEST_TYPE_OK 1
15 #define YAZ_TEST_TYPE_FAIL 2
17 #define YAZ_CHECK(as) { \
19 yaz_check_print1(YAZ_TEST_TYPE_OK, __FILE__, __LINE__, #as); \
21 yaz_check_print1(YAZ_TEST_TYPE_FAIL, __FILE__, __LINE__, #as); \
25 #define YAZ_CHECK_EQ(left, right) { \
29 yaz_check_eq1(YAZ_TEST_TYPE_OK, __FILE__, __LINE__, \
30 #left, #right, lval, rval); \
32 yaz_check_eq1(YAZ_TEST_TYPE_FAIL, __FILE__, __LINE__, \
33 #left, #right, lval, rval); \
37 #define YAZ_CHECK_INIT(argc, argv) yaz_check_init1(&argc, &argv)
38 #define YAZ_CHECK_TERM yaz_check_term1(); return 0
41 YAZ_EXPORT void yaz_check_init1(int *argc, char ***argv);
42 YAZ_EXPORT void yaz_check_term1(void);
43 YAZ_EXPORT void yaz_check_print1(int type, const char *file, int line,
45 YAZ_EXPORT void yaz_check_eq1(int type, const char *file, int line,
46 const char *left, const char *right,
55 * indent-tabs-mode: nil
57 * vim: shiftwidth=4 tabstop=8 expandtab