diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-01-07 17:14:26 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-01-07 17:14:26 (GMT) |
commit | 159fa7a232e1961940b83f035f4c27338d26337e (patch) | |
tree | b7344e9cfaadbbec3bc3a0576df8c264debb8239 /test | |
parent | 1d17defdfc977c063c7ff20b5868bef9a76e5d9a (diff) | |
download | hdf5-159fa7a232e1961940b83f035f4c27338d26337e.zip hdf5-159fa7a232e1961940b83f035f4c27338d26337e.tar.gz hdf5-159fa7a232e1961940b83f035f4c27338d26337e.tar.bz2 |
[svn-r151] Changes since 19980105
----------------------
./config/freebsd2.2.1
./config/linux
Added -UH5O_DEBUG to the debug flags. Turn this on to get
lots of lines on stderr to show what objects are opened and
closed.
./src/H5C.o
./src/H5Cpublic.h
./test/dsets.c
./test/tfile.c
Split H5Cget_prop() and H5Cset_prop() into functions for each
property.
./src/H5D.c
./src/H5Dpublic.h
./src/H5Gstab.c
./src/H5O.c
./src/H5Ocont.c
./src/H5Ocstore.c
./src/H5Odtype.c
./src/H5Oefl.c
./src/H5Oistore.c
./src/H5Oname.c
./src/H5Onull.c
./src/H5Oprivate.h
./src/H5Osdspace.c
./src/H5Ostab.c
./src/H5P.c
./src/istore.c
./test/tohdr.c
Object header functions now understand constant
vs. non-constant messages.
./src/H5F.c
./src/H5Fprivate.h
The file OID can be closed before other OID's.
./src/H5Flow.c
H5F_addr_defined() is a macro in this file.
./src/H5G.c
./src/H5Gpublic.h
./test/tstab.c
A current working group cannot be deleted.
./src/H5Gent.c
./src/H5Gpkg.h
Removed unused functionality.
./src/H5public.h
Includes <sys/types.h> for size_t.
Diffstat (limited to 'test')
-rw-r--r-- | test/dsets.c | 8 | ||||
-rw-r--r-- | test/istore.c | 14 | ||||
-rw-r--r-- | test/tfile.c | 156 | ||||
-rw-r--r-- | test/tohdr.c | 37 | ||||
-rw-r--r-- | test/tstab.c | 49 |
5 files changed, 115 insertions, 149 deletions
diff --git a/test/dsets.c b/test/dsets.c index f6d4df8..c5ad49c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -140,13 +140,9 @@ test_create (hid_t file) */ create_parms = H5Ccreate (H5C_DATASET_CREATE); assert (create_parms>=0); - status = H5Cset_prop (create_parms, H5D_LAYOUT, H5D_CHUNKED); - assert (status>=0); - status = H5Cset_prop (create_parms, H5D_CHUNK_NDIMS, 2); - assert (status>=0); csize[0] = 5; csize[1] = 100; - status = H5Cset_prop (create_parms, H5D_CHUNK_SIZE, csize); + status = H5Cset_chunk (create_parms, 2, csize); assert (status>=0); dataset = H5Dcreate (file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, @@ -270,6 +266,8 @@ test_simple_io (hid_t file) } } + H5Dclose (dataset); + puts (" PASSED"); return SUCCEED; diff --git a/test/istore.c b/test/istore.c index 81ae8c2..74154fc 100644 --- a/test/istore.c +++ b/test/istore.c @@ -122,7 +122,7 @@ new_object (H5F_t *f, const char *name, size_t ndims, H5G_entry_t *ent/*out*/) } } H5F_istore_create (f, &istore, ndims, alignment); - if (H5O_modify (f, ent, H5O_ISTORE, H5O_NEW_MESG, &istore)<0) { + if (H5O_modify (ent, H5O_ISTORE, H5O_NEW_MESG, 0, &istore)<0) { printf ("*FAILED*\n"); if (!isatty (1)) { AT(); @@ -132,7 +132,7 @@ new_object (H5F_t *f, const char *name, size_t ndims, H5G_entry_t *ent/*out*/) } /* Give the object header a name */ - if (H5G_insert (f, name, ent)<0) { + if (H5G_insert (name, ent)<0) { printf ("*FAILED*\n"); if (!isatty (1)) { AT (); @@ -142,7 +142,7 @@ new_object (H5F_t *f, const char *name, size_t ndims, H5G_entry_t *ent/*out*/) } /* Close the header */ - H5O_close (f, ent); + H5O_close (ent); return 0; } @@ -250,7 +250,7 @@ test_extend (H5F_t *f, const char *prefix, } goto error; } - if (NULL==H5O_read (f, &handle, H5O_ISTORE, 0, &istore)) { + if (NULL==H5O_read (&handle, H5O_ISTORE, 0, &istore)) { puts ("*FAILED*"); if (!isatty (1)) { AT (); @@ -458,7 +458,7 @@ test_sparse (H5F_t *f, const char *prefix, size_t nblocks, } goto error; } - if (NULL==H5O_read (f, &handle, H5O_ISTORE, 0, &istore)) { + if (NULL==H5O_read (&handle, H5O_ISTORE, 0, &istore)) { puts ("*FAILED*"); if (!isatty (1)) { AT (); @@ -534,7 +534,6 @@ main (int argc, char *argv[]) herr_t status; int nerrors = 0; uintn size_of_test; - size_t offset_size; hid_t template_id; H5F_create_t *creation_template = NULL; H5G_t *dir = NULL; @@ -568,9 +567,8 @@ main (int argc, char *argv[]) /* * Use larger file addresses... */ - offset_size = 8; template_id = H5Ccreate (H5C_FILE_CREATE); - H5Cset_prop (template_id, H5F_SIZEOF_ADDR, offset_size); + H5Cset_sizes (template_id, 8, 0); creation_template = H5Aatom_object (template_id); /* Create the test file */ diff --git a/test/tfile.c b/test/tfile.c index 8827d87..b72e037 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -63,7 +63,7 @@ static void test_file_create(void) hid_t tmpl1,tmpl2; /* File creation templates */ size_t parm; /* File-creation parameters */ size_t parm2; /* File-creation parameters */ - int iparm; + int iparm, iparm2; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -82,25 +82,19 @@ static void test_file_create(void) CHECK(tmpl1,FAIL,"H5Fget_create_template"); /* Get the file-creation parameters */ - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_USERBLOCK, &parm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm,F1_USERBLOCK_SIZE,"H5Cget_prop"); + ret = H5Cget_userblock (tmpl1, &parm); + CHECK(ret,FAIL,"H5Cget_userblock"); + VERIFY(parm,F1_USERBLOCK_SIZE,"H5Cget_userblock"); - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_ADDR, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F1_OFFSET_SIZE,"H5Cget_prop"); + ret = H5Cget_sizes (tmpl1, &parm, &parm2); + CHECK(ret,FAIL,"H5Cget_sizes"); + VERIFY (parm, F1_OFFSET_SIZE, "H5Cget_sizes"); + VERIFY(parm2,F1_LENGTH_SIZE,"H5Cget_sizes"); - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_SIZE, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F1_LENGTH_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SYM_LEAF_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F1_SYM_LEAF_K,"H5Cget_prop"); - - ret =H5Cget_prop (tmpl1, H5F_SYM_INTERN_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F1_SYM_INTERN_K,"H5Cget_prop"); + ret = H5Cget_sym_k (tmpl1, &iparm, &iparm2); + CHECK(ret,FAIL,"H5Cget_sym_k"); + VERIFY (iparm, F1_SYM_INTERN_K, "H5Cget_sym_k"); + VERIFY(iparm2,F1_SYM_LEAF_K,"H5Cget_sym_k"); /* Release file-creation template */ ret=H5Mclose(tmpl1); @@ -115,25 +109,19 @@ static void test_file_create(void) CHECK(tmpl1,FAIL,"H5Cnew"); /* Set the new file-creation parameters */ - parm=F2_USERBLOCK_SIZE; - ret = H5Cset_prop (tmpl1, H5F_SIZEOF_USERBLOCK, parm); - CHECK(ret,FAIL,"H5Cset_prop"); - - parm2=F2_OFFSET_SIZE; - ret = H5Cset_prop (tmpl1, H5F_SIZEOF_ADDR, parm2); - CHECK(ret,FAIL,"H5Cset_prop"); + ret = H5Cset_userblock (tmpl1, F2_USERBLOCK_SIZE); + CHECK(ret,FAIL,"H5Cset_userblock"); - parm2=F2_LENGTH_SIZE; - ret = H5Cset_prop (tmpl1, H5F_SIZEOF_SIZE, parm2); - CHECK(ret,FAIL,"H5Cset_prop"); + ret = H5Cset_sizes (tmpl1, F2_OFFSET_SIZE, F2_LENGTH_SIZE); + CHECK(ret,FAIL,"H5Cset_sizes"); - ret = H5Cset_prop (tmpl1, H5F_SYM_LEAF_K, F2_SYM_LEAF_K); - CHECK(ret,FAIL,"H5Cset_prop"); + ret = H5Cset_sym_k (tmpl1, F2_SYM_INTERN_K, F2_SYM_LEAF_K); + CHECK(ret,FAIL,"H5Cset_sym_k"); - ret = H5Cset_prop (tmpl1, H5F_SYM_INTERN_K, F2_SYM_INTERN_K); - CHECK(ret,FAIL,"H5Cset_prop"); - - /* Try to create second file, with non-standard file-creation template params */ + /* + * Try to create second file, with non-standard file-creation template + * params. + */ fid2=H5Fcreate(FILE2,H5ACC_OVERWRITE,tmpl1,0); CHECK(fid2,FAIL,"H5Fcreate"); @@ -146,25 +134,19 @@ static void test_file_create(void) CHECK(tmpl1,FAIL,"H5Fget_create_template"); /* Get the file-creation parameters */ - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_USERBLOCK, &parm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm,F2_USERBLOCK_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_SIZE, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F2_LENGTH_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_ADDR, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F2_OFFSET_SIZE,"H5Cget_prop"); + ret = H5Cget_userblock (tmpl1, &parm); + CHECK(ret,FAIL,"H5Cget_userblock"); + VERIFY(parm,F2_USERBLOCK_SIZE,"H5Cget_userblock"); - ret = H5Cget_prop (tmpl1, H5F_SYM_LEAF_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F2_SYM_LEAF_K,"H5Cget_prop"); + ret = H5Cget_sizes (tmpl1, &parm, &parm2); + CHECK(ret,FAIL,"H5Cget_sizes"); + VERIFY (parm, F2_OFFSET_SIZE, "H5Cget_sizes"); + VERIFY(parm2,F2_LENGTH_SIZE,"H5Cget_sizes"); - ret = H5Cget_prop (tmpl1, H5F_SYM_INTERN_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F2_SYM_INTERN_K,"H5Cget_prop"); + ret = H5Cget_sym_k (tmpl1, &iparm, &iparm2); + CHECK(ret,FAIL,"H5Cget_sym_k"); + VERIFY (iparm, F2_SYM_INTERN_K, "H5Cget_sym_k"); + VERIFY(iparm2,F2_SYM_LEAF_K,"H5Cget_sym_k"); /* Clone the file-creation template */ tmpl2=H5Mcopy(tmpl1); @@ -175,11 +157,13 @@ static void test_file_create(void) CHECK(ret,FAIL,"H5Mrelease"); /* Set the new file-creation parameter */ - parm=F3_USERBLOCK_SIZE; - ret = H5Cset_prop (tmpl2, H5F_SIZEOF_USERBLOCK, parm); - CHECK(ret,FAIL,"H5Cset_prop"); + ret = H5Cset_userblock (tmpl2, F3_USERBLOCK_SIZE); + CHECK(ret,FAIL,"H5Cset_userblock"); - /* Try to create second file, with non-standard file-creation template params */ + /* + * Try to create second file, with non-standard file-creation template + * params + */ fid3=H5Fcreate(FILE3,H5ACC_OVERWRITE,tmpl2,0); CHECK(fid3,FAIL,"H5Fcreate"); @@ -192,25 +176,19 @@ static void test_file_create(void) CHECK(tmpl1,FAIL,"H5Fget_create_template"); /* Get the file-creation parameters */ - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_USERBLOCK, &parm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm,F3_USERBLOCK_SIZE,"H5Cget_prop"); + ret = H5Cget_userblock (tmpl1, &parm); + CHECK(ret,FAIL,"H5Cget_userblock"); + VERIFY(parm,F3_USERBLOCK_SIZE,"H5Cget_userblock"); - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_ADDR, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F3_LENGTH_SIZE,"H5Cget_prop"); + ret = H5Cget_sizes (tmpl1, &parm, &parm2); + CHECK(ret,FAIL,"H5Cget_sizes"); + VERIFY (parm, F3_OFFSET_SIZE, "H5Cget_sizes"); + VERIFY(parm2,F3_LENGTH_SIZE,"H5Cget_sizes"); - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_SIZE, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F3_OFFSET_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SYM_LEAF_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F3_SYM_LEAF_K,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SYM_INTERN_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F3_SYM_INTERN_K,"H5Cget_prop"); + ret = H5Cget_sym_k (tmpl1, &iparm, &iparm2); + CHECK(ret,FAIL,"H5Cget_sym_k"); + VERIFY (iparm, F3_SYM_INTERN_K, "H5Cget_sym_k"); + VERIFY(iparm2,F3_SYM_LEAF_K,"H5Cget_sym_k"); /* Release file-creation template */ ret=H5Mclose(tmpl1); @@ -241,7 +219,7 @@ static void test_file_open(void) hid_t tmpl1; /* File creation templates */ size_t parm; /* File-creation parameters */ size_t parm2; /* File-creation parameters */ - int iparm; + int iparm, iparm2; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -256,25 +234,19 @@ static void test_file_open(void) CHECK(tmpl1,FAIL,"H5Fget_create_template"); /* Get the file-creation parameters */ - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_USERBLOCK, &parm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm,F2_USERBLOCK_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_ADDR, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F2_OFFSET_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SIZEOF_SIZE, &parm2); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(parm2,F2_LENGTH_SIZE,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SYM_LEAF_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F2_SYM_LEAF_K,"H5Cget_prop"); - - ret = H5Cget_prop (tmpl1, H5F_SYM_INTERN_K, &iparm); - CHECK(ret,FAIL,"H5Cget_prop"); - VERIFY(iparm,F2_SYM_INTERN_K,"H5Cget_prop"); + ret = H5Cget_userblock (tmpl1, &parm); + CHECK(ret,FAIL,"H5Cget_userblock"); + VERIFY(parm,F2_USERBLOCK_SIZE,"H5Cget_userblock"); + + ret = H5Cget_sizes (tmpl1, &parm, &parm2); + CHECK(ret,FAIL,"H5Cget_sizes"); + VERIFY(parm,F2_OFFSET_SIZE,"H5Cget_sizes"); + VERIFY(parm2,F2_LENGTH_SIZE,"H5Cget_sizes"); + + ret = H5Cget_sym_k (tmpl1, &iparm, &iparm2); + CHECK(ret,FAIL,"H5Cget_sym_k"); + VERIFY (iparm, F2_SYM_INTERN_K, "H5Cget_sym_k"); + VERIFY(iparm2,F2_SYM_LEAF_K,"H5Cget_sym_k"); /* Release file-creation template */ ret=H5Mclose(tmpl1); diff --git a/test/tohdr.c b/test/tohdr.c index 9965092..dd65eff 100644 --- a/test/tohdr.c +++ b/test/tohdr.c @@ -74,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_ent, H5O_STAB, H5O_NEW_MESG, &stab); + status = H5O_modify (&oh_ent, H5O_STAB, H5O_NEW_MESG, 0, &stab); VERIFY (status, 0, "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, &oh_ent, H5O_STAB, 0, &ro); + ptr = H5O_read (&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"); @@ -90,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_ent, H5O_STAB, 0, &stab); + status = H5O_modify (&oh_ent, H5O_STAB, 0, 0, &stab); VERIFY (status, 0, "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, &oh_ent, H5O_STAB, 0, &ro); + ptr = H5O_read (&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"); @@ -107,17 +107,11 @@ test_ohdr (void) MESSAGE (8, ("Creating a duplicate message...\n")); stab.btree_addr.offset = 55555555; stab.heap_addr.offset = 66666666; - status = H5O_modify (f, &oh_ent, H5O_STAB, H5O_NEW_MESG, &stab); + status = H5O_modify (&oh_ent, H5O_STAB, H5O_NEW_MESG, 0, &stab); VERIFY (status, 1, "H5O_modify"); - 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 (oh_ent.cache.stab.btree_addr.offset, stab.btree_addr.offset, - "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, &oh_ent, H5O_STAB, 1, &ro); + ptr = H5O_read (&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"); @@ -129,17 +123,11 @@ test_ohdr (void) MESSAGE (8, ("Modifying the duplicate message...\n")); stab.btree_addr.offset = 77777777; stab.heap_addr.offset = 88888888; - status = H5O_modify (f, &oh_ent, H5O_STAB, 1, &stab); + status = H5O_modify (&oh_ent, H5O_STAB, 1, 0, &stab); VERIFY (status, 1, "H5O_modify"); - 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 (oh_ent.cache.stab.btree_addr.offset, stab.btree_addr.offset, - "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); - ptr = H5O_read (f, &oh_ent, H5O_STAB, 1, &ro); + ptr = H5O_read (&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"); @@ -153,7 +141,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_ent, H5O_STAB, H5O_NEW_MESG, &stab); + status = H5O_modify (&oh_ent, H5O_STAB, H5O_NEW_MESG, 0, &stab); VERIFY (status, 2+i, "H5O_modify"); } H5AC_flush (f, NULL, 0, TRUE); @@ -166,7 +154,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_ent, H5O_STAB, H5O_NEW_MESG, &stab); + status = H5O_modify (&oh_ent, H5O_STAB, H5O_NEW_MESG, 0, &stab); VERIFY (status, 42+i, "H5O_modify"); H5AC_flush (f, NULL, 0, TRUE); } @@ -174,9 +162,10 @@ test_ohdr (void) /* * Delete all symbol table messages. */ - status = H5O_remove (f, &oh_ent, H5O_STAB, H5O_ALL); + status = H5O_remove (&oh_ent, H5O_STAB, H5O_ALL); CHECK_I (status, "H5O_remove"); - /* close the file */ + /* release resources */ + H5O_close (&oh_ent); H5Fclose (fid); } diff --git a/test/tstab.c b/test/tstab.c index c5542ee..f16d8f5 100644 --- a/test/tstab.c +++ b/test/tstab.c @@ -75,11 +75,13 @@ test_1 (void) /* create the object */ status = H5O_create (f, 0, &ent1); CHECK_I (status, "H5O_create"); - status = H5G_insert (f, "/", &ent1); + status = H5G_insert ("/", &ent1); CHECK_I (status, "H5G_insert"); + status = H5O_close (&ent1); + CHECK_I (status, "H5O_close"); /* look for a name message -- it shouldn't be present */ - status_ptr = H5O_read (f, &ent1, H5O_NAME, 0, &name_mesg); + status_ptr = H5O_read (&ent1, H5O_NAME, 0, &name_mesg); VERIFY (status_ptr, NULL, "H5O_read [didn't fail but should have]"); /* @@ -105,8 +107,10 @@ test_1 (void) /* create the object */ status = H5O_create (f, 0, &ent2); CHECK_I (status, "H5O_create"); - status = H5G_insert (f, "/second", &ent2); + status = H5G_insert ("/second", &ent2); CHECK_I (status, "H5G_insert"); + status = H5O_close (&ent2); + CHECK_I (status, "H5O_close"); /* try to read the first object */ HDmemset (&obj_ent, 0xff, sizeof(H5G_entry_t)); @@ -137,11 +141,13 @@ test_1 (void) /* create the object */ status = H5O_create (f, 0, &ent1); CHECK_I (status, "H5O_create"); - status = H5G_insert (f, "/foo", &ent1); + status = H5G_insert ("/foo", &ent1); CHECK_I (status, "H5G_insert"); + status = H5O_close (&ent1); + CHECK_I (status, "H5O_close"); /* does it have the correct name message? */ - status_ptr = H5O_read (f, &ent1, H5O_NAME, 0, &name_mesg); + status_ptr = H5O_read (&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, "H5G_insert"); @@ -179,8 +185,10 @@ test_1 (void) /* create the object */ status = H5O_create (f, 0, &ent2); CHECK_I (status, "H5O_create"); - status = H5G_insert (f, "/second", &ent2); + status = H5G_insert ("/second", &ent2); CHECK_I (status, "H5G_insert"); + status = H5O_close (&ent2); + CHECK_I (status, "H5O_close"); /* try to read the first object */ HDmemset (&obj_ent, 0, sizeof(H5G_entry_t)); @@ -190,7 +198,7 @@ test_1 (void) VERIFY (b, TRUE, "H5G_insert"); /* the first object should not have a name message */ - status_ptr = H5O_read (f, &ent1, H5O_NAME, 0, &name_mesg); + status_ptr = H5O_read (&ent1, H5O_NAME, 0, &name_mesg); VERIFY (status_ptr, NULL, "H5O_read [didn't fail but should have]"); /* close the file */ @@ -217,13 +225,12 @@ test_1 (void) static void test_2 (void) { - hid_t fid, props; + hid_t fid, props, dir; H5F_t *f; int i; char name[256]; herr_t status; int nsyms = 5000; - H5G_t *dir = NULL; MESSAGE (2, ("........large directories\n")); @@ -233,8 +240,7 @@ test_2 (void) */ props = H5Ccreate (H5C_FILE_CREATE); #if 1 - H5Cset_prop (props, H5F_SYM_LEAF_K, 16); - H5Cset_prop (props, H5F_SYM_INTERN_K, 16); + H5Cset_sym_k (props, 16, 16); #endif /* create the file */ @@ -248,20 +254,23 @@ test_2 (void) * Create a directory that has so many entries that the root * of the B-tree ends up splitting. */ - dir = H5G_create (f, "/big", nsyms*12+2); - CHECK_PTR (dir, "H5G_mkdir"); - status = H5G_close (dir); - CHECK_I (status, "H5G_close"); + dir = H5Gcreate (fid, "/big", nsyms*16+2); + CHECK_I (dir, "H5Gcreate"); + status = H5Gclose (dir); + CHECK_I (status, "H5Gclose"); + status = H5Gset (fid, "/big"); + CHECK_I (status, "H5Gset"); + for (i=0; i<nsyms; i++) { - sprintf (name, "/big/%05d%05d", rand()%100000, i); + sprintf (name, "%05d%05d", rand()%100000, i); MESSAGE (8, ("%s\n", name)); - dir = H5G_create (f, name, 0); - CHECK_PTR (dir, "H5G_create"); - H5G_close (dir); + dir = H5Gcreate (fid, name, 0); + CHECK_I (dir, "H5Gcreate"); + status = H5Gclose (dir); + CHECK_I (status, "H5Gclose"); } - /* close the file */ status = H5Fclose (fid); CHECK_I (status, "H5Fclose"); |