X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstwrbuf.c;h=c9c434980b27ea4da2d0a05aee5e6421ee0d3593;hb=173f78f50536784bdc6a59d4586ba409b2b69182;hp=bab20046ce9e981739d175caa0c28d81c13f3da7;hpb=6bc4a3e8b7e73275e8b37e6de40e4c596302bd51;p=yaz-moved-to-github.git diff --git a/test/tstwrbuf.c b/test/tstwrbuf.c index bab2004..c9c4349 100644 --- a/test/tstwrbuf.c +++ b/test/tstwrbuf.c @@ -1,24 +1,27 @@ -/* - * Copyright (C) 1995-2005, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2009 Index Data * See the file LICENSE for details. - * - * $Id: tstwrbuf.c,v 1.3 2005-02-01 17:23:36 adam Exp $ */ #include #include #include +#include -int main (int argc, char **argv) +static void tstwrbuf(void) { int step; WRBUF wr = wrbuf_alloc(); - wrbuf_free(wr, 1); + YAZ_CHECK(wr); + + wrbuf_destroy(wr); wr = wrbuf_alloc(); + YAZ_CHECK(wr); + for (step = 1; step < 65; step++) { int i, j, k; @@ -35,25 +38,32 @@ 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