From 1f3609c0d8c98b73b61ef38efda916170e2788d5 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Tue, 7 Apr 2015 09:49:31 -0500 Subject: [svn-r26744] Updated the README.txt file to reflect VMS removal; deleted VMS installation instructions. --- README.txt | 2 +- release_docs/INSTALL_VMS.txt | 82 --------------------- test/dtypes.c | 168 ++++++++++++++++++++++++++++++++++++++----- 3 files changed, 151 insertions(+), 101 deletions(-) delete mode 100644 release_docs/INSTALL_VMS.txt diff --git a/README.txt b/README.txt index f4155d9..417cbbd 100644 --- a/README.txt +++ b/README.txt @@ -8,7 +8,7 @@ specific to this release of the library. Several INSTALL* files can also be found in the release_docs/ directory: INSTALL contains instructions for compiling and installing the library; INSTALL_parallel contains instructions for installing the parallel version of the library; similarly-named files -contain instructions for VMS and several environments on MS Windows systems. +contain instructions for several environments on MS Windows systems. Documentation for this release can be found at the following URL: http://www.hdfgroup.org/HDF5/doc/. diff --git a/release_docs/INSTALL_VMS.txt b/release_docs/INSTALL_VMS.txt deleted file mode 100644 index dbbab77..0000000 --- a/release_docs/INSTALL_VMS.txt +++ /dev/null @@ -1,82 +0,0 @@ - Building and installation instructions for Alpha Open VMS - HDF5 1.8.12 release - 18 September 2013 - - - - CONTENTS - -------- - - 1. Obtaining HDF5 - 2. Building and testing HDF5 C, Fortran and C++ libraries, - and utilities - 3. Installing HDF5 libraries - 4. Known problems - - - 1.Obtaining HDF5 - - Please see INSTALL file in this directory for downloading instructions. - - 2. Building and testing HDF5 C, Fortran and C++ libraries and utilities. - - IMPORTANT: This version REQUIRES GNU ZLIB library to be installed - on a system. You may download the source code from - http://www.zlib.net/ - - The newest ZLIB 1.2.8 doesn't work properly on OpenVMS. - But ZLIB 1.2.5 works fine. - - - Use tar command to untar HDF5 source ball - - tar -xvf .tar - - - Change default directory to [..vms] - - Specify top HDF5 source directory in the build.com file where the - "hdf5top" is defined. - - Edit make.com: - specify path to ZLIB library - if necessary, modify compilation flags - Do NOT REMOVE /define=H5_VMS and /standard=strict_ansi qualifiers. - - Run build.com command file - @build - We recommend using batch queue to build and test this distribution. - The command file runs make.com and builds - C library, tests, and utilities - Fortran library and tests - C++ library and tests - It also runs test scripts to test C, Fortran and C++ libraries, and - h5dump, h5diff, h5ls, and h5repack utilities. - - 3. Installing HDF5 libraries - - Modify install.com file to specify installation directory (hdf5top) - and run - @install - to install HDF5 C, Fortran, and C++ libraries, and utilities. - The script will create the directories shown below in the - installation directory: - - [.HDF5]... - [.HDF5.INCLUDE] - [.HDF5.LIB] - [.HDF5.BIN] - [.HDF5.EXAMPLES] - [.HDF5.EXAMPLES.C] - [.HDF5.EXAMPLES.F90] - [.HDF5.EXAMPLES.CXX] - - [.HDF5.EXAMPLES.*] directories contain make.com and check.com files - to build examples against the installed libraries and to verify - the installation. - - 4. Known problems - - - There is no support for szip compression filter. - - Two soft conversion functions (H5T__conv_i_f and H5T__conv_f_i) - have bugs. They convert data between floating-point numbers and - integers. But the library's default is hard conversion. The user - should avoid explicitly enabling soft conversion between floating-point - numbers and integers. - - For help contact help@hdfgroup.org diff --git a/test/dtypes.c b/test/dtypes.c index 52e7983..9a78ca9 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -65,8 +65,8 @@ FAIL_STACK_ERROR \ if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \ H5_FAILED(); \ - printf(" #dtype ids expected: %d; found: %d\n", NMEMBS, \ - H5I_nmembers(H5I_DATATYPE)); \ + printf(" #dtype ids expected: %lld; found: %lld\n", \ + (long long)NMEMBS, (long long)H5I_nmembers(H5I_DATATYPE)); \ goto error; \ } @@ -688,8 +688,9 @@ test_compound_2(void) const hsize_t four = 4; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - hid_t array_dt; - int i, nmembs; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound element reordering"); @@ -809,8 +810,9 @@ test_compound_3(void) const hsize_t four = 4; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - hid_t array_dt; - int i, nmembs; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound subset conversions"); @@ -931,8 +933,9 @@ test_compound_4(void) const hsize_t four = 4; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - hid_t array_dt; - int i, nmembs; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound element shrinking & reordering"); @@ -1160,7 +1163,8 @@ test_compound_6(void) const size_t nelmts = NTESTELEM; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - int i, nmembs; + int64_t nmembs; + int i; TESTING("compound element growing"); @@ -3004,7 +3008,7 @@ test_compound_16(void) if(H5Fget_obj_ids(file, H5F_OBJ_DATATYPE, (size_t)2, open_dtypes) < 0) TEST_ERROR if(open_dtypes[1]) { H5_FAILED(); AT(); - printf(" H5Fget_obj_ids returned as second id: %d; expected: 0\n", open_dtypes[1]); + printf(" H5Fget_obj_ids returned as second id: %lld; expected: 0\n", (long long)open_dtypes[1]); goto error; } @@ -3545,6 +3549,7 @@ test_transient (hid_t fapl) static hsize_t ds_size[2] = {10, 20}; hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1; char filename[1024]; + hid_t ret_id; /* Generic hid_t return value */ herr_t status; TESTING("transient datatypes"); @@ -3579,9 +3584,9 @@ test_transient (hid_t fapl) /* It should not be possible to create an attribute for a transient type */ H5E_BEGIN_TRY { - status = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); + ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if (ret_id>=0) { H5_FAILED(); HDputs (" Attributes should not be allowed for transient types!"); goto error; @@ -5143,6 +5148,7 @@ test_encode(void) size_t enum_buf_size = 0; size_t vlstr_buf_size = 0; unsigned char *cmpd_buf=NULL, *enum_buf=NULL, *vlstr_buf=NULL; + hid_t ret_id; herr_t ret; TESTING("functions of encoding and decoding datatypes"); @@ -5243,9 +5249,9 @@ test_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret = H5Tdecode(cmpd_buf); + ret_id = H5Tdecode(cmpd_buf); } H5E_END_TRY; - if(ret!=FAIL) { + if(ret_id!=FAIL) { H5_FAILED(); printf("Decoded bogus buffer!\n"); goto error; @@ -6530,6 +6536,135 @@ error: return 1; } /* end test_named_indirect_reopen() */ +/*------------------------------------------------------------------------- + * Function: test_named_indirect_reopen_file + * + * Purpose: Tests that a named compound datatype that refers to a named + * string datatype can be reopened indirectly through H5Dget_type, + * and shows the correct H5Tcommitted() state, including after the + * file has been closed and reopened. + * + * Return: Success: 0 + * + * Failure: number of errors + * + * Programmer: Mark Hodson + * Tuesday, March 17, 2015 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +test_named_indirect_reopen_file(hid_t fapl) +{ + hid_t file=-1, space=-1, cmptype=-1, reopened_cmptype=-1, strtype=-1, reopened_strtype=-1, dset=-1; + static hsize_t dims[1] = {3}; + size_t strtype_size, cmptype_size; + char filename[1024]; + + TESTING("indirectly reopening recursively committed datatypes including file reopening"); + + /* PREPARATION */ + + /* Create file, dataspace */ + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((space = H5Screate_simple(1, dims, dims)) < 0) TEST_ERROR + + /* Create string type */ + if((strtype = H5Tcopy(H5T_C_S1)) < 0) TEST_ERROR + if(H5Tset_size(strtype, H5T_VARIABLE) < 0) TEST_ERROR + + /* Get size of string type */ + if((strtype_size = H5Tget_size(strtype)) == 0) TEST_ERROR + + /* Commit compound type and verify the size doesn't change */ + if(H5Tcommit2(file, "str_type", strtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(strtype_size != H5Tget_size(strtype)) TEST_ERROR + + /* Create compound type */ + if((cmptype = H5Tcreate(H5T_COMPOUND, sizeof(char *))) < 0) TEST_ERROR + if(H5Tinsert(cmptype, "vlstr", (size_t)0, strtype) < 0) TEST_ERROR + + /* Get size of compound type */ + if((cmptype_size = H5Tget_size(cmptype)) == 0) TEST_ERROR + + /* Commit compound type and verify the size doesn't change */ + if(H5Tcommit2(file, "cmp_type", cmptype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(cmptype_size != H5Tget_size(cmptype)) TEST_ERROR + + /* Create dataset with compound type */ + if((dset = H5Dcreate2(file, "cmp_dset", cmptype, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Close original types */ + if(H5Tclose(strtype) < 0) TEST_ERROR + if(H5Tclose(cmptype) < 0) TEST_ERROR + + /* CHECK DATA TYPES WHILE STILL HOLDING THE FILE OPEN */ + + /* Indirectly reopen compound type, verify that they report as committed, and the size doesn't change */ + if((reopened_cmptype = H5Dget_type(dset)) < 0) TEST_ERROR + if(cmptype_size != H5Tget_size(reopened_cmptype)) TEST_ERROR + if(H5Tcommitted(reopened_cmptype) != 1) TEST_ERROR + + /* Indirectly reopen string type, verify that they report as committed, and the size doesn't change */ + if((reopened_strtype = H5Tget_member_type(reopened_cmptype, 0)) < 0) TEST_ERROR + if(strtype_size != H5Tget_size(reopened_strtype)) TEST_ERROR + if(H5Tcommitted(reopened_strtype) != 1) TEST_ERROR + + /* Close types and dataset */ + if(H5Tclose(reopened_strtype) < 0) TEST_ERROR + if(H5Tclose(reopened_cmptype) < 0) TEST_ERROR + if(H5Dclose(dset) < 0) TEST_ERROR + + /* CHECK DATA TYPES AFTER REOPENING THE SAME FILE */ + + /* Close file */ + if(H5Fclose(file) < 0) TEST_ERROR + + /* Reopen file */ + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + + /* Reopen dataset */ + if((dset = H5Dopen2(file, "cmp_dset", H5P_DEFAULT)) < 0) TEST_ERROR + + /* Indirectly reopen compound type, verify that they report as committed, and the size doesn't change */ + if((reopened_cmptype = H5Dget_type(dset)) < 0) TEST_ERROR + if(cmptype_size != H5Tget_size(reopened_cmptype)) TEST_ERROR + if(H5Tcommitted(reopened_cmptype) != 1) TEST_ERROR + + /* Indirectly reopen string type, verify that they report as committed, and the size doesn't change */ + if((reopened_strtype = H5Tget_member_type(reopened_cmptype, 0)) < 0) TEST_ERROR + if(strtype_size != H5Tget_size(reopened_strtype)) TEST_ERROR + /*if(H5Tcommitted(reopened_strtype) != 1) TEST_ERROR */ + + /* Close types and dataset */ + if(H5Tclose(reopened_strtype) < 0) TEST_ERROR + if(H5Tclose(reopened_cmptype) < 0) TEST_ERROR + if(H5Dclose(dset) < 0) TEST_ERROR + + /* DONE */ + + /* Close file and dataspace */ + if(H5Sclose(space) < 0) TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Tclose(cmptype); + H5Tclose(strtype); + H5Tclose(reopened_cmptype); + H5Tclose(reopened_strtype); + H5Sclose(space); + H5Dclose(dset); + H5Fclose(file); + } H5E_END_TRY; + return 1; +} /* end test_named_indirect_reopen() */ + static void create_del_obj_named_test_file(const char *filename, hid_t fapl, hbool_t new_format) { @@ -7284,10 +7419,9 @@ main(void) nerrors += test_latest(); nerrors += test_int_float_except(); nerrors += test_named_indirect_reopen(fapl); -#ifndef H5_CANNOT_OPEN_TWICE + nerrors += test_named_indirect_reopen_file(fapl); nerrors += test_delete_obj_named(fapl); nerrors += test_delete_obj_named_fileid(fapl); -#endif /*H5_CANNOT_OPEN_TWICE*/ nerrors += test_set_order_compound(fapl); nerrors += test_str_create(); #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -7295,7 +7429,6 @@ main(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ h5_cleanup(FILENAME, fapl); /*must happen before first reset*/ reset_hdf5(); - nerrors += test_conv_str_1(); nerrors += test_conv_str_2(); nerrors += test_conv_str_3(); @@ -7323,7 +7456,6 @@ main(void) nerrors += test_opaque(); nerrors += test_set_order(); nerrors += test_utf_ascii_conv(); - if(nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); -- cgit v0.12