X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstwrbuf.c;h=af06e40d800b407c2d0cc254717121ea29815b55;hb=055f23ee3692349a03f681ef1a0d5fd70c0cc770;hp=a31115ee0621af69ec235ed368edab1b4f306a73;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505;p=yaz-moved-to-github.git diff --git a/test/tstwrbuf.c b/test/tstwrbuf.c index a31115e..af06e40 100644 --- a/test/tstwrbuf.c +++ b/test/tstwrbuf.c @@ -1,24 +1,30 @@ -/* - * Copyright (C) 1995-2005, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. - * - * $Id: tstwrbuf.c,v 1.4 2005-06-25 15:46:07 adam Exp $ */ #include #include #include +#include -int main (int argc, char **argv) +static void tstwrbuf(void) { int step; - WRBUF wr = wrbuf_alloc(); + WRBUF wr; + + wr = 0; + wrbuf_destroy(wr); - wrbuf_free(wr, 1); + wr = wrbuf_alloc(); + YAZ_CHECK(wr); + wrbuf_destroy(wr); wr = wrbuf_alloc(); + YAZ_CHECK(wr); + for (step = 1; step < 65; step++) { int i, j, k; @@ -35,31 +41,30 @@ 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