yaz_query2xml complete and tested
[yaz-moved-to-github.git] / include / yaz / test.h
index 6d767bb..ac4f879 100644 (file)
@@ -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
   } \
 }
 
+#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
 /*