diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-12-13 20:29:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-12-13 20:29:56 (GMT) |
commit | 1546d2cdd717519e413180f71a3cd5741fd619b8 (patch) | |
tree | ba5cf0f884ebe42cbd6ed6e0ae1789247d8606e9 | |
parent | d9a7af48db4cb58582a490695d6022e03756dd7c (diff) | |
parent | cdc0a27d87134a7cfdd19e84bb152c629f306ff0 (diff) | |
download | hdf5-1546d2cdd717519e413180f71a3cd5741fd619b8.zip hdf5-1546d2cdd717519e413180f71a3cd5741fd619b8.tar.gz hdf5-1546d2cdd717519e413180f71a3cd5741fd619b8.tar.bz2 |
Merging in latest from upstream (HDFFV/hdf5:refs/heads/hdf5_1_8)
* commit 'cdc0a27d87134a7cfdd19e84bb152c629f306ff0':
Fixed typo.
Added data files
Added new files
Fixed comments and updated Makefile.in Platforms tested: Linux/32 2.6 (jam)
Adding tests for version bounds Description: - Added test program, tverbounds18.c, that reads various files of different layout versions - Added the data files: bounds_earliest_latest.h5 bounds_earliest_v18.h5 bounds_latest_latest.h5 bounds_v18_latest.h5 bounds_v18_v18.h5 Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
-rw-r--r-- | MANIFEST | 6 | ||||
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 5 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/Makefile.in | 5 | ||||
-rw-r--r-- | test/bounds_earliest_latest.h5 | bin | 0 -> 166064 bytes | |||
-rw-r--r-- | test/bounds_earliest_v18.h5 | bin | 0 -> 84016 bytes | |||
-rw-r--r-- | test/bounds_latest_latest.h5 | bin | 0 -> 82048 bytes | |||
-rw-r--r-- | test/bounds_v18_latest.h5 | bin | 0 -> 83095 bytes | |||
-rw-r--r-- | test/bounds_v18_v18.h5 | bin | 0 -> 165143 bytes | |||
-rw-r--r-- | test/testhdf5.c | 1 | ||||
-rw-r--r-- | test/testhdf5.h | 92 | ||||
-rw-r--r-- | test/tverbounds18.c | 280 |
13 files changed, 344 insertions, 48 deletions
@@ -838,6 +838,11 @@ ./test/be_extlink2.h5 ./test/big.c ./test/bittests.c +./test/bounds_earliest_latest.h5 +./test/bounds_earliest_v18.h5 +./test/bounds_latest_latest.h5 +./test/bounds_v18_latest.h5 +./test/bounds_v18_v18.h5 ./test/btree2.c ./test/cache.c ./test/cache_api.c @@ -977,6 +982,7 @@ ./test/ttsafe_dcreate.c ./test/ttsafe_error.c ./test/tunicode.c +./test/tverbounds18.c ./test/tvlstr.c ./test/tvltypes.c ./test/unlink.c diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8d889e4..4f990cf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -161,6 +161,7 @@ set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/ttime.c ${HDF5_TEST_SOURCE_DIR}/ttst.c ${HDF5_TEST_SOURCE_DIR}/tunicode.c + ${HDF5_TEST_SOURCE_DIR}/tverbounds18.c ${HDF5_TEST_SOURCE_DIR}/tvltypes.c ${HDF5_TEST_SOURCE_DIR}/tvlstr.c ) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 85a49fc..f7b12ee 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -107,6 +107,11 @@ set (HDF5_REFERENCE_TEST_FILES be_data.h5 be_extlink1.h5 be_extlink2.h5 + bounds_earliest_latest.h5 + bounds_earliest_v18.h5 + bounds_latest_latest.h5 + bounds_v18_latest.h5 + bounds_v18_v18.h5 corrupt_stab_msg.h5 deflate.h5 family_v16_00000.h5 diff --git a/test/Makefile.am b/test/Makefile.am index 7c55e5b..fd7f9b5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -166,7 +166,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \ trefer.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \ - tvlstr.c tvltypes.c + tvlstr.c tvltypes.c tverbounds18.c # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh diff --git a/test/Makefile.in b/test/Makefile.in index e3fea25..21b1a63 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -455,7 +455,7 @@ am_testhdf5_OBJECTS = testhdf5.$(OBJEXT) tarray.$(OBJEXT) \ trefer.$(OBJEXT) trefstr.$(OBJEXT) tselect.$(OBJEXT) \ tskiplist.$(OBJEXT) tsohm.$(OBJEXT) ttime.$(OBJEXT) \ ttst.$(OBJEXT) tunicode.$(OBJEXT) tvlstr.$(OBJEXT) \ - tvltypes.$(OBJEXT) + tvltypes.$(OBJEXT) tverbounds18.$(OBJEXT) testhdf5_OBJECTS = $(am_testhdf5_OBJECTS) testhdf5_LDADD = $(LDADD) testhdf5_DEPENDENCIES = libh5test.la $(LIBHDF5) @@ -1149,7 +1149,7 @@ VFD_LIST = sec2 stdio core core_paged split multi family \ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \ trefer.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \ - tvlstr.c tvltypes.c + tvlstr.c tvltypes.c tverbounds18.c # Temporary files. @@ -1664,6 +1664,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttsafe_error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tunicode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tverbounds18.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvlstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvltypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ diff --git a/test/bounds_earliest_latest.h5 b/test/bounds_earliest_latest.h5 Binary files differnew file mode 100644 index 0000000..a05d461 --- /dev/null +++ b/test/bounds_earliest_latest.h5 diff --git a/test/bounds_earliest_v18.h5 b/test/bounds_earliest_v18.h5 Binary files differnew file mode 100644 index 0000000..929c6f8 --- /dev/null +++ b/test/bounds_earliest_v18.h5 diff --git a/test/bounds_latest_latest.h5 b/test/bounds_latest_latest.h5 Binary files differnew file mode 100644 index 0000000..6e8bcad --- /dev/null +++ b/test/bounds_latest_latest.h5 diff --git a/test/bounds_v18_latest.h5 b/test/bounds_v18_latest.h5 Binary files differnew file mode 100644 index 0000000..f401ebb --- /dev/null +++ b/test/bounds_v18_latest.h5 diff --git a/test/bounds_v18_v18.h5 b/test/bounds_v18_v18.h5 Binary files differnew file mode 100644 index 0000000..2f7837b --- /dev/null +++ b/test/bounds_v18_v18.h5 diff --git a/test/testhdf5.c b/test/testhdf5.c index e52d1e8..de1c23d 100644 --- a/test/testhdf5.c +++ b/test/testhdf5.c @@ -66,6 +66,7 @@ main(int argc, char *argv[]) AddTest("unicode", test_unicode, cleanup_unicode, "UTF-8 Encoding", NULL); AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); AddTest("misc", test_misc, cleanup_misc, "Miscellaneous", NULL); + AddTest("verbounds18", test_verbounds_18, cleanup_verbounds_18, "Version Bounds", NULL); /* Display testing information */ TestInfo(argv[0]); diff --git a/test/testhdf5.h b/test/testhdf5.h index 2cbe6c6..fd9d68d 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -167,53 +167,55 @@ extern "C" { #endif /* Prototypes for the test routines */ -void test_metadata(void); -void test_checksum(void); -void test_tst(void); -void test_heap(void); -void test_refstr(void); -void test_file(void); -void test_h5o(void); -void test_h5t(void); -void test_h5s(void); -void test_coords(void); -void test_h5d(void); -void test_attr(void); -void test_select(void); -void test_time(void); -void test_reference(void); -void test_vltypes(void); -void test_vlstrings(void); -void test_iterate(void); -void test_array(void); -void test_genprop(void); -void test_configure(void); -void test_misc(void); -void test_ids(void); -void test_skiplist(void); -void test_sohm(void); -void test_unicode(void); +void test_metadata(void); +void test_checksum(void); +void test_tst(void); +void test_heap(void); +void test_refstr(void); +void test_file(void); +void test_h5o(void); +void test_h5t(void); +void test_h5s(void); +void test_coords(void); +void test_h5d(void); +void test_attr(void); +void test_select(void); +void test_time(void); +void test_reference(void); +void test_vltypes(void); +void test_vlstrings(void); +void test_iterate(void); +void test_array(void); +void test_genprop(void); +void test_configure(void); +void test_misc(void); +void test_ids(void); +void test_skiplist(void); +void test_sohm(void); +void test_unicode(void); +void test_verbounds_18(void); /* Prototypes for the cleanup routines */ -void cleanup_metadata(void); -void cleanup_checksum(void); -void cleanup_file(void); -void cleanup_h5o(void); -void cleanup_h5s(void); -void cleanup_coords(void); -void cleanup_attr(void); -void cleanup_select(void); -void cleanup_time(void); -void cleanup_reference(void); -void cleanup_vltypes(void); -void cleanup_vlstrings(void); -void cleanup_iterate(void); -void cleanup_array(void); -void cleanup_genprop(void); -void cleanup_configure(void); -void cleanup_sohm(void); -void cleanup_misc(void); -void cleanup_unicode(void); +void cleanup_metadata(void); +void cleanup_checksum(void); +void cleanup_file(void); +void cleanup_h5o(void); +void cleanup_h5s(void); +void cleanup_coords(void); +void cleanup_attr(void); +void cleanup_select(void); +void cleanup_time(void); +void cleanup_reference(void); +void cleanup_vltypes(void); +void cleanup_vlstrings(void); +void cleanup_iterate(void); +void cleanup_array(void); +void cleanup_genprop(void); +void cleanup_configure(void); +void cleanup_sohm(void); +void cleanup_misc(void); +void cleanup_unicode(void); +void cleanup_verbounds_18(void); #ifdef __cplusplus } diff --git a/test/tverbounds18.c b/test/tverbounds18.c new file mode 100644 index 0000000..abba767 --- /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 = H5Dopen(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen"); + + 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 = H5Dopen(fid, "DS_chunked_layout_4", H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(dset, FAIL, "H5Dopen"); + + /* 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 = H5Dopen(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen"); + + 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 = H5Dopen(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen"); + + 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 = H5Dopen(fid, "DS_chunked_layout_3", H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dopen"); + + 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 = H5Dopen(fid, "DS_chunked_layout_4", H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(dset, FAIL, "H5Dopen"); + + /* 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) +{ +} |