diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2021-10-18 21:50:40 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2021-10-18 21:50:40 (GMT) |
commit | 588f7f47da212a8a8077a4394ff740a4e8e537ee (patch) | |
tree | 8bb0dbb13d86f84067d3594ef07918e0fe73f4f6 /test/dtypes.c | |
parent | 4c253cc332397a02cd172cb80d8d23d7161a485e (diff) | |
parent | 82b61574e1eb5f157d289185656eb877c3a33582 (diff) | |
download | hdf5-588f7f47da212a8a8077a4394ff740a4e8e537ee.zip hdf5-588f7f47da212a8a8077a4394ff740a4e8e537ee.tar.gz hdf5-588f7f47da212a8a8077a4394ff740a4e8e537ee.tar.bz2 |
Merge branch 'hdf5_canon-develop' into selection_io
Diffstat (limited to 'test/dtypes.c')
-rw-r--r-- | test/dtypes.c | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 8b3101c..1c1a6ec 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3725,53 +3725,55 @@ test_compound_18(void) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - /* Open Generated File */ - /* (generated with gen_bad_compound.c) */ - if ((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + if (!h5_driver_uses_modified_filename()) { + /* Open Generated File */ + /* (generated with gen_bad_compound.c) */ + if ((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Try to open the datatype */ + H5E_BEGIN_TRY + { + tid = H5Topen2(file, "cmpnd", H5P_DEFAULT); + } + H5E_END_TRY; + if (tid > 0) { + H5Tclose(tid); + FAIL_PUTS_ERROR("opened named datatype with bad compound datatype") + } /* end if */ - /* Try to open the datatype */ - H5E_BEGIN_TRY - { - tid = H5Topen2(file, "cmpnd", H5P_DEFAULT); - } - H5E_END_TRY; - if (tid > 0) { - H5Tclose(tid); - FAIL_PUTS_ERROR("opened named datatype with bad compound datatype") - } /* end if */ + /* Try to open the dataset */ + H5E_BEGIN_TRY + { + did = H5Dopen2(file, "dataset", H5P_DEFAULT); + } + H5E_END_TRY; + if (did > 0) { + H5Dclose(did); + FAIL_PUTS_ERROR("opened dataset with bad compound datatype") + } /* end if */ - /* Try to open the dataset */ - H5E_BEGIN_TRY - { - did = H5Dopen2(file, "dataset", H5P_DEFAULT); - } - H5E_END_TRY; - if (did > 0) { - H5Dclose(did); - FAIL_PUTS_ERROR("opened dataset with bad compound datatype") - } /* end if */ + /* Open the group with the attribute */ + if ((gid = H5Gopen2(file, "group", H5P_DEFAULT)) < 0) + TEST_ERROR - /* Open the group with the attribute */ - if ((gid = H5Gopen2(file, "group", H5P_DEFAULT)) < 0) - TEST_ERROR + /* Try to open the dataset */ + H5E_BEGIN_TRY + { + aid = H5Aopen(gid, "attr", H5P_DEFAULT); + } + H5E_END_TRY; + if (aid > 0) { + H5Aclose(aid); + FAIL_PUTS_ERROR("opened attribute with bad compound datatype") + } /* end if */ - /* Try to open the dataset */ - H5E_BEGIN_TRY - { - aid = H5Aopen(gid, "attr", H5P_DEFAULT); + /* Close IDs */ + if (H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if (H5Fclose(file) < 0) + FAIL_STACK_ERROR } - H5E_END_TRY; - if (aid > 0) { - H5Aclose(aid); - FAIL_PUTS_ERROR("opened attribute with bad compound datatype") - } /* end if */ - - /* Close IDs */ - if (H5Gclose(gid) < 0) - FAIL_STACK_ERROR - if (H5Fclose(file) < 0) - FAIL_STACK_ERROR PASSED(); return 0; |