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
/
tstnmem.c
diff --git
a/test/tstnmem.c
b/test/tstnmem.c
index
2ed2e56
..
930d18c
100644
(file)
--- a/
test/tstnmem.c
+++ b/
test/tstnmem.c
@@
-1,8
+1,8
@@
/*
/*
- * 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: tstnmem.c,v 1.4 2005-01-15 19:47:15 adam Exp $
+ * $Id: tstnmem.c,v 1.7 2007-01-03 08:42:16 adam Exp $
*/
#if HAVE_CONFIG_H
*/
#if HAVE_CONFIG_H
@@
-15,39
+15,52
@@
#include <ctype.h>
#include <yaz/nmem.h>
#include <ctype.h>
#include <yaz/nmem.h>
+#include <yaz/test.h>
-int main (int argc, char **argv)
+void tst(void)
{
{
- void *cp;
NMEM n;
int j;
NMEM n;
int j;
+ char *cp;
nmem_init();
n = nmem_create();
nmem_init();
n = nmem_create();
- if (!n)
- exit (1);
+ YAZ_CHECK(n);
+
for (j = 1; j<500; j++)
{
cp = nmem_malloc(n, j);
for (j = 1; j<500; j++)
{
cp = nmem_malloc(n, j);
- if (!cp)
- exit(2);
- if (sizeof(long) >= j)
- *(long*) cp = 123L;
+ YAZ_CHECK(cp);
+ if (sizeof(long) >= j)
+ *(long*) cp = 123L;
#if HAVE_LONG_LONG
#if HAVE_LONG_LONG
- if (sizeof(long long) >= j)
- *(long long*) cp = 123L;
+ if (sizeof(long long) >= j)
+ *(long long*) cp = 123L;
#endif
#endif
- if (sizeof(double) >= j)
- *(double*) cp = 12.2;
+ if (sizeof(double) >= j)
+ *(double*) cp = 12.2;
}
for (j = 2000; j<20000; j+= 2000)
{
cp = nmem_malloc(n, j);
}
for (j = 2000; j<20000; j+= 2000)
{
cp = nmem_malloc(n, j);
- if (!cp)
- exit(3);
+ YAZ_CHECK(cp);
}
nmem_destroy(n);
nmem_exit();
}
nmem_destroy(n);
nmem_exit();
- exit(0);
}
}
+
+int main (int argc, char **argv)
+{
+ YAZ_CHECK_INIT(argc, argv);
+ tst();
+ YAZ_CHECK_TERM;
+}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+