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
Make an MARC conversion trie for each characterSet section rather than
[yaz-moved-to-github.git]
/
test
/
tstnmem.c
diff --git
a/test/tstnmem.c
b/test/tstnmem.c
index
284e0a8
..
4d51ed7
100644
(file)
--- a/
test/tstnmem.c
+++ b/
test/tstnmem.c
@@
-1,8
+1,8
@@
/*
/*
- * 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: tstnmem.c,v 1.1 2003-10-27 12:21:38 adam Exp $
+ * $Id: tstnmem.c,v 1.8 2007-04-17 20:26:18 adam Exp $
*/
#if HAVE_CONFIG_H
*/
#if HAVE_CONFIG_H
@@
-11,34
+11,54
@@
#include <errno.h>
#include <string.h>
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
#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();
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);
+ YAZ_CHECK(cp);
+ if (sizeof(long) >= j)
+ *(long*) cp = 123L;
+#if HAVE_LONG_LONG
+ if (sizeof(long long) >= j)
+ *(long long*) cp = 123L;
+#endif
+ 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_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
+ */
+