diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2018-06-07 16:30:08 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2018-06-07 16:30:08 (GMT) |
commit | 551f15f8ae02ca9c995619b216121081eb07633e (patch) | |
tree | 995de8be59b4d8524753eba6b542ce4039d54c79 /test/tverbounds18.c | |
parent | b8c6b68c35fa2be23ef488a1d81097ff3ed55000 (diff) | |
parent | 664186b91d9198915baca4c6dca3f7b03695d316 (diff) | |
download | hdf5-551f15f8ae02ca9c995619b216121081eb07633e.zip hdf5-551f15f8ae02ca9c995619b216121081eb07633e.tar.gz hdf5-551f15f8ae02ca9c995619b216121081eb07633e.tar.bz2 |
Merge pull request #1106 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.8/master to 1.8/masterhdf5-1_8_21
* commit '664186b91d9198915baca4c6dca3f7b03695d316': (124 commits)
Commit HDF5 1.8.21 release version strings.
Update INSTALL and INSTALL_parallel files to remove references to ancient systems and add generic steps for building HDF5 on HPC clusters.
Update various INSTALL files for 1.8.21 release.
Add missing space and correct typo.
Modified a section for newly supported systems and compilers (vs. 1.8.20 release); Brought edits for tools bug fixes from 1.10.2 RELEASE.txt as we agreed with Allen.
It is my test under Larry's guidance.
Remove build directory which was unintentionally committed.
Updated MANIFEST
Switch default build mode to production. Update version to 1.8.21 in anticipation of release.
Fixed EED-319 Description: Added an html version for the C++ function mapping table and removed the single web page version. Updated cpp_doc_config to use the html file. Fixed some typos. Running "doxygen cpp_doc_config" successfully.
HDFFV-10473 fix HDFFV-10398 attribute location
Add missing C++ entries to RELEASE.txt.
pre1 release.
Add missing RELEASE.txt entries for C++.
Update Windows test machines
Fix soversion naming and update cmake scripts
Update version in RELEASE.txt. Correct merge errors from hdf5_1_8.
Fixed typos
Fixed typos
Fixed typos
...
Diffstat (limited to 'test/tverbounds18.c')
-rw-r--r-- | test/tverbounds18.c | 280 |
1 files changed, 280 insertions, 0 deletions
diff --git a/test/tverbounds18.c b/test/tverbounds18.c new file mode 100644 index 0000000..2ae87c1 --- /dev/null +++ b/test/tverbounds18.c @@ -0,0 +1,280 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*********************************************************** +* +* Test program: tverbounds18 +* +* Test 1.8 compatibility with version bounds +* +* Description +* =========== +* This file tests the compatibility in the files generated +* by gen_bounds.c in HDF5 1.10.2: +* - bounds_earliest_latest.h5 +* - bounds_earliest_v18.h5 +* - bounds_latest_latest.h5 +* - bounds_v18_latest.h5 +* - bounds_v18_v18.h5 +* +* Oct 30, 2017 +* +*************************************************************/ + +#include "h5test.h" +#include "H5srcdir.h" +#include "testhdf5.h" + +/*********************************************************************** + * test_earliest_latest() reads file "bounds_earliest_latest.h5" + * + * Description: + * This test shows that the 1.8 library is able to open a chunked dataset + * with layout version 3 in a file with superblock version 0. + * However, it cannot open the chunked dataset with layout version 4 + * in the same file. + * + ***********************************************************************/ +#define FILENAME_E_L "bounds_earliest_latest.h5" +static void test_earliest_latest(void) +{ + hid_t fid = FAIL; /* File ID */ + hid_t dset = FAIL; /* Dataset ID */ + herr_t ret; /* Return value */ + + /* Test file name must have correct path when srcdir is used */ + const char *testfile = H5_get_srcdir_filename(FILENAME_E_L); + + /* Open file */ + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* + * Open the chunked dataset with layout version 3 + */ + + /* Open the dataset */ + dset = H5Dopen2(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen2"); + + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + + /* + * Open the chunked dataset with layout version 4. This should fail + * with HDF5 1.8. + */ + + /* Open the dataset */ + H5E_BEGIN_TRY { + dset = H5Dopen2(fid, "DS_chunked_layout_4", H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(dset, FAIL, "H5Dopen2"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} + +/*********************************************************************** + * test_earliest_v18() reads file "bounds_earliest_v18.h5" + * + * Description: + * This test shows that the 1.8 library is able to open a chunked dataset + * with layout version 3 in a file with superblock version 0. + * + ***********************************************************************/ +#define FILENAME_E_18 "bounds_earliest_v18.h5" + +static void test_earliest_v18(void) +{ + hid_t fid = FAIL; /* File ID */ + hid_t dset = FAIL; /* Dataset ID */ + herr_t ret; /* Return value */ + + /* Test file name must have correct path when srcdir is used */ + const char *testfile = H5_get_srcdir_filename(FILENAME_E_18); + + /* Open file */ + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* + * Open the chunked dataset with layout version 3 + */ + + /* Open the dataset */ + dset = H5Dopen2(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen2"); + + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} + +/*********************************************************************** + * test_latest_latest() reads file "bounds_latest_latest.h5" + * + * Description: + * This test shows that the 1.8 library is unable to open a file with + * superblock version 3. + * + ***********************************************************************/ +#define FILENAME_L_L "bounds_latest_latest.h5" + +static void test_latest_latest(void) +{ + hid_t fid = FAIL; /* File ID */ + + /* Test file name must have correct path when srcdir is used */ + const char *testfile = H5_get_srcdir_filename(FILENAME_L_L); + + /* Opening the file of latest version bounds should fail with HDF5 1.8. */ + H5E_BEGIN_TRY { + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(fid, FAIL, "H5Fopen file with latest version bounds"); +} + +/*********************************************************************** + * test_v18_latest() reads file "bounds_v18_latest.h5" + * + * Description: + * This test shows that the 1.8 library is able to open a chunked dataset + * with layout version 3 in a file with superblock version 2. + * + ***********************************************************************/ +#define FILENAME_18_L "bounds_v18_latest.h5" + +static void test_v18_latest(void) +{ + hid_t fid = FAIL; /* File ID */ + hid_t dset = FAIL; /* Dataset ID */ + herr_t ret; /* Return value */ + + /* Test file name must have correct path when srcdir is used */ + const char *testfile = H5_get_srcdir_filename(FILENAME_18_L); + + /* Open file */ + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* + * Open the chunked dataset with layout version 3 + */ + + /* Open the dataset */ + dset = H5Dopen2(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen2"); + + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} + +/*********************************************************************** + * test_v18_v18() reads file "bounds_v18_v18.h5" + * + * Description: + * This test shows that the 1.8 library is able to open a chunked dataset + * with layout version 3 in a file with superblock version 2 and + * version 1.8 bounds. However, it cannot open the chunked + * dataset with layout version 4 in the same file. + * + ***********************************************************************/ +#define FILENAME_18_18 "bounds_v18_v18.h5" + +static void test_v18_v18(void) +{ + hid_t fid = FAIL; /* File ID */ + hid_t dset = FAIL; /* Dataset ID */ + herr_t ret; /* Return value */ + + /* Test file name must have correct path when srcdir is used */ + const char *testfile = H5_get_srcdir_filename(FILENAME_18_18); + + /* Open file */ + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* + * Open the chunked dataset with layout version 3 + */ + + /* Open the dataset */ + dset = H5Dopen2(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen2"); + + ret = H5Dclose(dset); + CHECK(ret, FAIL, "H5Dclose"); + + /* + * Open the chunked dataset with layout version 4. This should fail + * with HDF5 1.8. + */ + + /* Open the dataset */ + H5E_BEGIN_TRY { + dset = H5Dopen2(fid, "DS_chunked_layout_4", H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(dset, FAIL, "H5Dopen2"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} + +/************************************************************************* +** test_verbounds_18() +** Main routine to test library version bounds with HDF5 1.8 library. +** +*************************************************************************/ +void test_verbounds_18(void) +{ + /* Output message about test being performed */ + MESSAGE(5, ("Testing Compatibility of Version Bounds with 1.8\n")); + + /* Test with file bounds_earliest_latest.h5 */ + test_earliest_latest(); + + /* Test with file bounds_earliest_v18.h5 */ + test_earliest_v18(); + + /* Test with file bounds_latest_latest.h5 */ + test_latest_latest(); + + /* Test with file bounds_v18_latest.h5 */ + test_v18_latest(); + + /* Test with file bounds_v18_v18.h5 */ + test_v18_v18(); +} + +/*------------------------------------------------------------------------- + * Function: cleanup_verbounds_18 + * + * Purpose: Cleanup temporary test files + * + * Return: none + * + *------------------------------------------------------------------------- + */ +void cleanup_verbounds_18(void) +{ +} |