X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Ftest.c;h=1fc47c2d84ec28fee8bf98ef0ab6bc6c357581f0;hb=16ee7ff60aee87829916837bcb2a200ce72870d9;hp=967b53b2a28cb99305375291f3cc5a13f40c7fe3;hpb=06ae818deffa84ec4bc1308051ef411845dd4ce5;p=yaz-moved-to-github.git diff --git a/src/test.c b/src/test.c index 967b53b..1fc47c2 100644 --- a/src/test.c +++ b/src/test.c @@ -2,8 +2,13 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: test.c,v 1.3 2006-01-29 21:59:13 adam Exp $ + * $Id: test.c,v 1.5 2006-04-20 20:50:51 adam Exp $ */ + +/** \file test.c + \brief Unit Test for YAZ +*/ + #if HAVE_CONFIG_H #include #endif @@ -118,7 +123,17 @@ void yaz_check_term1(void) exit(0); } -void yaz_check_print1(int type, const char *file, int line, const char *expr) +void yaz_check_eq1(int type, const char *file, int line, + const char *left, const char *right, int lval, int rval) +{ + char formstr[2048]; + + sprintf(formstr, "%.500s != %.500s\n%d != %d", left, right, lval, rval); + yaz_check_print1(type, file, line, formstr); +} + +void yaz_check_print1(int type, const char *file, int line, + const char *expr) { const char *msg = "unknown"; @@ -137,7 +152,8 @@ void yaz_check_print1(int type, const char *file, int line, const char *expr) return; break; } - fprintf(get_file(), "%s:%d %s: %s\n", file, line, msg, expr); + fprintf(get_file(), "%s:%d %s: ", file, line, msg); + fprintf(get_file(), "%s\n", expr); }