diff options
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 26 | ||||
-rw-r--r-- | java/src/jni/h5aImp.c | 29 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 22 | ||||
-rw-r--r-- | java/src/jni/h5fImp.c | 9 | ||||
-rw-r--r-- | java/src/jni/h5tImp.c | 31 | ||||
-rw-r--r-- | java/src/jni/h5tImp.h | 9 | ||||
-rw-r--r-- | java/src/jni/h5util.c | 2 | ||||
-rw-r--r-- | java/test/TestH5Dparams.java | 11 | ||||
-rw-r--r-- | java/test/TestH5Tparams.java | 11 | ||||
-rw-r--r-- | java/test/testfiles/JUnit-TestH5Dparams.txt | 4 | ||||
-rw-r--r-- | java/test/testfiles/JUnit-TestH5Tparams.txt | 4 | ||||
-rw-r--r-- | src/H5L.c | 17 | ||||
-rw-r--r-- | src/H5Tref.c | 2 | ||||
-rw-r--r-- | src/H5VLcallback.c | 6 | ||||
-rw-r--r-- | tools/test/h5dump/testh5dump.sh.in | 24 |
15 files changed, 161 insertions, 46 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index adb50f1..09fb223 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -2155,7 +2155,10 @@ public class H5 implements java.io.Serializable { * - Error from the HDF-5 Library. * @exception NullPointerException * - buf is null. + * + * @deprecated As of HDF5 1.12.0 in favor of H5Treclaim **/ + @Deprecated public synchronized static native int H5Dvlen_reclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException; @@ -3093,6 +3096,7 @@ public class H5 implements java.io.Serializable { * * @deprecated As of HDF5 1.10.5 in favor of H5Fis_accessible. **/ + @Deprecated public synchronized static native boolean H5Fis_hdf5(String name) throws HDF5LibraryException, NullPointerException; /** @@ -10313,6 +10317,28 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Tpack(long type_id) throws HDF5LibraryException; /** + * H5Treclaim reclaims buffer used for VL data. + * + * @param type_id + * Identifier of the datatype. + * @param space_id + * Identifier of the dataspace. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer with data to be reclaimed. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Treclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf) + throws HDF5LibraryException, NullPointerException; + + /** * H5Tvlen_create creates a new variable-length (VL) dataype. * * @param base_id diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index eaa356e..9f22665 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -94,11 +94,18 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Aopen_1name (JNIEnv *env, jclass clss, jlong loc_id, jstring name) { +#ifndef H5_NO_DEPRECATED_SYMBOLS const char *attrName = NULL; +#endif hid_t attr_id = H5I_INVALID_HID; UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + UNUSED(name); + H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_name: not implemented"); +#else if (NULL == name) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Aopen_name: attribute name is null"); @@ -106,10 +113,13 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1name if((attr_id = H5Aopen_name((hid_t)loc_id, attrName)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: +#ifndef H5_NO_DEPRECATED_SYMBOLS if (attrName) UNPIN_JAVA_STRING(ENVONLY, name, attrName); +#endif return (jlong)attr_id; } /* end Java_hdf_hdf5lib_H5__1H5Aopen_1name */ @@ -127,8 +137,14 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1idx UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + UNUSED(idx); + H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_idx: not implemented"); +#else if ((attr_id = H5Aopen_idx((hid_t) loc_id, (unsigned int) idx)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: return (jlong)attr_id; @@ -1028,7 +1044,7 @@ H5AreadVL_str /* * When repeatedly reading a dataset with a large number of strs (e.g., 1,000,000 strings), - * H5Dvlen_reclaim() may crash on Windows because the Java GC will not be able to collect + * H5Treclaim() may crash on Windows because the Java GC will not be able to collect * free space in time. Instead, we use "H5free_memory(strs[i])" to free individual strings * once done. */ @@ -1125,7 +1141,7 @@ done: if (h5str.s) h5str_free(&h5str); if (readBuf) { - H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, readBuf); + H5Treclaim(tid, sid, H5P_DEFAULT, readBuf); HDfree(readBuf); } if (sid >= 0) @@ -1313,7 +1329,7 @@ H5AwriteVL_asstr /* * When repeatedly writing a dataset with a large number of strs (e.g., 1,000,000 strings), - * H5Dvlen_reclaim() may crash on Windows because the Java GC will not be able to collect + * H5Treclaim() may crash on Windows because the Java GC will not be able to collect * free space in time. Instead, we use "H5free_memory(strs[i])" to free individual strings * once done. */ @@ -1356,7 +1372,7 @@ done: if (utf8) UNPIN_JAVA_STRING(ENVONLY, jstr, utf8); if (writeBuf) { - H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, writeBuf); + H5Treclaim(tid, sid, H5P_DEFAULT, writeBuf); HDfree(writeBuf); } if (sid >= 0) @@ -1512,8 +1528,13 @@ Java_hdf_hdf5lib_H5_H5Aget_1num_1attrs UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + H5_UNIMPLEMENTED(ENVONLY, "H5Aget_num_attrs: not implemented"); +#else if ((retVal = H5Aget_num_attrs((hid_t)loc_id)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: return (jint)retVal; diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 5500847..b395189 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -340,12 +340,21 @@ Java_hdf_hdf5lib_H5_H5Dvlen_1reclaim (JNIEnv *env, jclass clss, jlong type_id, jlong space_id, jlong xfer_plist_id, jbyteArray buf) { +#ifndef H5_NO_DEPRECATED_SYMBOLS jboolean vlenBufIsCopy; jbyte *vlenBuf = NULL; +#endif herr_t status = FAIL; UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(type_id); + UNUSED(space_id); + UNUSED(xfer_plist_id); + UNUSED(buf); + H5_UNIMPLEMENTED(ENVONLY, "H5Dvlen_reclaim: not implemented"); +#else if (NULL == buf) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Dvlen_reclaim: buffer is NULL"); @@ -353,10 +362,13 @@ Java_hdf_hdf5lib_H5_H5Dvlen_1reclaim if ((status = H5Dvlen_reclaim((hid_t)type_id, (hid_t)space_id, (hid_t)xfer_plist_id, vlenBuf)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: +#ifndef H5_NO_DEPRECATED_SYMBOLS if (vlenBuf) UNPIN_BYTE_ARRAY(ENVONLY, buf, vlenBuf, (status < 0) ? JNI_ABORT : 0); +#endif return (jint)status; } /* end Java_hdf_hdf5lib_H5_H5Dvlen_1reclaim */ @@ -1172,7 +1184,7 @@ H5DreadVL_str /* * When repeatedly reading a dataset with a large number of strs (e.g., 1,000,000 strings), - * H5Dvlen_reclaim() may crash on Windows because the Java GC will not be able to collect + * H5Treclaim() may crash on Windows because the Java GC will not be able to collect * free space in time. Instead, we use "H5free_memory(strs[i])" to free individual strings * once done. */ @@ -1230,7 +1242,7 @@ H5DreadVL_asstr if (mem_space == H5S_ALL) { /* - * Retrieve a valid dataspace for H5Dvlen_reclaim(). + * Retrieve a valid dataspace for H5Treclaim(). */ if ((mem_space = H5Dget_space(did)) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1285,7 +1297,7 @@ done: if (h5str.s) h5str_free(&h5str); if (readBuf) { - H5Dvlen_reclaim(tid, mem_space, xfer_plist_id, readBuf); + H5Treclaim(tid, mem_space, xfer_plist_id, readBuf); HDfree(readBuf); } if (close_mem_space) @@ -1504,7 +1516,7 @@ H5DwriteVL_asstr if (mem_space == H5S_ALL) { /* - * Retrieve a valid dataspace for H5Dvlen_reclaim(). + * Retrieve a valid dataspace for H5Treclaim(). */ if ((mem_space = H5Dget_space(did)) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1565,7 +1577,7 @@ done: if (utf8) UNPIN_JAVA_STRING(ENVONLY, obj, utf8); if (writeBuf) { - H5Dvlen_reclaim(tid, mem_space, xfer_plist_id, writeBuf); + H5Treclaim(tid, mem_space, xfer_plist_id, writeBuf); HDfree(writeBuf); } if (close_mem_space) diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c index 4fd6807..2eb3ad5 100644 --- a/java/src/jni/h5fImp.c +++ b/java/src/jni/h5fImp.c @@ -156,15 +156,17 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Fis_1hdf5 (JNIEnv *env, jclass clss, jstring name) { +#ifndef H5_NO_DEPRECATED_SYMBOLS const char *fileName = NULL; +#endif htri_t bval = JNI_FALSE; UNUSED(clss); #ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(name); H5_UNIMPLEMENTED(ENVONLY, "H5Fis_hdf5: not implemented"); -#endif - +#else if (NULL == name) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fis_hdf5: file name is NULL"); @@ -174,10 +176,13 @@ Java_hdf_hdf5lib_H5_H5Fis_1hdf5 H5_LIBRARY_ERROR(ENVONLY); bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; +#endif done: +#ifndef H5_NO_DEPRECATED_SYMBOLS if (fileName) UNPIN_JAVA_STRING(ENVONLY, name, fileName); +#endif return (jboolean)bval; } /* end Java_hdf_hdf5lib_H5_H5Fis_1hdf5 */ diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c index 460f12e..3302b7d 100644 --- a/java/src/jni/h5tImp.c +++ b/java/src/jni/h5tImp.c @@ -980,6 +980,37 @@ done: /* * Class: hdf_hdf5lib_H5 + * Method: H5Treclaim + * Signature: (JJJ[B)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Treclaim + (JNIEnv *env, jclass clss, jlong type_id, jlong space_id, + jlong xfer_plist_id, jbyteArray buf) +{ + jboolean bufIsCopy; + jbyte *pinBuf = NULL; + herr_t status = FAIL; + + UNUSED(clss); + + if (NULL == buf) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Treclaim: buffer is NULL"); + + PIN_BYTE_ARRAY(ENVONLY, buf, pinBuf, &bufIsCopy, "H5Treclaim: buffer not pinned"); + + if ((status = H5Treclaim((hid_t)type_id, (hid_t)space_id, (hid_t)xfer_plist_id, pinBuf)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + if (pinBuf) + UNPIN_BYTE_ARRAY(ENVONLY, buf, pinBuf, (status < 0) ? JNI_ABORT : 0); + + return (jint)status; +} /* end Java_hdf_hdf5lib_H5_H5Treclaim */ + +/* + * Class: hdf_hdf5lib_H5 * Method: _H5Tclose * Signature: (J)I */ diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h index 374d992..a63969b 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -401,6 +401,15 @@ Java_hdf_hdf5lib_H5_H5Tpack /* * Class: hdf_hdf5lib_H5 + * Method: H5Treclaim + * Signature: (JJJ[B)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5Treclaim + (JNIEnv*, jclass, jlong, jlong, jlong, jbyteArray); + +/* + * Class: hdf_hdf5lib_H5 * Method: _H5Tclose * Signature: (J)I */ diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index af83caa..700f75f 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -2781,7 +2781,7 @@ h5str_dump_simple_dset /* Reclaim any VL memory, if necessary */ if (vl_data) { - if (H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0) + if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0) H5_LIBRARY_ERROR(ENVONLY); } diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java index a3618f2..621c000 100644 --- a/java/test/TestH5Dparams.java +++ b/java/test/TestH5Dparams.java @@ -113,17 +113,6 @@ public class TestH5Dparams { H5.H5Dvlen_get_buf_size(-1, -1, -1); } - @Test(expected = HDF5LibraryException.class) - public void testH5Dvlen_reclaim_invalid() throws Throwable { - byte[] buf = new byte[2]; - H5.H5Dvlen_reclaim(-1, -1, -1, buf); - } - - @Test(expected = NullPointerException.class) - public void testH5Dvlen_reclaim_null() throws Throwable { - H5.H5Dvlen_reclaim(-1, -1, -1, null); - } - @Test(expected = IllegalArgumentException.class) public void testH5Dget_storage_size_invalid() throws Throwable { H5.H5Dget_storage_size(-1); diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java index 53d3a37..8baccd1 100644 --- a/java/test/TestH5Tparams.java +++ b/java/test/TestH5Tparams.java @@ -274,6 +274,17 @@ public class TestH5Tparams { public void testH5Tpack_invalid() throws Throwable { H5.H5Tpack(-1); } + + @Test(expected = HDF5LibraryException.class) + public void testH5Treclaim_invalid() throws Throwable { + byte[] buf = new byte[2]; + H5.H5Treclaim(-1, -1, -1, buf); + } + + @Test(expected = NullPointerException.class) + public void testH5Treclaim_null() throws Throwable { + H5.H5Treclaim(-1, -1, -1, null); + } @Test(expected = HDF5LibraryException.class) public void testH5Tvlen_create_invalid() throws Throwable { diff --git a/java/test/testfiles/JUnit-TestH5Dparams.txt b/java/test/testfiles/JUnit-TestH5Dparams.txt index 9751be4..9acedd7 100644 --- a/java/test/testfiles/JUnit-TestH5Dparams.txt +++ b/java/test/testfiles/JUnit-TestH5Dparams.txt @@ -7,11 +7,9 @@ JUnit version 4.11 .testH5Dvlen_get_buf_size_invalid .testH5Dcreate_null .testH5Dset_extent_status_null -.testH5Dvlen_reclaim_null .testH5Dcreate_invalid .testH5Dcreate_anon_invalid .testH5Dset_extent_status_invalid -.testH5Dvlen_reclaim_invalid .testH5Dopen_invalid .testH5Dclose_invalid .testH5Dflush_invalid @@ -22,5 +20,5 @@ JUnit version 4.11 Time: XXXX -OK (20 tests) +OK (18 tests) diff --git a/java/test/testfiles/JUnit-TestH5Tparams.txt b/java/test/testfiles/JUnit-TestH5Tparams.txt index e61f1e4..9f725ac 100644 --- a/java/test/testfiles/JUnit-TestH5Tparams.txt +++ b/java/test/testfiles/JUnit-TestH5Tparams.txt @@ -1,5 +1,6 @@ JUnit version 4.11 .testH5Tget_member_type_invalid +.testH5Treclaim_invalid .testH5Tenum_insert_null .testH5Tget_offset_invalid .testH5Tset_precision_invalid @@ -68,9 +69,10 @@ JUnit version 4.11 .testH5Tget_member_index_null .testH5Trefresh_invalid .testH5Tset_sign_invalid +.testH5Treclaim_null .testH5Tenum_insert_name_null Time: XXXX -OK (70 tests) +OK (72 tests) @@ -278,6 +278,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5VL_loc_params_t loc_params1; H5VL_object_t *vol_obj2 = NULL; /* Object token of dst_id */ H5VL_loc_params_t loc_params2; + H5VL_object_t tmp_vol_obj; /* Temporary object token */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -329,8 +330,12 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL connectors and can't be linked") + /* Construct a temporary source VOL object */ + tmp_vol_obj.data = (vol_obj1 ? vol_obj1->data : NULL); + tmp_vol_obj.connector = (vol_obj1 ? vol_obj1->connector : vol_obj2->connector); + /* Move the link */ - if(H5VL_link_move(vol_obj1, &loc_params1, vol_obj2, &loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) + if(H5VL_link_move(&tmp_vol_obj, &loc_params1, vol_obj2, &loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: @@ -360,7 +365,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5VL_loc_params_t loc_params1; H5VL_object_t *vol_obj2 = NULL; /* Object token of dst_id */ H5VL_loc_params_t loc_params2; - H5VL_object_t tmp_vol_obj; /* Temporary object token of */ + H5VL_object_t tmp_vol_obj; /* Temporary object token */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -377,15 +382,15 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") + /* Check the link create property list */ + if(H5P_DEFAULT == lcpl_id) + lcpl_id = H5P_LINK_CREATE_DEFAULT; + /* Verify access property list and set up collective metadata if appropriate */ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Check the link create property list */ - if(H5P_DEFAULT == lcpl_id) - lcpl_id = H5P_LINK_CREATE_DEFAULT; - /* Set location paramter for source object */ loc_params1.type = H5VL_OBJECT_BY_NAME; loc_params1.loc_data.loc_by_name.name = src_name; diff --git a/src/H5Tref.c b/src/H5Tref.c index 5a3cb4f..937dc92 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -753,7 +753,7 @@ H5T_ref_reclaim(void *elem, const H5T_t *dt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(elem); diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 5400356..e486fde 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -4190,7 +4190,7 @@ H5VL_link_copy(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_pa vol_wrapper_set = TRUE; /* Call the corresponding internal VOL routine */ - if(H5VL__link_copy((src_vol_obj->data ? src_vol_obj->data : NULL), loc_params1, (dst_vol_obj ? dst_vol_obj->data : NULL), loc_params2, vol_obj->connector->cls, lcpl_id, lapl_id, dxpl_id, req) < 0) + if(H5VL__link_copy(src_vol_obj->data, loc_params1, (dst_vol_obj ? dst_vol_obj->data : NULL), loc_params2, vol_obj->connector->cls, lcpl_id, lapl_id, dxpl_id, req) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCOPY, FAIL, "link copy failed") done: @@ -4293,13 +4293,13 @@ H5VL_link_move(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_pa FUNC_ENTER_NOAPI(FAIL) /* Set wrapper info in API context */ - vol_obj = (src_vol_obj ? src_vol_obj : dst_vol_obj); + vol_obj = (src_vol_obj->data ? src_vol_obj : dst_vol_obj); if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Call the corresponding internal VOL routine */ - if(H5VL__link_move((src_vol_obj ? src_vol_obj->data : NULL), loc_params1, (dst_vol_obj ? dst_vol_obj->data : NULL), loc_params2, vol_obj->connector->cls, lcpl_id, lapl_id, dxpl_id, req) < 0) + if(H5VL__link_move(src_vol_obj->data, loc_params1, (dst_vol_obj ? dst_vol_obj->data : NULL), loc_params2, vol_obj->connector->cls, lcpl_id, lapl_id, dxpl_id, req) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTMOVE, FAIL, "link move failed") done: diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 8b6118e..141715c 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -906,12 +906,14 @@ TOOLTEST_HELP() { } # Call the h5dump tool and grep for a value -# +# txttype ERRTXT greps test error output, otherwise greps test output GREPTEST() { - expectdata=$1 - actual=$TESTDIR/$2 - actual_err="$TESTDIR/`basename $2 .ddl`.oerr" + txttype=$1 + expectdata=$2 + actual=$TESTDIR/$3 + actual_err="$TESTDIR/`basename $3 .ddl`.oerr" + shift shift shift @@ -921,7 +923,11 @@ GREPTEST() cd $TESTDIR $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err - $GREP $expectdata $actual > /dev/null + if [[ "$txttype" = "ERRTXT" ]]; then + $GREP "$expectdata" $actual_err > /dev/null + else + $GREP "$expectdata" $actual > /dev/null + fi if [ $? -eq 0 ]; then echo " PASSED" else @@ -1137,7 +1143,7 @@ TOOLTEST tvlenstr_array.ddl --enable-error-stack tvlenstr_array.h5 # test for files with array data TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5 # # added for bug# 2092 - tarray1_big.h -GREPTEST "Undefined reference pointer" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 +GREPTEST ERRTXT "Undefined reference pointer" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5 TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5 TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5 @@ -1345,9 +1351,9 @@ fi # test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 -GREPTEST "Undefined reference pointer" tdataregR.ddl --enable-error-stack -R tdatareg.h5 +GREPTEST ERRTXT "Undefined reference pointer" tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 -GREPTEST "Undefined reference pointer" tattrregR.ddl --enable-error-stack -R tattrreg.h5 +GREPTEST ERRTXT "Undefined reference pointer" tattrregR.ddl --enable-error-stack -R tattrreg.h5 TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 # Clean up text output files @@ -1396,7 +1402,7 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5 TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5 # test to verify HDFFV-9407: long double full precision -GREPTEST "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5 +GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5 # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR |