X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Ftest.h;h=c57b1975982b8645e1c4d0f5d6a2837980132edd;hb=3f282496986cbae7fd4bd7f95d44bf47a2cc6874;hp=ac4f8798eb77073b84a1dd84ad7f9999f47c837b;hpb=3086f0e19e38428814c7da92fcaf21eba2bc9a64;p=yaz-moved-to-github.git diff --git a/include/yaz/test.h b/include/yaz/test.h index ac4f879..c57b197 100644 --- a/include/yaz/test.h +++ b/include/yaz/test.h @@ -1,19 +1,29 @@ /* - * Copyright (C) 1995-2005, Index Data ApS + * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: test.h,v 1.4 2006-01-30 14:02:06 adam Exp $ + * $Id: test.h,v 1.6 2006-05-10 12:52:17 heikki Exp $ */ +/** \file test.h + \brief Unit Test for YAZ +*/ + #ifndef YAZ_TEST_H #define YAZ_TEST_H #include #include +/** \brief Get the verbosity level */ +int yaz_test_get_verbosity(); + +/** \brief Test OK */ #define YAZ_TEST_TYPE_OK 1 +/** \brief Test failed */ #define YAZ_TEST_TYPE_FAIL 2 +/** \brief boolean test. as only evaluated once */ #define YAZ_CHECK(as) { \ if (as) { \ yaz_check_print1(YAZ_TEST_TYPE_OK, __FILE__, __LINE__, #as); \ @@ -22,6 +32,7 @@ } \ } +/** \brief equality test. left, right only evaluated once */ #define YAZ_CHECK_EQ(left, right) { \ int lval = left; \ int rval = right; \ @@ -34,18 +45,24 @@ } \ } +/** \brief Macro to initialize the system (in start of main typically) */ #define YAZ_CHECK_INIT(argc, argv) yaz_check_init1(&argc, &argv) +/** \brief Macro to terminate the system (end of main, normally) */ #define YAZ_CHECK_TERM yaz_check_term1(); return 0 + YAZ_BEGIN_CDECL +/** \brief used by macro. Should not be called directly */ YAZ_EXPORT void yaz_check_init1(int *argc, char ***argv); +/** \brief used by macro. Should not be called directly */ YAZ_EXPORT void yaz_check_term1(void); +/** \brief used by macro. Should not be called directly */ YAZ_EXPORT void yaz_check_print1(int type, const char *file, int line, const char *expr); +/** \brief used by macro. Should not be called directly */ 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