X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstwrbuf.c;h=5888afedd1ebbcc02028d3257efea98a9426e3f5;hb=c168cffc46e3b2b66e66e48f94f8e87b6566702b;hp=fab5c114964235edb7db55fd6cfa2408175029cd;hpb=4c176312acdc3444c9afc820f76a393e64668e52;p=yaz-moved-to-github.git diff --git a/test/tstwrbuf.c b/test/tstwrbuf.c index fab5c11..5888afe 100644 --- a/test/tstwrbuf.c +++ b/test/tstwrbuf.c @@ -2,22 +2,28 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstwrbuf.c,v 1.2 2005-01-15 19:47:15 adam Exp $ + * $Id: tstwrbuf.c,v 1.5 2006-01-29 21:59:13 adam Exp $ */ +#include #include #include +#include -int main (int argc, char **argv) +static void tstwrbuf(void) { int step; WRBUF wr = wrbuf_alloc(); + YAZ_CHECK(wr); + wrbuf_free(wr, 1); wr = wrbuf_alloc(); + YAZ_CHECK(wr); + for (step = 1; step < 65; step++) { int i, j, k; @@ -34,25 +40,31 @@ int main (int argc, char **argv) cp = wrbuf_buf(wr); len = wrbuf_len(wr); - if (len != step * (step-1) / 2) - { - printf ("tstwrbuf 1 %d len=%d\n", step, len); - exit(1); - } + YAZ_CHECK(len == step * (step-1) / 2); k = 0; for (j = 1; j