diff options
author | Quincey Koziol <koziol@koziol.gov> | 2019-04-04 21:45:34 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@koziol.gov> | 2019-04-04 21:45:34 (GMT) |
commit | dde0a1c93ab7e183c575b284a9b8f65555818132 (patch) | |
tree | ab89e9c69eee9ceb195923adcc08e65abe2f81b6 /test | |
parent | 7dce8523c1cd3522feaac22ce49c899d39932ccf (diff) | |
parent | aa696a47715c3dd9c068f71915c6dcf23745441c (diff) | |
download | hdf5-dde0a1c93ab7e183c575b284a9b8f65555818132.zip hdf5-dde0a1c93ab7e183c575b284a9b8f65555818132.tar.gz hdf5-dde0a1c93ab7e183c575b284a9b8f65555818132.tar.bz2 |
Merge remote-tracking branch 'origin/develop' into merge_hyperslab_update_01
Diffstat (limited to 'test')
-rw-r--r-- | test/cache_tagging.c | 52 | ||||
-rw-r--r-- | test/h5test.c | 118 | ||||
-rw-r--r-- | test/h5test.h | 4 | ||||
-rw-r--r-- | test/objcopy.c | 2 | ||||
-rw-r--r-- | test/testerror.sh.in | 4 | ||||
-rw-r--r-- | test/tid.c | 28 | ||||
-rw-r--r-- | test/titerate.c | 4 | ||||
-rw-r--r-- | test/ttsafe_error.c | 65 |
8 files changed, 99 insertions, 178 deletions
diff --git a/test/cache_tagging.c b/test/cache_tagging.c index b91f013..e03defa 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -448,7 +448,7 @@ check_file_creation_tags(hid_t fcpl_id, int type) TESTING("tag application during file creation"); /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR; @@ -539,7 +539,7 @@ check_file_open_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -652,7 +652,7 @@ check_group_creation_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -751,7 +751,7 @@ check_multi_group_creation_tags(void) TESTING("tag application during multiple group creation"); /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Set latest version of library */ if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR; @@ -881,7 +881,7 @@ check_link_iteration_tags(void) TESTING("tag application during iteration over links in a group"); /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* =========== */ /* Create File */ @@ -1000,7 +1000,7 @@ check_dense_attribute_tags(void) TESTING("tag application during dense attribute manipulation"); /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR; /* Create Dcpl */ @@ -1184,7 +1184,7 @@ check_group_open_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -1295,7 +1295,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1429,7 +1429,7 @@ check_attribute_open_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1576,7 +1576,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1761,7 +1761,7 @@ check_attribute_delete_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1917,7 +1917,7 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -2051,7 +2051,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -2187,7 +2187,7 @@ check_dataset_open_tags(void) /* ========= */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2318,7 +2318,7 @@ check_dataset_write_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2457,7 +2457,7 @@ check_attribute_write_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -2613,7 +2613,7 @@ check_dataset_read_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2751,7 +2751,7 @@ check_dataset_size_retrieval(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2890,7 +2890,7 @@ check_dataset_extend_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3017,7 +3017,7 @@ check_object_info_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3126,7 +3126,7 @@ check_object_copy_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3257,7 +3257,7 @@ check_link_removal_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -3416,7 +3416,7 @@ check_link_getname_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3553,7 +3553,7 @@ check_external_link_creation_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3660,7 +3660,7 @@ check_external_link_open_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3787,7 +3787,7 @@ check_invalid_tag_application(void) #if H5C_DO_TAGGING_SANITY_CHECKS /* Create Fapl */ - if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; diff --git a/test/h5test.c b/test/h5test.c index 0ba28f3..bc3f2fa 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -44,12 +44,6 @@ * is interpreted according to the driver. See * h5_get_vfd_fapl() for details. * - * HDF5_VOL_CONNECTOR: This string describes what VOL connector to - * use for HDF5 file access. The first word in the - * value is the name of the connector and subsequent data - * is interpreted according to the connector. See - * h5_get_vol_fapl() for details. - * * HDF5_LIBVER_BOUNDS: This string describes what library version bounds to * use for HDF5 file access. See h5_get_libver_fapl() for details. * @@ -785,10 +779,6 @@ h5_fileaccess(void) if(h5_get_vfd_fapl(fapl_id) < 0) goto error; - /* Next, try to set up a VOL connector */ - if(h5_get_vol_fapl(fapl_id) < 0) - goto error; - /* Finally, check for libver bounds */ if(h5_get_libver_fapl(fapl_id) < 0) goto error; @@ -829,10 +819,6 @@ h5_fileaccess_flags(unsigned flags) if((flags & H5_FILEACCESS_VFD) && h5_get_vfd_fapl(fapl_id) < 0) goto error; - /* Next, try to set up a VOL connector */ - if((flags & H5_FILEACCESS_VOL) && h5_get_vol_fapl(fapl_id) < 0) - goto error; - /* Finally, check for libver bounds */ if((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0) goto error; @@ -1046,110 +1032,6 @@ error: /*------------------------------------------------------------------------- - * Function: h5_get_vol_fapl - * - * Purpose: Returns a file access property list which is the default - * fapl but with a VOL connector set according to the constant - * or environment variable HDF5_VOL_CONNECTOR. - * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Jordan Henderson - * November 2018 - * - *------------------------------------------------------------------------- - */ -herr_t -h5_get_vol_fapl(hid_t fapl) -{ - const char *env = NULL; - const char *tok = NULL; - char *lasts = NULL; /* Context pointer for strtok_r() call */ - htri_t connector_is_registered; - char buf[1024]; /* Buffer for tokenizing HDF5_VOL_CONNECTOR */ - void *vol_info = NULL; /* VOL connector info */ - hid_t connector_id = -1; - - /* Get the environment variable, if it exists */ - env = HDgetenv("HDF5_VOL_CONNECTOR"); -#ifdef HDF5_VOL_CONNECTOR - /* Use the environment variable, then the compile-time constant */ - if(!env) - env = HDF5_VOL_CONNECTOR; -#endif - - /* If the environment variable was not set, just return. */ - if(!env || !*env) - goto done; - - /* Get the first 'word' of the environment variable. - * If it's nothing (environment variable was whitespace) just return. - */ - HDstrncpy(buf, env, sizeof(buf)); - buf[sizeof(buf) - 1] = '\0'; - if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts))) - goto done; - - /* First, check to see if the connector is already registered */ - if((connector_is_registered = H5VLis_connector_registered(tok)) < 0) - goto done; - else if(connector_is_registered) { - /* Retrieve the ID of the already-registered VOL connector */ - if((connector_id = H5VLget_connector_id(tok)) < 0) - goto error; - } /* end else-if */ - else { - /* Check for VOL connectors that ship with the library */ - if(!HDstrcmp(tok, "native")) { - connector_id = H5VL_NATIVE; - if(H5Iinc_ref(connector_id) < 0) - goto error; - } else if(!HDstrcmp(tok, "pass_through")) { - connector_id = H5VL_PASSTHRU; - if(H5Iinc_ref(connector_id) < 0) - goto error; - } else { - /* Register the VOL connector */ - /* (NOTE: No provisions for vipl_id currently) */ - if((connector_id = H5VLregister_connector_by_name(tok, H5P_DEFAULT)) < 0) - goto error; - } /* end else */ - } /* end else */ - - /* Was there any connector info specified in the environment variable? */ - if(NULL != (tok = HDstrtok_r(NULL, " \t\n\r", &lasts))) - if(H5VLconnector_str_to_info(tok, connector_id, &vol_info) < 0) - goto error; - - /* Set the VOL connector in the FAPL */ - if(H5Pset_vol(fapl, connector_id, vol_info) < 0) - goto error; - - /* Release VOL connector info, if there was any */ - if(vol_info) - if(H5VLfree_connector_info(connector_id, vol_info) < 0) - goto error; - - /* Close the connector ID */ - if(connector_id >= 0) - if(H5VLunregister_connector(connector_id) < 0) - goto error; - -done: - return 0; - -error: - if(vol_info) - H5VLfree_connector_info(connector_id, vol_info); - if(connector_id >= 0) - H5VLunregister_connector(connector_id); - - return -1; -} /* end h5_get_vol_fapl() */ - - -/*------------------------------------------------------------------------- * Function: h5_no_hwconv * * Purpose: Turn off hardware data type conversions. diff --git a/test/h5test.h b/test/h5test.h index 66a7863..8c3ce6b 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -123,8 +123,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* Flags for h5_fileaccess_flags() */ #define H5_FILEACCESS_VFD 0x01 -#define H5_FILEACCESS_VOL 0x02 -#define H5_FILEACCESS_LIBVER 0x04 +#define H5_FILEACCESS_LIBVER 0x02 #ifdef __cplusplus extern "C" { @@ -152,7 +151,6 @@ H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); -H5TEST_DLL herr_t h5_get_vol_fapl(hid_t fapl_id); H5TEST_DLL herr_t h5_get_libver_fapl(hid_t fapl_id); /* h5_clean_files() replacements */ diff --git a/test/objcopy.c b/test/objcopy.c index f526f7b..df1c0e4 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -7869,7 +7869,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open) addr_reset(); /* Setup */ - if((src_fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0) TEST_ERROR + if((src_fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0) TEST_ERROR /* open source file (read-only) */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR diff --git a/test/testerror.sh.in b/test/testerror.sh.in index 734b051..ac2a109 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -22,7 +22,9 @@ CMP='cmp -s' DIFF='diff -c' # Skip plugin module to test missing filter -ENVCMD="env HDF5_PLUGIN_PRELOAD=::" +# Also reset the VOL connector to only use the native connector, because of the +# error stack checking. QAK - 2019/03/09 +ENVCMD="env HDF5_PLUGIN_PRELOAD=:: HDF5_VOL_CONNECTOR=native" nerrors=0 verbose=yes @@ -251,7 +251,10 @@ static int id_predefined_test(void ) testObj = HDmalloc(sizeof(int)); - /* Try to perform illegal functions on various predefined types */ + /* + * Attempt to perform public functions on various library types + */ + H5E_BEGIN_TRY testID = H5Iregister(H5I_FILE, testObj); H5E_END_TRY @@ -292,7 +295,26 @@ static int id_predefined_test(void ) if(testErr >= 0) goto out; - /* Create a datatype ID and try to perform illegal functions on it */ + H5E_BEGIN_TRY + testErr = H5Itype_exists(H5I_GROUP); + H5E_END_TRY + + VERIFY(testErr, -1, "H5Itype_exists"); + if(testErr != -1) + goto out; + + H5E_BEGIN_TRY + testErr = H5Itype_exists(H5I_ATTR); + H5E_END_TRY + + VERIFY(testErr, -1, "H5Itype_exists"); + if(testErr != -1) + goto out; + + /* + * Create a datatype ID and try to perform illegal functions on it + */ + typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); if(typeID == H5I_INVALID_HID) @@ -317,7 +339,7 @@ static int id_predefined_test(void ) H5Tclose(typeID); /* testObj was never registered as an atom, so it will not be - * automatically freed. */ + * automatically freed. */ HDfree(testObj); return 0; diff --git a/test/titerate.c b/test/titerate.c index 8c0ef24..54e9b5e 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -945,7 +945,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data) searched_err_t *searched_err = (searched_err_t *)_client_data; if (searched_err == NULL) - return -1; + return H5_ITER_ERROR; /* If the searched error message is found, stop the iteration */ if (err_desc->desc != NULL && strcmp(err_desc->desc, searched_err->message) == 0) @@ -953,6 +953,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data) searched_err->found = true; status = H5_ITER_STOP; } + return status; } /* end find_err_msg_cb() */ @@ -988,6 +989,7 @@ static void test_corrupted_attnamelen(void) /* Call H5Aiterate2 to trigger the failure in HDFFV-10588. Failure should occur in the decoding stage, so some arguments are not needed. */ err_status = H5Aiterate2(did, H5_INDEX_NAME, H5_ITER_INC, NULL, NULL, NULL); + VERIFY(err_status, FAIL, "H5Aiterate2"); /* Make sure the intended error was caught */ if(err_status == -1) diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 56d87ee..5e26888 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -63,6 +63,8 @@ static void *tts_error_thread(void *); void tts_error(void) { + hid_t def_fapl = H5I_INVALID_HID; + hid_t vol_id = H5I_INVALID_HID; hid_t dataset = H5I_INVALID_HID; H5TS_thread_t threads[NUM_THREAD]; H5TS_attr_t attribute; @@ -111,39 +113,52 @@ tts_error(void) H5TS_attr_setscope(&attribute, H5TS_SCOPE_SYSTEM); #endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */ - /* Create a hdf5 file using H5F_ACC_TRUNC access, default file - * creation plist and default file access plist - */ - error_file_g = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(error_file_g, H5I_INVALID_HID, "H5Fcreate"); + def_fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(def_fapl, H5I_INVALID_HID, "H5Pcreate"); - for (i = 0; i < NUM_THREAD; i++) - threads[i] = H5TS_create_thread(tts_error_thread, &attribute, NULL); + status = H5Pget_vol_id(def_fapl, &vol_id); + CHECK(status, FAIL, "H5Pget_vol_id"); - for (i = 0; i < NUM_THREAD; i++) - H5TS_wait_for_thread(threads[i]); + if(vol_id == H5VL_NATIVE) { + /* Create a hdf5 file using H5F_ACC_TRUNC access, default file + * creation plist and default file access plist + */ + error_file_g = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, def_fapl); + CHECK(error_file_g, H5I_INVALID_HID, "H5Fcreate"); - if (error_flag_g) { - TestErrPrintf("At least one thread reported a value that was different from the expected value\n"); - HDprintf("(Update this test if the error stack changed!)\n"); - } + for (i = 0; i < NUM_THREAD; i++) + threads[i] = H5TS_create_thread(tts_error_thread, &attribute, NULL); + + for (i = 0; i < NUM_THREAD; i++) + H5TS_wait_for_thread(threads[i]); + + if (error_flag_g) { + TestErrPrintf("At least one thread reported a value that was different from the expected value\n"); + HDprintf("(Update this test if the error stack changed!)\n"); + } - if (error_count_g != NUM_THREAD - 1) - TestErrPrintf("Error: %d threads failed instead of %d\n", error_count_g, NUM_THREAD-1); + if (error_count_g != NUM_THREAD - 1) + TestErrPrintf("Error: %d threads failed instead of %d\n", error_count_g, NUM_THREAD-1); - dataset = H5Dopen2(error_file_g, DATASETNAME, H5P_DEFAULT); - CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); + dataset = H5Dopen2(error_file_g, DATASETNAME, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); - status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value); - CHECK(status, FAIL, "H5Dread"); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value); + CHECK(status, FAIL, "H5Dread"); - if (value != WRITE_NUMBER) - TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER); + if (value != WRITE_NUMBER) + TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER); - status = H5Dclose(dataset); - CHECK(status, FAIL, "H5Dclose"); - status = H5Fclose(error_file_g); - CHECK(status, FAIL, "H5Fclose"); + status = H5Dclose(dataset); + CHECK(status, FAIL, "H5Dclose"); + status = H5Fclose(error_file_g); + CHECK(status, FAIL, "H5Fclose"); + } /* end if */ + else + HDprintf("Non-native VOL connector used, skipping test\n"); + + status = H5Idec_ref(vol_id); + CHECK(status, FAIL, "H5Idec_ref"); H5TS_attr_destroy(&attribute); } /* end tts_error() */ |