diff options
Diffstat (limited to 'test/genall5.c')
-rw-r--r-- | test/genall5.c | 137 |
1 files changed, 94 insertions, 43 deletions
diff --git a/test/genall5.c b/test/genall5.c index 8a1e853..e3a9c96 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer @@ -1250,29 +1248,55 @@ void os_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; + hid_t fapl = -1; + H5F_libver_t low, high; + herr_t ret; - if ( pass ) { /* turn file format latest off */ + if ( pass ) { /* get the file's file access property list */ - ret = H5Fset_latest_format(fid, FALSE); + fapl = H5Fget_access_plist(fid); + if ( fapl <= 0 ) { - if ( ret < 0 ) { + pass = FALSE; + failure_mssg = "os_grp_0: H5Fget_access_plist() failed."; + } + HDassert(fapl > 0); + } + + if ( pass ) { /* get low and high bounds from fapl */ - pass = FALSE; - failure_mssg = "os_grp_0: H5Fset_latest_format() failed(1)."; - } + ret = H5Pget_libver_bounds(fapl, &low, &high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; + } HDassert(ret >= 0); } + if ( pass ) { /* turn file format latest off */ + + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } + } + if ( pass ) { gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( gid <= 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Gcreate2() failed."; - } + pass = FALSE; + failure_mssg = "os_grp_0: H5Gcreate2() failed."; + } HDassert(gid > 0); } @@ -1280,24 +1304,25 @@ os_grp_0(hid_t fid, const char *group_name) ret = H5Gclose(gid); - if ( ret < 0 ) { + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Gclose() failed."; - } + pass = FALSE; + failure_mssg = "os_grp_0: H5Gclose() failed."; + } HDassert(ret >= 0); } - if ( pass ) { /* turn file format latest on */ + if ( pass ) { /* restore low and high bounds */ - ret = H5Fset_latest_format(fid, TRUE); - - if ( ret < 0 ) { + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, low, high); + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_0: H5Fset_latest_format() failed(2)."; - } - HDassert(ret >= 0); + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } } return; @@ -1464,28 +1489,53 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { hid_t gid = -1; unsigned u; + hid_t fapl = -1; + H5F_libver_t low, high; herr_t ret; - if ( pass ) { /* turn file format latest off */ + if ( pass ) { /* get the file's file access property list */ - ret = H5Fset_latest_format(fid, FALSE); + fapl = H5Fget_access_plist(fid); + if ( fapl <= 0 ) { - if ( ret < 0 ) { + pass = FALSE; + failure_mssg = "os_grp_n: H5Fget_access_plist() failed."; + } + HDassert(fapl > 0); + } - pass = FALSE; - failure_mssg = "os_grp_n: H5Fset_latest_format() failed(1)."; - } + if ( pass ) { /* get low and high bounds from fapl */ + + ret = H5Pget_libver_bounds(fapl, &low, &high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; + } HDassert(ret >= 0); } + if ( pass ) { /* turn file format latest off */ + + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high); + if ( ret < 0 ) { + + pass = FALSE; + failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; + } + HDassert(ret >= 0); + } + } + if ( pass ) { gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( gid <= 0 ) { - pass = FALSE; - failure_mssg = "os_grp_n: H5Gcreate2() failed."; + pass = FALSE; + failure_mssg = "os_grp_n: H5Gcreate2() failed."; } HDassert(gid > 0); } @@ -1540,16 +1590,17 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) assert(ret >= 0); } - if ( pass ) { /* turn file format latest on */ - - ret = H5Fset_latest_format(fid, TRUE); + if ( pass ) { /* restore low and high bounds */ - if ( ret < 0 ) { + if(low >= H5F_LIBVER_V18) { + ret = H5Fset_libver_bounds(fid, low, high); + if ( ret < 0 ) { - pass = FALSE; - failure_mssg = "os_grp_n: H5Fset_latest_format() failed(2)."; - } - HDassert(ret >= 0); + pass = FALSE; + failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2)."; + } + HDassert(ret >= 0); + } } return; |