projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed yaz_iconv to return YAZ_ICONV_EINVAL if an incomplete MARC-8
[yaz-moved-to-github.git]
/
test
/
tstwrbuf.c
diff --git
a/test/tstwrbuf.c
b/test/tstwrbuf.c
index
8ac3d0b
..
e1ed5f6
100644
(file)
--- a/
test/tstwrbuf.c
+++ b/
test/tstwrbuf.c
@@
-1,23
+1,29
@@
/*
/*
- * Copyright (c) 2002-2003, Index Data
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: tstwrbuf.c,v 1.1 2003-10-27 12:21:38 adam Exp $
+ * $Id: tstwrbuf.c,v 1.6 2007-01-03 08:42:16 adam Exp $
*/
*/
+#include <stdlib.h>
#include <stdio.h>
#include <yaz/wrbuf.h>
#include <stdio.h>
#include <yaz/wrbuf.h>
+#include <yaz/test.h>
-int main (int argc, char **argv)
+static void tstwrbuf(void)
{
int step;
WRBUF wr = wrbuf_alloc();
{
int step;
WRBUF wr = wrbuf_alloc();
+ YAZ_CHECK(wr);
+
wrbuf_free(wr, 1);
wr = wrbuf_alloc();
wrbuf_free(wr, 1);
wr = wrbuf_alloc();
+ YAZ_CHECK(wr);
+
for (step = 1; step < 65; step++)
{
int i, j, k;
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);
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<step; j++)
for (i = 0; i<j; i++)
{
k = 0;
for (j = 1; j<step; j++)
for (i = 0; i<j; i++)
{
- if (cp[k] != i+1)
- {
- printf ("tstwrbuf 2 %d k=%d\n", step, k);
- exit(1);
- }
+ YAZ_CHECK(cp[k] == i+1);
k++;
}
wrbuf_rewind(wr);
}
wrbuf_free(wr, 1);
k++;
}
wrbuf_rewind(wr);
}
wrbuf_free(wr, 1);
- exit(0);
}
}
+int main (int argc, char **argv)
+{
+ YAZ_CHECK_INIT(argc, argv);
+ tstwrbuf();
+ YAZ_CHECK_TERM;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+