diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-06-20 15:22:37 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-06-20 15:22:37 (GMT) |
commit | 17eb14fe723aaf95ecc1ea5ecd3f46a5ac652e40 (patch) | |
tree | 1624efe603d42b8dec72527287bad684b5036e2b /test/dangle.c | |
parent | d12e5f8ebf429768a6e42a53674d817892dc51d1 (diff) | |
download | hdf5-17eb14fe723aaf95ecc1ea5ecd3f46a5ac652e40.zip hdf5-17eb14fe723aaf95ecc1ea5ecd3f46a5ac652e40.tar.gz hdf5-17eb14fe723aaf95ecc1ea5ecd3f46a5ac652e40.tar.bz2 |
[svn-r7073] Purpose:
Expand test
Description:
Expanded # of dangling objects from 2 to 1000, to stress ID cleanup code
in library more.
Platforms tested:
FreeBSD 4.8 (sleipnir)
h5committest
Diffstat (limited to 'test/dangle.c')
-rw-r--r-- | test/dangle.c | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/test/dangle.c b/test/dangle.c index 1f0acae..5f8de0c 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -26,6 +26,8 @@ const char *FILENAME[] = { NULL }; +#define MAX_DANGLE 1000 + #define DSETNAME "Dataset" #define GROUPNAME "Group" #define TYPENAME "Type" @@ -57,6 +59,7 @@ test_dangle_dataset(H5F_close_degree_t degree) hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ hid_t sid; /* Dataspace ID */ + unsigned u; /* Local index variable */ TESTING(" dangling dataset IDs"); @@ -90,15 +93,15 @@ test_dangle_dataset(H5F_close_degree_t degree) TEST_ERROR; } H5E_END_TRY; - if((dsid = H5Dopen (fid, DSETNAME))<0) - TEST_ERROR; - - if((dsid = H5Dopen (fid, DSETNAME))<0) - TEST_ERROR; - if(H5Sclose(sid)<0) TEST_ERROR; + /* Leave open a _lot_ of objects */ + for(u=0; u<MAX_DANGLE; u++) { + if((dsid = H5Dopen (fid, DSETNAME))<0) + TEST_ERROR; + } /* end for */ + if(degree==H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { if(H5Fclose(fid)>=0) @@ -153,6 +156,7 @@ test_dangle_group(H5F_close_degree_t degree) hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t gid; /* Group ID */ + unsigned u; /* Local index variable */ TESTING(" dangling group IDs"); @@ -183,8 +187,11 @@ test_dangle_group(H5F_close_degree_t degree) TEST_ERROR; } H5E_END_TRY; - if((gid = H5Gopen (fid, GROUPNAME))<0) - TEST_ERROR; + /* Leave open a _lot_ of objects */ + for(u=0; u<MAX_DANGLE; u++) { + if((gid = H5Gopen (fid, GROUPNAME))<0) + TEST_ERROR; + } /* end for */ if((gid = H5Gopen (fid, GROUPNAME))<0) TEST_ERROR; @@ -243,6 +250,7 @@ test_dangle_datatype(H5F_close_degree_t degree) hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t tid; /* Datatype ID */ + unsigned u; /* Local index variable */ TESTING(" dangling named datatype IDs"); @@ -280,11 +288,11 @@ test_dangle_datatype(H5F_close_degree_t degree) if(H5Tclose(tid)<0) TEST_ERROR; - if((tid = H5Topen (fid, TYPENAME))<0) - TEST_ERROR; - - if((tid = H5Topen (fid, TYPENAME))<0) - TEST_ERROR; + /* Leave open a _lot_ of objects */ + for(u=0; u<MAX_DANGLE; u++) { + if((tid = H5Topen (fid, TYPENAME))<0) + TEST_ERROR; + } /* end for */ if(degree==H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { @@ -342,6 +350,7 @@ test_dangle_attribute(H5F_close_degree_t degree) hid_t dsid; /* Dataset ID */ hid_t sid; /* Dataspace ID */ hid_t aid; /* Attribute ID */ + unsigned u; /* Local index variable */ TESTING(" dangling attribute IDs"); @@ -382,18 +391,18 @@ test_dangle_attribute(H5F_close_degree_t degree) TEST_ERROR; } H5E_END_TRY; - if((aid = H5Aopen_name (dsid, ATTRNAME))<0) + if(H5Sclose(sid)<0) TEST_ERROR; - if((aid = H5Aopen_name (dsid, ATTRNAME))<0) - TEST_ERROR; + /* Leave open a _lot_ of objects */ + for(u=0; u<MAX_DANGLE; u++) { + if((aid = H5Aopen_name (dsid, ATTRNAME))<0) + TEST_ERROR; + } /* end for */ if(H5Dclose(dsid)<0) TEST_ERROR; - if(H5Sclose(sid)<0) - TEST_ERROR; - if(degree==H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { if(H5Fclose(fid)>=0) |