diff options
author | Robb Matzke <matzke@llnl.gov> | 1997-11-14 14:42:14 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1997-11-14 14:42:14 (GMT) |
commit | cdeeb5553a3920565d87201761dadd1fe32aa3b1 (patch) | |
tree | a209c61f85983c1a76bf5c65d1f3285c4861ec46 /test | |
parent | 73897627660169de753597b9ff045d3112646506 (diff) | |
download | hdf5-cdeeb5553a3920565d87201761dadd1fe32aa3b1.zip hdf5-cdeeb5553a3920565d87201761dadd1fe32aa3b1.tar.gz hdf5-cdeeb5553a3920565d87201761dadd1fe32aa3b1.tar.bz2 |
[svn-r136] ./MANIFEST
./src/Makefile.in
Added H5Ffamily.c and H5Fsplit.c
./src/H5B.c
./src/H5Bprivate.h
./src/H5Gnode.c
Added `const' to sublass arguments.
./src/H5F.c
./src/H5Flow.c
./src/H5Fsec2.c
Make sure file buffers get flushed during a call to
H5Fflush(). Check for overflow in address encoding and decoding.
./src/H5Ffam.c
./src/H5Fprivate.c
./test/istore.c
Implementation of file families so 32-bit machines can access
64-bit files.
./src/H5Oprivate.h
Removed H5O_NO_ADDR constant.
./config/freebsd2.2.1
./config/linux
Added -DH5G_DEBUG and -DH5F_DEBUG to the list of debugging flags.
./html/H5.format.html
Changed some <offset>-sized things to <length>-sized things.
./src/H5AC.c
./src/H5ACprivate.h
./src/H5B.c
./src/H5Bprivate.h
./src/H5C.c
./src/H5D.c
./src/H5F.c
./src/H5Fcore.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fprivate.h
./src/H5Fsec2.c
./src/H5Fstdio.c
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5Gpkg.h
./src/H5Gprivate.h
./src/H5Gshad.c
./src/H5Gstab.c
./src/H5H.c
./src/H5Hprivate.h
./src/H5MF.c
./src/H5MFprivate.h
./src/H5O.c
./src/H5Ocont.c
./src/H5Oistore.c
./src/H5Oprivate.h
./src/H5Ostab.c
./src/H5Ostdst.c
./src/H5pivate.h
./src/debug.c
./test/istore.c
./test/theap.c
./test/tohdr.c
./test/tstab.c
Lots of changes caused by generalizing addresses. The haddr_t
is now a struct, so you can no longer perform arithmetic on
it. But since it's small, simple, and often used, storage is
allocated like with an integer. But we always pass them
around by reference. That is, when using an address in
another struct, allocate space:
struct my_struct {
char *name;
haddr_t address;
} x;
But when passing it to a function, pass by reference:
H5F_addr_print (stderr, &(x.address));
Addresses should be initialized with
H5F_addr_undef (&(x.address));
Functions for operating on addresses are in H5Flow.c and begin
with H5F_addr_... Functions never return haddr_t or haddr_t*;
they always pass them through arguments instead. A function
that returns an address through an argument does so with its
last argument and it is marked with `/*out*/'. Calls to such
functions also mark output-only arguments with `/*out*/'
./src/H5Fsplit.c (new)
A two-member family where all meta data goes in the first
member and all raw data goes in the second member.
./src/H5B.c
./src/H5D.c
./src/H5F.c
./src/H5Ffamily.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fprivate.h
./src/H5Fsec2.c
./src/H5Fstdio.c
./src/H5Gnode.c
./src/H5H.c
./src/H5MF.c
./src/H5MFprivate.h
./src/H5O.c
Differentiate between meta data storage and raw data
storage. Provide a mechanism so that the file driver can
extend the file to allocate more memory.
./src/H5E.c
./src/H5Epublic.c
Added the error H5E_TRUNCATED to be reported when the file is
shorter than the length recorded in the boot block.
./src/H5F.c
Added H5F_locate_signature() so we only do it in one place
now.
./INSTALL
./INSTALL_MAINT
Just a couple clarifications.
./html/ExternalFiles.html
./html/storage.html
Documents how external files work.
./test/hyperslab.c
./test/istore.c
Fixed printf's on 64-bit machines.
./test/istore.c
Added ifdef's to test the split file driver.
Diffstat (limited to 'test')
-rw-r--r-- | test/hyperslab.c | 27 | ||||
-rw-r--r-- | test/istore.c | 117 | ||||
-rw-r--r-- | test/theap.c | 15 | ||||
-rw-r--r-- | test/tohdr.c | 81 | ||||
-rw-r--r-- | test/tstab.c | 52 |
5 files changed, 181 insertions, 111 deletions
diff --git a/test/hyperslab.c b/test/hyperslab.c index b07a8fa..f985608 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -166,15 +166,16 @@ test_fill (size_t nx, size_t ny, size_t nz, if (0==ny) { ndims = 1; ny = nz = 1; - sprintf (dim, "%d", nx); + sprintf (dim, "%lu", (unsigned long)nx); } else { ndims = 2; nz = 1; - sprintf (dim, "%dx%d", nx, ny); + sprintf (dim, "%lux%lu", (unsigned long)nx, (unsigned long)ny); } } else { ndims = 3; - sprintf (dim, "%dx%dx%d", nx, ny, nz); + sprintf (dim, "%lux%lux%lu", + (unsigned long)nx, (unsigned long)ny, (unsigned long)nz); } sprintf (s, "Testing hyperslab fill %-11s variable hyperslab ", dim); printf ("%-70s", s); @@ -326,15 +327,16 @@ test_copy (int mode, if (0==ny) { ndims = 1; ny = nz = 1; - sprintf (dim, "%d", nx); + sprintf (dim, "%lu", (unsigned long)nx); } else { ndims = 2; nz = 1; - sprintf (dim, "%dx%d", nx, ny); + sprintf (dim, "%lux%lu", (unsigned long)nx, (unsigned long)ny); } } else { ndims = 3; - sprintf (dim, "%dx%dx%d", nx, ny, nz); + sprintf (dim, "%lux%lux%lu", + (unsigned long)nx, (unsigned long)ny, (unsigned long)nz); } switch (mode) { @@ -760,7 +762,8 @@ test_transpose (size_t nx, size_t ny) size_t size[2]; char s[256]; - sprintf (s, "Testing 2d transpose by stride %4dx%-4d", nx, ny); + sprintf (s, "Testing 2d transpose by stride %4lux%-lud", + (unsigned long)nx, (unsigned long)ny); printf ("%-70s", s); fflush (stdout); @@ -867,8 +870,9 @@ test_sub_super (size_t nx, size_t ny) int i, j; char s[256]; - sprintf (s, "Testing image sampling %4dx%-4d to %4dx%-4d ", - 2*nx, 2*ny, nx, ny); + sprintf (s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", + (unsigned long)(2*nx), (unsigned long)(2*ny), + (unsigned long)nx, (unsigned long)ny); printf ("%-70s", s); fflush (stdout); @@ -914,8 +918,9 @@ test_sub_super (size_t nx, size_t ny) * Test replicating pixels to produce an image twice as large in each * dimension. */ - sprintf (s, "Testing image sampling %4dx%-4d to %4dx%-4d ", - nx, ny, 2*nx, 2*ny); + sprintf (s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", + (unsigned long)nx, (unsigned long)ny, + (unsigned long)(2*nx), (unsigned long)(2*ny)); printf ("%-70s", s); fflush (stdout); diff --git a/test/istore.c b/test/istore.c index c50ef3f..6487a30 100644 --- a/test/istore.c +++ b/test/istore.c @@ -14,14 +14,25 @@ #include <H5Oprivate.h> #include <H5Vprivate.h> -#define FILENAME "istore.h5" +#if 0 +# define FILETYPE H5F_LOW_DFLT +# define FILENAME "istore.h5" +#elif 0 +# define FILETYPE H5F_LOW_FAM +# define FILENAME "istore-%05d.h5" +#else +# define FILETYPE H5F_LOW_SPLIT +# define FILENAME "istore-split" +#endif #define TEST_SMALL 0x0001 #define TEST_MEDIUM 0x0002 +#define TEST_LARGE 0x0004 #define AT() printf (" at %s:%d in %s()...\n", \ __FILE__, __LINE__, __FUNCTION__); - + +size_t align_g[3] = {50, 50, 50}; /*------------------------------------------------------------------------- @@ -99,9 +110,16 @@ new_object (H5F_t *f, const char *name, size_t ndims) } /* Add the indexed-storage message */ - for (i=0; i<ndims; i++) alignment[i] = 2; + for (i=0; i<ndims; i++) { + if (i<NELMTS (align_g)) { + alignment[i] = align_g[i]; + } else { + alignment[i] = 2; + } + } + H5F_istore_new (f, &istore, ndims, alignment); - if (H5O_modify (f, H5O_NO_ADDR, handle, H5O_ISTORE, H5O_NEW_MESG, + if (H5O_modify (f, NO_ADDR, handle, H5O_ISTORE, H5O_NEW_MESG, &istore)<0) { printf ("*FAILED*\n"); if (!isatty (1)) { @@ -140,7 +158,6 @@ test_create (H5F_t *f, const char *prefix) char name[256]; printf ("%-70s", "Testing istore create"); - fflush (stdout); for (i=1; i<=H5O_ISTORE_NDIMS; i++) { sprintf (name, "%s_%02d", prefix, i); @@ -191,21 +208,21 @@ test_extend (H5F_t *f, const char *prefix, if (!ny) { ndims = 1; ny = nz = 1; - sprintf (dims, "%d", nx); + sprintf (dims, "%lu", (unsigned long)nx); } else { ndims = 2; nz = 1; - sprintf (dims, "%dx%d", nx, ny); + sprintf (dims, "%lux%lu", (unsigned long)nx, (unsigned long)ny); } } else { ndims = 3; - sprintf (dims, "%dx%dx%d", nx, ny, nz); + sprintf (dims, "%lux%lux%lu", + (unsigned long)nx, (unsigned long)ny, (unsigned long)nz); } sprintf (s, "Testing istore extend: %s", dims); printf ("%-70s", s); - fflush (stdout); buf = H5MM_xmalloc (nx*ny*nz); check = H5MM_xmalloc (nx*ny*nz); whole = H5MM_xcalloc (nx*ny*nz, 1); @@ -219,7 +236,7 @@ test_extend (H5F_t *f, const char *prefix, } goto error; } - if (NULL==H5O_read (f, H5O_NO_ADDR, handle, H5O_ISTORE, 0, &istore)) { + if (NULL==H5O_read (f, NO_ADDR, handle, H5O_ISTORE, 0, &istore)) { puts ("*FAILED*"); if (!isatty (1)) { AT (); @@ -274,7 +291,6 @@ test_extend (H5F_t *f, const char *prefix, printf ("), %d element%s", nelmts, 1==nelmts?"":"s"); if (0==nelmts) printf (" *SKIPPED*"); printf ("\n"); - fflush (stdout); #endif /* Fill the source array */ @@ -309,7 +325,7 @@ test_extend (H5F_t *f, const char *prefix, printf (" Wrote:\n"); print_array (buf, size[0], size[1], size[2]); printf (" Read:\n"); - print_array (buf, size[0], size[1], size[2]); + print_array (check, size[0], size[1], size[2]); } goto error; } @@ -395,7 +411,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]; + size_t offset[3], size[3], total=0; H5G_entry_t *handle = NULL; H5O_istore_t istore; uint8 *buf = NULL; @@ -404,20 +420,20 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks, if (!ny) { ndims = 1; ny = nz = 1; - sprintf (dims, "%d", nx); + sprintf (dims, "%lu", (unsigned long)nx); } else { ndims = 2; nz = 1; - sprintf (dims, "%dx%d", nx, ny); + sprintf (dims, "%lux%lu", (unsigned long)nx, (unsigned long)ny); } } else { ndims = 3; - sprintf (dims, "%dx%dx%d", nx, ny, nz); + sprintf (dims, "%lux%lux%lu", + (unsigned long)nx, (unsigned long)ny, (unsigned long)nz); } sprintf (s, "Testing istore sparse: %s", dims); printf ("%-70s", s); - fflush (stdout); buf = H5MM_xmalloc (nx*ny*nz); /* Build the new empty object */ @@ -429,7 +445,7 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks, } goto error; } - if (NULL==H5O_read (f, H5O_NO_ADDR, handle, H5O_ISTORE, 0, &istore)) { + if (NULL==H5O_read (f, NO_ADDR, handle, H5O_ISTORE, 0, &istore)) { puts ("*FAILED*"); if (!isatty (1)) { AT (); @@ -453,16 +469,20 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks, if (!isatty (1)) { AT (); printf (" Write failed: ctr=%d\n", ctr); - printf (" offset=(%d", offset[0]); - if (ndims>1) printf (",%d", offset[1]); - if (ndims>2) printf (",%d", offset[2]); - printf ("), size=(%d", size[0]); - if (ndims>1) printf (",%d", size[1]); - if (ndims>2) printf (",%d", size[2]); + printf (" offset=(%lu", (unsigned long)(offset[0])); + if (ndims>1) printf (",%lu", (unsigned long)(offset[1])); + if (ndims>2) printf (",%lu", (unsigned long)(offset[2])); + printf ("), size=(%lu", (unsigned long)(size[0])); + if (ndims>1) printf (",%lu", (unsigned long)(size[1])); + if (ndims>2) printf (",%lu", (unsigned long)(size[2])); printf (")\n"); } goto error; } + total += nx*ny*nz; +#if 0 + printf ("ctr: ctr=%d, total=%lu\n", ctr, (unsigned long)total); +#endif /* We don't test reading yet.... */ } @@ -502,6 +522,12 @@ main (int argc, char *argv[]) herr_t status; int nerrors = 0; uintn size_of_test; + uint8 offset_size; + H5G_entry_t *ent = NULL; + hid_t template_id; + file_create_temp_t *creation_template = NULL; + + setbuf (stdout, NULL); /* Parse arguments or assume `small' */ if (1==argc) { @@ -513,6 +539,8 @@ main (int argc, char *argv[]) size_of_test |= TEST_SMALL; } else if (!strcmp (argv[i], "medium")) { size_of_test |= TEST_MEDIUM; + } else if (!strcmp (argv[i], "large")) { + size_of_test |= TEST_LARGE; } else { printf ("unrecognized argument: %s\n", argv[i]); exit (1); @@ -522,18 +550,47 @@ main (int argc, char *argv[]) printf ("Test sizes: "); if (size_of_test & TEST_SMALL) printf (" SMALL"); if (size_of_test & TEST_MEDIUM) printf (" MEDIUM"); + if (size_of_test & TEST_LARGE) printf (" LARGE"); printf ("\n"); - + + /* + * Use larger file addresses... + */ + offset_size = 8; + template_id = H5C_copy (H5C_get_default_atom (H5_TEMPLATE)); + H5Csetparm (template_id, H5_OFFSET_SIZE, &offset_size); + creation_template = H5Aatom_object (template_id); /* Create the test file */ - if (NULL==(f=H5F_open (H5F_LOW_DFLT, FILENAME, + if (NULL==(f=H5F_open (FILETYPE, FILENAME, (H5F_ACC_CREAT|H5F_ACC_WRITE|H5F_ACC_TRUNC| H5F_ACC_DEBUG), - NULL))) { + creation_template))) { printf ("Cannot create file %s; test aborted\n", FILENAME); exit (1); } +#if 0 + { + /* + * For testing file families, fool the library into thinking it already + * allocated a whole bunch of data. + */ + haddr_t addr; + addr.offset = (uint64)1<<33; /*8GB*/ + H5F_low_seteof (f->shared->lf, &addr); + } +#endif + + /* + * 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; + + /* * Creation test: Creates empty objects with various raw data sizes * and alignments. @@ -557,7 +614,6 @@ main (int argc, char *argv[]) status = test_extend (f, "extend", 10, 400, 10); nerrors += status<0 ? 1 : 0; } - if (size_of_test & TEST_SMALL) { status = test_sparse (f, "sparse", 100, 5, 0, 0); nerrors += status<0 ? 1 : 0; @@ -574,6 +630,11 @@ main (int argc, char *argv[]) status = test_sparse (f, "sparse", 2000, 4, 2, 3); nerrors += status<0 ? 1 : 0; } + if (size_of_test & TEST_LARGE) { + status = test_sparse (f, "sparse", 800, 50, 50, 50); + nerrors += status<0 ? 1 : 0; + } + /* Close the test file and exit */ H5F_close (f); diff --git a/test/theap.c b/test/theap.c index 1dc38e1..d46726f 100644 --- a/test/theap.c +++ b/test/theap.c @@ -45,10 +45,11 @@ test_heap (void) int i, j; hid_t fid; H5F_t *f; - off_t heap; + haddr_t heap_addr; char buf[NOBJS+8]; const char *s; - off_t obj[NOBJS]; + size_t obj[NOBJS]; + herr_t status; MESSAGE (5, ("Testing Heaps\n")); @@ -59,8 +60,8 @@ test_heap (void) CHECK (f, NULL, "H5Aatom_object"); /* Create a new heap */ - heap = H5H_new (f, H5H_LOCAL, 0); - CHECK_I (heap, "H5H_new"); + status = H5H_new (f, H5H_LOCAL, 0, &heap_addr/*out*/); + CHECK_I (status, "H5H_new"); /* Add stuff to the heap */ for (i=0; i<NOBJS; i++) { @@ -68,8 +69,8 @@ test_heap (void) for (j=4; j<i; j++) buf[j] = '0' + j%10; if (j>4) buf[j] = '\0'; - obj[i] = H5H_insert (f, heap, strlen(buf)+1, buf); - CHECK_I (heap, "H5H_insert"); + obj[i] = H5H_insert (f, &heap_addr, strlen(buf)+1, buf); + CHECK_I (obj[i], "H5H_insert"); } /* Flush the cache and invalidate everything */ @@ -77,7 +78,7 @@ test_heap (void) /* Read the objects back out */ for (i=0; i<NOBJS; i++) { - s = H5H_peek (f, heap, obj[i]); + s = H5H_peek (f, &heap_addr, obj[i]); MESSAGE (8, ("object is `%s'\n", s)); } diff --git a/test/tohdr.c b/test/tohdr.c index c8da399..2ea0896 100644 --- a/test/tohdr.c +++ b/test/tohdr.c @@ -49,7 +49,7 @@ test_ohdr (void) { hid_t fid; H5F_t *f; - haddr_t oh; + haddr_t oh_addr; H5O_stab_t stab, ro; herr_t status; void *ptr; @@ -66,84 +66,89 @@ test_ohdr (void) /* the new object header */ MESSAGE (8, ("Creating new object header...\n")); - oh = H5O_new (f, 1, 64); + status = H5O_new (f, 1, 64, &oh_addr/*out*/); + CHECK_I (status, "H5O_new"); /* * Test creation of a new message. */ MESSAGE (8, ("Creating new message...\n")); - stab.btree_addr = 11111111; - stab.heap_addr = 22222222; - status = H5O_modify (f, oh, NULL, H5O_STAB, H5O_NEW_MESG, &stab); + stab.btree_addr.offset = 11111111; + stab.heap_addr.offset = 22222222; + status = H5O_modify (f, &oh_addr, NULL, H5O_STAB, H5O_NEW_MESG, &stab); VERIFY (status, 0, "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, oh, NULL, H5O_STAB, 0, &ro); + ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 0, &ro); CHECK_PTR (ptr, "H5O_read"); VERIFY (ptr, &ro, "H5O_read"); - VERIFY (ro.btree_addr, stab.btree_addr, "H5O_read"); - VERIFY (ro.heap_addr, stab.heap_addr, "H5O_read"); + VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read"); + VERIFY (ro.heap_addr.offset, stab.heap_addr.offset, "H5O_read"); /* * Test modification of an existing message. */ MESSAGE (8, ("Modifying message...\n")); - stab.btree_addr = 33333333; - stab.heap_addr = 44444444; - status = H5O_modify (f, oh, NULL, H5O_STAB, 0, &stab); + stab.btree_addr.offset = 33333333; + stab.heap_addr.offset = 44444444; + status = H5O_modify (f, &oh_addr, NULL, H5O_STAB, 0, &stab); VERIFY (status, 0, "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, oh, NULL, H5O_STAB, 0, &ro); + ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 0, &ro); CHECK_PTR (ptr, "H5O_read"); VERIFY (ptr, &ro, "H5O_read"); - VERIFY (ro.btree_addr, stab.btree_addr, "H5O_read"); - VERIFY (ro.heap_addr, stab.heap_addr, "H5O_read"); + VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read"); + VERIFY (ro.heap_addr.offset, stab.heap_addr.offset, "H5O_read"); /* * Test creation of a second message of the same type with a symbol * table. */ MESSAGE (8, ("Creating a duplicate message...\n")); - ent.header = 0; + ent.header.offset = 0; ent.type = H5G_NOTHING_CACHED; ent.dirty = FALSE; - stab.btree_addr = 55555555; - stab.heap_addr = 66666666; - status = H5O_modify (f, oh, &ent, H5O_STAB, H5O_NEW_MESG, &stab); + stab.btree_addr.offset = 55555555; + stab.heap_addr.offset = 66666666; + status = H5O_modify (f, &oh_addr, &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, stab.heap_addr, "H5O_modify"); - VERIFY (ent.cache.stab.btree_addr, stab.btree_addr, "H5O_modify"); + VERIFY (ent.cache.stab.heap_addr.offset, stab.heap_addr.offset, + "H5O_modify"); + VERIFY (ent.cache.stab.btree_addr.offset, stab.btree_addr.offset, + "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, oh, NULL, H5O_STAB, 1, &ro); + ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 1, &ro); CHECK_PTR (ptr, "H5O_read"); VERIFY (ptr, &ro, "H5O_read"); - VERIFY (ro.btree_addr, stab.btree_addr, "H5O_read"); - VERIFY (ro.heap_addr, stab.heap_addr, "H5O_read"); + VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read"); + VERIFY (ro.heap_addr.offset, stab.heap_addr.offset, "H5O_read"); /* * Test modification of the second message with a symbol table. */ MESSAGE (8, ("Modifying the duplicate message...\n")); ent.dirty = FALSE; - stab.btree_addr = 77777777; - stab.heap_addr = 88888888; - status = H5O_modify (f, oh, &ent, H5O_STAB, 1, &stab); + stab.btree_addr.offset = 77777777; + stab.heap_addr.offset = 88888888; + status = H5O_modify (f, &oh_addr, &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, stab.heap_addr, "H5O_modify"); - VERIFY (ent.cache.stab.btree_addr, stab.btree_addr, "H5O_modify"); + VERIFY (ent.cache.stab.heap_addr.offset, stab.heap_addr.offset, + "H5O_modify"); + VERIFY (ent.cache.stab.btree_addr.offset, stab.btree_addr.offset, + "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, oh, NULL, H5O_STAB, 1, &ro); + ptr = H5O_read (f, &oh_addr, NULL, H5O_STAB, 1, &ro); CHECK_PTR (ptr, "H5O_read"); VERIFY (ptr, &ro, "H5O_read"); - VERIFY (ro.btree_addr, stab.btree_addr, "H5O_read"); - VERIFY (ro.heap_addr, stab.heap_addr, "H5O_read"); + VERIFY (ro.btree_addr.offset, stab.btree_addr.offset, "H5O_read"); + VERIFY (ro.heap_addr.offset, stab.heap_addr.offset, "H5O_read"); /* * Test creation of a bunch of messages one after another to see @@ -151,9 +156,9 @@ test_ohdr (void) */ MESSAGE (8, ("Overflowing header in core...\n")); for (i=0; i<40; i++) { - stab.btree_addr = (i+1)*1000 + 1; - stab.heap_addr = (i+1)*1000 + 2; - status = H5O_modify (f, oh, NULL, H5O_STAB, H5O_NEW_MESG, &stab); + 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); VERIFY (status, 2+i, "H5O_modify"); } H5AC_flush (f, NULL, 0, TRUE); @@ -164,9 +169,9 @@ test_ohdr (void) */ MESSAGE (8, ("Overflowing header on disk...\n")); for (i=0; i<10; i++) { - stab.btree_addr = (i+1)*1000 + 10; - stab.heap_addr = (i+1)*1000 + 20; - status = H5O_modify (f, oh, NULL, H5O_STAB, H5O_NEW_MESG, &stab); + 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); VERIFY (status, 42+i, "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); } @@ -174,7 +179,7 @@ test_ohdr (void) /* * Delete all symbol table messages. */ - status = H5O_remove (f, oh, NULL, H5O_STAB, H5O_ALL); + status = H5O_remove (f, &oh_addr, NULL, H5O_STAB, H5O_ALL); CHECK_I (status, "H5O_remove"); /* close the file */ diff --git a/test/tstab.c b/test/tstab.c index 9bac3b7..e2384f8 100644 --- a/test/tstab.c +++ b/test/tstab.c @@ -56,6 +56,7 @@ test_1 (void) herr_t status; H5O_name_t name_mesg; void *status_ptr; + hbool_t b; MESSAGE (2, ("........non-directory files\n")); @@ -82,20 +83,18 @@ test_1 (void) /* * Test 1B: Attempt to read the root object using the name `/'. */ - HDmemset (&dir_ent, 0, sizeof(H5G_entry_t)); - HDmemset (&ent1, 0, sizeof(H5G_entry_t)); + memset (&dir_ent, 0xff, sizeof(H5G_entry_t)); + memset (&ent1, 0xff, sizeof(H5G_entry_t)); status = H5G_find (f, "/", &dir_ent, &ent1); CHECK_I (status, "H5G_find"); - VERIFY (dir_ent.header, 0, "H5G_find"); - VERIFY (ent1.header, obj1->header, "H5G_find"); - /* is it really the root symbol? */ - VERIFY (dir_ent.header, 0, "H5G_insert"); - VERIFY (obj1->header, f->shared->root_sym->header, "H5G_insert"); + /* 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"); - - /* * Test 1C: Add a second object to the file to see if the first object * gets moved into the new root directory along with the second object. @@ -106,10 +105,13 @@ test_1 (void) CHECK_PTR (obj2, "H5G_new"); /* try to read the first object */ - HDmemset (&ent1, 0, sizeof(H5G_entry_t)); + HDmemset (&ent1, 0xff, sizeof(H5G_entry_t)); status = H5G_find (f, "/Root Object", NULL, &ent1); CHECK_I (status, "H5G_find"); - VERIFY (ent1.header, obj1->header, "H5G_find"); + b = H5F_addr_defined (&(ent1.header)); + VERIFY (b, TRUE, "H5G_create"); + b = H5F_addr_eq (&(ent1.header), &(obj1->header)); + VERIFY (b, TRUE, "H5G_create"); /* close the objects */ H5G_close (f, obj1); @@ -120,7 +122,7 @@ test_1 (void) /* close the file */ H5Fclose (fid); - + /* * Test 1D: Create an empty file and add a non-directory object @@ -136,7 +138,7 @@ test_1 (void) /* create the object */ obj1 = H5G_create (f, "/foo", 0); - CHECK_PTR (obj1, "H5G_new"); + CHECK_PTR (obj1, "H5G_create"); /* does it have the correct name message? */ status_ptr = H5O_read (f, NO_ADDR, obj1, H5O_NAME, 0, &name_mesg); @@ -153,25 +155,20 @@ test_1 (void) HDmemset (&ent1, 0, sizeof(H5G_entry_t)); status = H5G_find (f, "/", &dir_ent, &ent1); CHECK_I (status, "H5G_find"); - VERIFY (dir_ent.header, 0, "H5G_find"); - VERIFY (ent1.header, obj1->header, "H5G_find"); - - /* is it really the root symbol? */ - VERIFY (dir_ent.header, 0, "H5G_insert"); - VERIFY (obj1->header, f->shared->root_sym->header, "H5G_insert"); + 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"); /* 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); CHECK_I (status, "H5G_find"); - VERIFY (dir_ent.header, 0, "H5G_find"); - VERIFY (ent1.header, obj1->header, "H5G_find"); - - /* is it really the root symbol? */ - VERIFY (dir_ent.header, 0, "H5G_insert"); - VERIFY (obj1->header, f->shared->root_sym->header, "H5G_insert"); - + 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"); /* @@ -187,7 +184,8 @@ test_1 (void) HDmemset (&ent1, 0, sizeof(H5G_entry_t)); status = H5G_find (f, "/foo", NULL, &ent1); CHECK_I (status, "H5G_find"); - VERIFY (ent1.header, obj1->header, "H5G_find"); + b = H5F_addr_eq (&(ent1.header), &(obj1->header)); + VERIFY (b, TRUE, "H5G_find"); /* the first object should not have a name message */ status_ptr = H5O_read (f, NO_ADDR, obj1, H5O_NAME, 0, &name_mesg); |