wrbuf_destroy allows NULL WRBUF passed to it
[yaz-moved-to-github.git] / test / tstwrbuf.c
index 5888afe..af06e40 100644 (file)
@@ -1,8 +1,6 @@
-/*
- * 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.5 2006-01-29 21:59:13 adam Exp $
  */
 
 #include <stdlib.h>
 static void tstwrbuf(void)
 {
     int step;
-    WRBUF wr = wrbuf_alloc();
+    WRBUF wr;
 
-    YAZ_CHECK(wr);
+    wr = 0;
+    wrbuf_destroy(wr);
 
-    wrbuf_free(wr, 1);
+    wr = wrbuf_alloc();
+    YAZ_CHECK(wr);
+    wrbuf_destroy(wr);
 
     wr = wrbuf_alloc();
 
@@ -50,7 +51,7 @@ static void tstwrbuf(void)
             }
         wrbuf_rewind(wr);
     }
-    wrbuf_free(wr, 1);
+    wrbuf_destroy(wr);
 }
 
 int main (int argc, char **argv)
@@ -63,6 +64,7 @@ int main (int argc, char **argv)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab