summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-01-06 03:07:15 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-01-06 03:07:15 (GMT)
commit1d17defdfc977c063c7ff20b5868bef9a76e5d9a (patch)
tree718aad3e93d1406d4a97a0fcafeb3f7acd8720db /test
parentdfff2572ca834f41d27510244d2886170626b265 (diff)
downloadhdf5-1d17defdfc977c063c7ff20b5868bef9a76e5d9a.zip
hdf5-1d17defdfc977c063c7ff20b5868bef9a76e5d9a.tar.gz
hdf5-1d17defdfc977c063c7ff20b5868bef9a76e5d9a.tar.bz2
[svn-r150] Changes since 19971219
---------------------- ./src/H5private.h Changed HDF5_MAJOR_VERSION to 5 ./src/H5Aprivate.h ./src/H5Apublic.h Added group atoms. ./src/H5D.c ./src/H5P.c ./test/istore.c ./test/tohdr.c ./test/tstab.c Updated for symbol table interface changes. ./src/H5F.c ./src/H5Fprivate.h Simpler handling of special case files: empty files and files with a single object. ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5Gpublic.h ./src/H5Gshad.c (DELETED) ./src/H5Gstab.c ./src/Makefile.in Removed shadows, simplifying code. Symbol table entries are allowed to cache only constant meta data. Fixed naming. ./src/H5O.c ./src/H5Oprivate.h Access to object headers is always done through a symbol table entry instead of a file address. Added stubs for opening and closing object headers to be used when deletion is implemented.
Diffstat (limited to 'test')
-rw-r--r--test/istore.c67
-rw-r--r--test/testhdf5.c4
-rw-r--r--test/tohdr.c47
-rw-r--r--test/tstab.c128
4 files changed, 126 insertions, 120 deletions
diff --git a/test/istore.c b/test/istore.c
index 580518b..81ae8c2 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -15,10 +15,10 @@
#include <H5Oprivate.h>
#include <H5Vprivate.h>
-#if 0
+#if 1
# define FILETYPE H5F_LOW_DFLT
# define FILENAME "istore.h5"
-#elif 1
+#elif 0
# define FILETYPE H5F_LOW_FAM
# define FILENAME "istore-%05d.h5"
# define TEST_FAMILY 1
@@ -96,22 +96,21 @@ print_array (uint8 *array, size_t nx, size_t ny, size_t nz)
*
*-------------------------------------------------------------------------
*/
-static H5G_entry_t *
-new_object (H5F_t *f, const char *name, size_t ndims)
+static int
+new_object (H5F_t *f, const char *name, size_t ndims, H5G_entry_t *ent/*out*/)
{
- H5G_entry_t *handle = NULL;
H5O_istore_t istore;
size_t alignment[H5O_ISTORE_NDIMS];
intn i;
- /* Create the object symbol table entry and header */
- if (NULL==(handle=H5G_create (f, name, 64))) {
+ /* Create the object header */
+ if (H5O_create (f, 64, ent)) {
puts ("*FAILED*");
if (!isatty (1)) {
AT ();
- printf (" H5G_create (f, name=\"%s\") = NULL\n", name);
+ printf (" H5O_create() = NULL\n");
}
- return NULL;
+ return -1;
}
/* Add the indexed-storage message */
@@ -122,19 +121,30 @@ new_object (H5F_t *f, const char *name, size_t ndims)
alignment[i] = 2;
}
}
-
H5F_istore_create (f, &istore, ndims, alignment);
- if (H5O_modify (f, NO_ADDR, handle, H5O_ISTORE, H5O_NEW_MESG,
- &istore)<0) {
+ if (H5O_modify (f, ent, H5O_ISTORE, H5O_NEW_MESG, &istore)<0) {
printf ("*FAILED*\n");
if (!isatty (1)) {
AT();
- printf (" H5G_modify istore message failure\n");
+ printf (" H5O_modify istore message failure\n");
}
- return NULL;
+ return -1;
}
- return handle;
+ /* Give the object header a name */
+ if (H5G_insert (f, name, ent)<0) {
+ printf ("*FAILED*\n");
+ if (!isatty (1)) {
+ AT ();
+ printf (" H5G_insert(f, name=\"%s\", ent) failed\n", name);
+ }
+ return -1;
+ }
+
+ /* Close the header */
+ H5O_close (f, ent);
+
+ return 0;
}
@@ -158,7 +168,7 @@ new_object (H5F_t *f, const char *name, size_t ndims)
static herr_t
test_create (H5F_t *f, const char *prefix)
{
- H5G_entry_t *handle = NULL;
+ H5G_entry_t handle;
intn i;
char name[256];
@@ -166,8 +176,7 @@ test_create (H5F_t *f, const char *prefix)
for (i=1; i<=H5O_ISTORE_NDIMS; i++) {
sprintf (name, "%s_%02d", prefix, i);
- if (NULL==(handle=new_object (f, name, i))) return FAIL;
- H5G_close (f, handle);
+ if (new_object (f, name, i, &handle)<0) return FAIL;
}
puts (" PASSED");
@@ -198,7 +207,7 @@ static herr_t
test_extend (H5F_t *f, const char *prefix,
size_t nx, size_t ny, size_t nz)
{
- H5G_entry_t *handle = NULL;
+ H5G_entry_t handle;
int i, j, k, ndims, ctr;
uint8 *buf=NULL, *check=NULL, *whole=NULL;
char dims[64], s[256], name[256];
@@ -234,14 +243,14 @@ test_extend (H5F_t *f, const char *prefix,
/* Build the new empty object */
sprintf (name, "%s_%s", prefix, dims);
- if (NULL==(handle=new_object (f, name, ndims))) {
+ if (new_object (f, name, ndims, &handle)<0) {
if (!isatty (1)) {
AT ();
printf (" Cannot create %d-d object `%s'\n", ndims, name);
}
goto error;
}
- if (NULL==H5O_read (f, NO_ADDR, handle, H5O_ISTORE, 0, &istore)) {
+ if (NULL==H5O_read (f, &handle, H5O_ISTORE, 0, &istore)) {
puts ("*FAILED*");
if (!isatty (1)) {
AT ();
@@ -377,7 +386,6 @@ test_extend (H5F_t *f, const char *prefix,
}
}
- H5G_close (f, handle);
puts (" PASSED");
H5MM_xfree (buf);
H5MM_xfree (check);
@@ -417,7 +425,7 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks,
intn ndims, ctr;
char dims[64], s[256], name[256];
size_t offset[3], size[3], total=0;
- H5G_entry_t *handle = NULL;
+ H5G_entry_t handle;
H5O_istore_t istore;
uint8 *buf = NULL;
@@ -443,14 +451,14 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks,
/* Build the new empty object */
sprintf (name, "%s_%s", prefix, dims);
- if (NULL==(handle=new_object (f, name, ndims))) {
+ if (new_object (f, name, ndims, &handle)<0) {
if (!isatty (1)) {
AT ();
printf (" Cannot create %d-d object `%s'\n", ndims, name);
}
goto error;
}
- if (NULL==H5O_read (f, NO_ADDR, handle, H5O_ISTORE, 0, &istore)) {
+ if (NULL==H5O_read (f, &handle, H5O_ISTORE, 0, &istore)) {
puts ("*FAILED*");
if (!isatty (1)) {
AT ();
@@ -493,7 +501,6 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks,
}
- H5G_close (f, handle);
puts (" PASSED");
H5MM_xfree (buf);
return SUCCEED;
@@ -528,9 +535,9 @@ main (int argc, char *argv[])
int nerrors = 0;
uintn size_of_test;
size_t offset_size;
- H5G_entry_t *ent = NULL;
hid_t template_id;
H5F_create_t *creation_template = NULL;
+ H5G_t *dir = NULL;
setbuf (stdout, NULL);
@@ -591,9 +598,9 @@ main (int argc, char *argv[])
* By creating a group we cause the library to emit it's debugging
* diagnostic messages before we begin testing...
*/
- ent = H5G_new (f, "flushing_diagnostics", 0);
- H5G_close (f, ent);
- ent = NULL;
+ dir = H5G_create (f, "flushing_diagnostics", 0);
+ H5G_close (dir);
+ dir = NULL;
/*
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 716a740..93e059a 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -163,8 +163,8 @@ int main(int argc, char *argv[])
H5version(&major, &minor, &release, &patch);
print_func("\nFor help use: testhdf5 -help\n");
- print_func("Built with HDF5 Library Version: %u.%ur%u, patch %u\n\n", (unsigned) major,
- (unsigned) minor, (unsigned) release, (unsigned)patch);
+ print_func("Linked with HDF %u.%u.%u%c\n\n", (unsigned) major,
+ (unsigned) minor, (unsigned) release, 'a'+patch);
for (CLLoop = 1; CLLoop < argc; CLLoop++)
{
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) ||
diff --git a/test/tohdr.c b/test/tohdr.c
index 5c0711d..9965092 100644
--- a/test/tohdr.c
+++ b/test/tohdr.c
@@ -49,11 +49,10 @@ test_ohdr (void)
{
hid_t fid;
H5F_t *f;
- haddr_t oh_addr;
+ H5G_entry_t oh_ent;
H5O_stab_t stab, ro;
herr_t status;
void *ptr;
- H5G_entry_t ent;
int i;
MESSAGE (5, ("Testing Object Headers\n"));
@@ -66,7 +65,7 @@ test_ohdr (void)
/* the new object header */
MESSAGE (8, ("Creating new object header...\n"));
- status = H5O_create (f, 1, 64, &oh_addr/*out*/);
+ status = H5O_create (f, 64, &oh_ent/*out*/);
CHECK_I (status, "H5O_new");
/*
@@ -75,11 +74,11 @@ test_ohdr (void)
MESSAGE (8, ("Creating new message...\n"));
stab.btree_addr.offset = 11111111;
stab.heap_addr.offset = 22222222;
- status = H5O_modify (f, &oh_addr, NULL, H5O_STAB, H5O_NEW_MESG, &stab);
+ status = H5O_modify (f, &oh_ent, H5O_STAB, H5O_NEW_MESG, &stab);
VERIFY (status, 0, "H5O_modify");
H5AC_flush (f, NULL, 0, TRUE);
- ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 0, &ro);
+ ptr = H5O_read (f, &oh_ent, H5O_STAB, 0, &ro);
CHECK_PTR (ptr, "H5O_read");
VERIFY (ptr, &ro, "H5O_read");
VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read");
@@ -91,11 +90,11 @@ test_ohdr (void)
MESSAGE (8, ("Modifying message...\n"));
stab.btree_addr.offset = 33333333;
stab.heap_addr.offset = 44444444;
- status = H5O_modify (f, &oh_addr, NULL, H5O_STAB, 0, &stab);
+ status = H5O_modify (f, &oh_ent, H5O_STAB, 0, &stab);
VERIFY (status, 0, "H5O_modify");
H5AC_flush (f, NULL, 0, TRUE);
- ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 0, &ro);
+ ptr = H5O_read (f, &oh_ent, H5O_STAB, 0, &ro);
CHECK_PTR (ptr, "H5O_read");
VERIFY (ptr, &ro, "H5O_read");
VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read");
@@ -106,22 +105,19 @@ test_ohdr (void)
* table.
*/
MESSAGE (8, ("Creating a duplicate message...\n"));
- ent.header.offset = 0;
- ent.type = H5G_NOTHING_CACHED;
- ent.dirty = FALSE;
stab.btree_addr.offset = 55555555;
stab.heap_addr.offset = 66666666;
- status = H5O_modify (f, &oh_addr, &ent, H5O_STAB, H5O_NEW_MESG, &stab);
+ status = H5O_modify (f, &oh_ent, H5O_STAB, H5O_NEW_MESG, &stab);
VERIFY (status, 1, "H5O_modify");
- VERIFY (ent.dirty, TRUE, "H5O_modify");
- VERIFY (ent.type, H5G_CACHED_STAB, "H5O_modify");
- VERIFY (ent.cache.stab.heap_addr.offset, stab.heap_addr.offset,
+ VERIFY (oh_ent.dirty, TRUE, "H5O_modify");
+ VERIFY (oh_ent.type, H5G_CACHED_STAB, "H5O_modify");
+ VERIFY (oh_ent.cache.stab.heap_addr.offset, stab.heap_addr.offset,
"H5O_modify");
- VERIFY (ent.cache.stab.btree_addr.offset, stab.btree_addr.offset,
+ VERIFY (oh_ent.cache.stab.btree_addr.offset, stab.btree_addr.offset,
"H5O_modify");
H5AC_flush (f, NULL, 0, TRUE);
- ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 1, &ro);
+ ptr = H5O_read (f, &oh_ent, H5O_STAB, 1, &ro);
CHECK_PTR (ptr, "H5O_read");
VERIFY (ptr, &ro, "H5O_read");
VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read");
@@ -131,20 +127,19 @@ test_ohdr (void)
* Test modification of the second message with a symbol table.
*/
MESSAGE (8, ("Modifying the duplicate message...\n"));
- ent.dirty = FALSE;
stab.btree_addr.offset = 77777777;
stab.heap_addr.offset = 88888888;
- status = H5O_modify (f, &oh_addr, &ent, H5O_STAB, 1, &stab);
+ status = H5O_modify (f, &oh_ent, H5O_STAB, 1, &stab);
VERIFY (status, 1, "H5O_modify");
- VERIFY (ent.dirty, TRUE, "H5O_modify");
- VERIFY (ent.type, H5G_CACHED_STAB, "H5O_modify");
- VERIFY (ent.cache.stab.heap_addr.offset, stab.heap_addr.offset,
+ VERIFY (oh_ent.dirty, TRUE, "H5O_modify");
+ VERIFY (oh_ent.type, H5G_CACHED_STAB, "H5O_modify");
+ VERIFY (oh_ent.cache.stab.heap_addr.offset, stab.heap_addr.offset,
"H5O_modify");
- VERIFY (ent.cache.stab.btree_addr.offset, stab.btree_addr.offset,
+ VERIFY (oh_ent.cache.stab.btree_addr.offset, stab.btree_addr.offset,
"H5O_modify");
H5AC_flush (f, NULL, 0, TRUE);
- ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 1, &ro);
+ ptr = H5O_read (f, &oh_ent, H5O_STAB, 1, &ro);
CHECK_PTR (ptr, "H5O_read");
VERIFY (ptr, &ro, "H5O_read");
VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read");
@@ -158,7 +153,7 @@ test_ohdr (void)
for (i=0; i<40; i++) {
stab.btree_addr.offset = (i+1)*1000 + 1;
stab.heap_addr.offset = (i+1)*1000 + 2;
- status = H5O_modify (f, &oh_addr, NULL, H5O_STAB, H5O_NEW_MESG, &stab);
+ status = H5O_modify (f, &oh_ent, H5O_STAB, H5O_NEW_MESG, &stab);
VERIFY (status, 2+i, "H5O_modify");
}
H5AC_flush (f, NULL, 0, TRUE);
@@ -171,7 +166,7 @@ test_ohdr (void)
for (i=0; i<10; i++) {
stab.btree_addr.offset = (i+1)*1000 + 10;
stab.heap_addr.offset = (i+1)*1000 + 20;
- status = H5O_modify (f, &oh_addr, NULL, H5O_STAB, H5O_NEW_MESG, &stab);
+ status = H5O_modify (f, &oh_ent, H5O_STAB, H5O_NEW_MESG, &stab);
VERIFY (status, 42+i, "H5O_modify");
H5AC_flush (f, NULL, 0, TRUE);
}
@@ -179,7 +174,7 @@ test_ohdr (void)
/*
* Delete all symbol table messages.
*/
- status = H5O_remove (f, &oh_addr, NULL, H5O_STAB, H5O_ALL);
+ status = H5O_remove (f, &oh_ent, H5O_STAB, H5O_ALL);
CHECK_I (status, "H5O_remove");
/* close the file */
diff --git a/test/tstab.c b/test/tstab.c
index e2384f8..c5542ee 100644
--- a/test/tstab.c
+++ b/test/tstab.c
@@ -18,6 +18,7 @@
#include <H5private.h>
#include <H5ACprivate.h>
+#include <H5Cprivate.h>
#include <H5Fprivate.h>
#include <H5Gprivate.h>
#include <H5Oprivate.h>
@@ -51,8 +52,7 @@ test_1 (void)
{
hid_t fid;
H5F_t *f;
- H5G_entry_t *obj1=NULL, *obj2=NULL;
- H5G_entry_t ent1, dir_ent;
+ H5G_entry_t ent1, ent2, obj_ent, dir_ent;
herr_t status;
H5O_name_t name_mesg;
void *status_ptr;
@@ -73,26 +73,28 @@ test_1 (void)
CHECK (f, NULL, "H5Aatom_object");
/* create the object */
- obj1 = H5G_create (f, "/", 0);
- CHECK_PTR (obj1, "H5G_new");
+ status = H5O_create (f, 0, &ent1);
+ CHECK_I (status, "H5O_create");
+ status = H5G_insert (f, "/", &ent1);
+ CHECK_I (status, "H5G_insert");
/* look for a name message -- it shouldn't be present */
- status_ptr = H5O_read (f, NO_ADDR, obj1, H5O_NAME, 0, &name_mesg);
+ status_ptr = H5O_read (f, &ent1, H5O_NAME, 0, &name_mesg);
VERIFY (status_ptr, NULL, "H5O_read [didn't fail but should have]");
/*
* Test 1B: Attempt to read the root object using the name `/'.
*/
memset (&dir_ent, 0xff, sizeof(H5G_entry_t));
- memset (&ent1, 0xff, sizeof(H5G_entry_t));
- status = H5G_find (f, "/", &dir_ent, &ent1);
+ memset (&obj_ent, 0xff, sizeof(H5G_entry_t));
+ status = H5G_find (f, "/", &dir_ent, &obj_ent);
CHECK_I (status, "H5G_find");
/* Is it really the root object? */
b = H5F_addr_defined (&(dir_ent.header));
- VERIFY (b, FALSE, "H5G_create");
- b = H5F_addr_eq (&(ent1.header), &(obj1->header));
- VERIFY (b, TRUE, "H5G_create");
+ VERIFY (b, FALSE, "H5G_insert");
+ b = H5F_addr_eq (&(obj_ent.header), &(ent1.header));
+ VERIFY (b, TRUE, "H5G_insert");
/*
@@ -101,24 +103,20 @@ test_1 (void)
*/
/* create the object */
- obj2 = H5G_create (f, "/second", 0);
- CHECK_PTR (obj2, "H5G_new");
+ status = H5O_create (f, 0, &ent2);
+ CHECK_I (status, "H5O_create");
+ status = H5G_insert (f, "/second", &ent2);
+ CHECK_I (status, "H5G_insert");
/* try to read the first object */
- HDmemset (&ent1, 0xff, sizeof(H5G_entry_t));
- status = H5G_find (f, "/Root Object", NULL, &ent1);
+ HDmemset (&obj_ent, 0xff, sizeof(H5G_entry_t));
+ status = H5G_find (f, "/Root Object", NULL, &obj_ent);
CHECK_I (status, "H5G_find");
- b = H5F_addr_defined (&(ent1.header));
- VERIFY (b, TRUE, "H5G_create");
- b = H5F_addr_eq (&(ent1.header), &(obj1->header));
+ b = H5F_addr_defined (&(obj_ent.header));
+ VERIFY (b, TRUE, "H5G_insert");
+ b = H5F_addr_eq (&(obj_ent.header), &(ent1.header));
VERIFY (b, TRUE, "H5G_create");
- /* close the objects */
- H5G_close (f, obj1);
- obj1 = NULL;
- H5G_close (f, obj2);
- obj2 = NULL;
-
/* close the file */
H5Fclose (fid);
@@ -137,14 +135,16 @@ test_1 (void)
CHECK (f, NULL, "H5Aatom_object");
/* create the object */
- obj1 = H5G_create (f, "/foo", 0);
- CHECK_PTR (obj1, "H5G_create");
+ status = H5O_create (f, 0, &ent1);
+ CHECK_I (status, "H5O_create");
+ status = H5G_insert (f, "/foo", &ent1);
+ CHECK_I (status, "H5G_insert");
/* does it have the correct name message? */
- status_ptr = H5O_read (f, NO_ADDR, obj1, H5O_NAME, 0, &name_mesg);
+ status_ptr = H5O_read (f, &ent1, H5O_NAME, 0, &name_mesg);
CHECK_PTR (status_ptr, "H5O_read");
CHECK_PTR (name_mesg.s, "H5O_read");
- VERIFY (strcmp(name_mesg.s, "foo"), 0, "H5O_read");
+ VERIFY (strcmp(name_mesg.s, "foo"), 0, "H5G_insert");
if (status_ptr) H5O_reset (H5O_NAME, &name_mesg); /*free message data*/
@@ -152,23 +152,23 @@ test_1 (void)
* Test 1E: Try to read the root object with the name `/' and `/foo'
*/
HDmemset (&dir_ent, 0, sizeof(H5G_entry_t));
- HDmemset (&ent1, 0, sizeof(H5G_entry_t));
- status = H5G_find (f, "/", &dir_ent, &ent1);
+ HDmemset (&obj_ent, 0, sizeof(H5G_entry_t));
+ status = H5G_find (f, "/", &dir_ent, &obj_ent);
CHECK_I (status, "H5G_find");
b = H5F_addr_defined (&(dir_ent.header));
- VERIFY (b, FALSE, "H5G_create");
- b = H5F_addr_eq (&(ent1.header), &(obj1->header));
- VERIFY (b, TRUE, "H5G_create");
+ VERIFY (b, FALSE, "H5G_insert");
+ b = H5F_addr_eq (&(obj_ent.header), &(ent1.header));
+ VERIFY (b, TRUE, "H5G_insert");
/* now as `/foo' */
HDmemset (&dir_ent, 0, sizeof(H5G_entry_t));
- HDmemset (&ent1, 0, sizeof(H5G_entry_t));
- status = H5G_find (f, "/foo", &dir_ent, &ent1);
+ HDmemset (&obj_ent, 0, sizeof(H5G_entry_t));
+ status = H5G_find (f, "/foo", &dir_ent, &obj_ent);
CHECK_I (status, "H5G_find");
b = H5F_addr_defined (&(dir_ent.header));
- VERIFY (b, FALSE, "H5G_create");
- b = H5F_addr_eq (&(ent1.header), &(obj1->header));
- VERIFY (b, TRUE, "H5G_find");
+ VERIFY (b, FALSE, "H5G_insert");
+ b = H5F_addr_eq (&(obj_ent.header), &(ent1.header));
+ VERIFY (b, TRUE, "H5G_insert");
/*
@@ -177,26 +177,22 @@ test_1 (void)
*/
/* create the object */
- obj2 = H5G_create (f, "/second", 0);
- CHECK_PTR (obj2, "H5G_new");
+ status = H5O_create (f, 0, &ent2);
+ CHECK_I (status, "H5O_create");
+ status = H5G_insert (f, "/second", &ent2);
+ CHECK_I (status, "H5G_insert");
/* try to read the first object */
- HDmemset (&ent1, 0, sizeof(H5G_entry_t));
- status = H5G_find (f, "/foo", NULL, &ent1);
+ HDmemset (&obj_ent, 0, sizeof(H5G_entry_t));
+ status = H5G_find (f, "/foo", NULL, &obj_ent);
CHECK_I (status, "H5G_find");
- b = H5F_addr_eq (&(ent1.header), &(obj1->header));
- VERIFY (b, TRUE, "H5G_find");
+ b = H5F_addr_eq (&(obj_ent.header), &(ent1.header));
+ VERIFY (b, TRUE, "H5G_insert");
/* the first object should not have a name message */
- status_ptr = H5O_read (f, NO_ADDR, obj1, H5O_NAME, 0, &name_mesg);
+ status_ptr = H5O_read (f, &ent1, H5O_NAME, 0, &name_mesg);
VERIFY (status_ptr, NULL, "H5O_read [didn't fail but should have]");
- /* close the objects */
- H5G_close (f, obj1);
- obj1 = NULL;
- H5G_close (f, obj2);
- obj2 = NULL;
-
/* close the file */
status = H5Fclose (fid);
CHECK_I (status, "H5Fclose");
@@ -221,18 +217,28 @@ test_1 (void)
static void
test_2 (void)
{
- hid_t fid;
+ hid_t fid, props;
H5F_t *f;
- H5G_entry_t *obj1=NULL;
int i;
char name[256];
herr_t status;
int nsyms = 5000;
+ H5G_t *dir = NULL;
MESSAGE (2, ("........large directories\n"));
+ /*
+ * Use larger symbol table data structures to be more efficient, use
+ * defaults to bang harder on the library for testing.
+ */
+ props = H5Ccreate (H5C_FILE_CREATE);
+#if 1
+ H5Cset_prop (props, H5F_SYM_LEAF_K, 16);
+ H5Cset_prop (props, H5F_SYM_INTERN_K, 16);
+#endif
+
/* create the file */
- fid = H5Fcreate ("tstab2.h5", H5ACC_OVERWRITE, 0, 0);
+ fid = H5Fcreate ("tstab2.h5", H5ACC_OVERWRITE, props, 0);
CHECK (fid, FAIL, "H5Fcreate");
f = H5Aatom_object (fid);
CHECK (f, NULL, "H5Aatom_object");
@@ -242,19 +248,17 @@ test_2 (void)
* Create a directory that has so many entries that the root
* of the B-tree ends up splitting.
*/
- obj1 = H5G_new (f, "/big", nsyms*12+2);
- CHECK_PTR (obj1, "H5G_mkdir");
- H5G_close (f, obj1);
- obj1 = NULL;
+ dir = H5G_create (f, "/big", nsyms*12+2);
+ CHECK_PTR (dir, "H5G_mkdir");
+ status = H5G_close (dir);
+ CHECK_I (status, "H5G_close");
for (i=0; i<nsyms; i++) {
-
sprintf (name, "/big/%05d%05d", rand()%100000, i);
MESSAGE (8, ("%s\n", name));
- obj1 = H5G_create (f, name, 0);
- CHECK_PTR (obj1, "H5G_mkdir");
- H5G_close (f, obj1);
- obj1 = NULL;
+ dir = H5G_create (f, name, 0);
+ CHECK_PTR (dir, "H5G_create");
+ H5G_close (dir);
}