summaryrefslogtreecommitdiffstats
path: root/test/tstab.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-01-07 17:14:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-01-07 17:14:26 (GMT)
commit159fa7a232e1961940b83f035f4c27338d26337e (patch)
treeb7344e9cfaadbbec3bc3a0576df8c264debb8239 /test/tstab.c
parent1d17defdfc977c063c7ff20b5868bef9a76e5d9a (diff)
downloadhdf5-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/tstab.c')
-rw-r--r--test/tstab.c49
1 files changed, 29 insertions, 20 deletions
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");