summaryrefslogtreecommitdiffstats
path: root/test/tohdr.c
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/tohdr.c
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/tohdr.c')
-rw-r--r--test/tohdr.c47
1 files changed, 21 insertions, 26 deletions
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 */