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 marc8 flush to deal with sub/sup scripts. Refactor marc-8 page
[yaz-moved-to-github.git]
/
test
/
tstwrbuf.c
diff --git
a/test/tstwrbuf.c
b/test/tstwrbuf.c
index
bab2004
..
e1ed5f6
100644
(file)
--- a/
test/tstwrbuf.c
+++ b/
test/tstwrbuf.c
@@
-1,24
+1,29
@@
/*
/*
- * Copyright (C) 1995-2005, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: tstwrbuf.c,v 1.3 2005-02-01 17:23:36 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 <stdlib.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;
@@
-35,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
+ */
+