summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-09-14 13:37:22 (GMT)
committerGitHub <noreply@github.com>2021-09-14 13:37:22 (GMT)
commit3cf0d48272f0ec6afbec318c90c945e91b7ba56d (patch)
tree37be804e96f3a1a9ed19a04717067616ca67f543 /test
parent876b720d6f0d2f639f32c04c1d2a35567f6ba80e (diff)
downloadhdf5-3cf0d48272f0ec6afbec318c90c945e91b7ba56d.zip
hdf5-3cf0d48272f0ec6afbec318c90c945e91b7ba56d.tar.gz
hdf5-3cf0d48272f0ec6afbec318c90c945e91b7ba56d.tar.bz2
H5Ztrans: (feature) Improved H5Z_xform_noop() and H5Z_xform_create() … (#933) (#1007)
* H5Ztrans: (feature) Improved H5Z_xform_noop() and H5Z_xform_create() function - Made a small improvement for H5Z_xform_noop() function. Now, the function will also return TRUE if the data transform function expression = "x". For this case, the HDF5 library behaves in a similar fashion as the case when no data transform function has been specified. - Improved the inline documentation of the function H5Z_xform_create() such it is more inline with the rest of the code. * Committing clang-format changes * H5Ztrans: (feature) Added 3 tests for improved H5Z_xform_noop() function - Added serial test with data transform expression = "x" to verify the improved H5Z_xform_noop() function behaves as expected. - Added 2 parallel tests with data transform expression = "x" in combination with a filter. Before, these tests will fail but with the improved H5Z_xform_noop() function they work and result in the expected behavior. - Small bug fix for one of parallel filter tests. * Committing clang-format changes * H5Ztrans: (feature) Added release note about detection of the simple data transform function "x". - Added a brief explanation about the implemented improvement of the detection of the simple data transform function "x" to the RELEASE.txt file. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/dtransform.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/dtransform.c b/test/dtransform.c
index 8d3a8c0..743103f 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -582,6 +582,7 @@ test_specials(hid_t file)
const char *special4 = "-x";
const char *special5 = "+x";
const char *special6 = "2e+1*x";
+ const char *special7 = "x";
TESTING("data transform of some special cases")
@@ -729,6 +730,32 @@ test_specials(hid_t file)
if (H5Dclose(dset_id) < 0)
TEST_ERROR
+ /*-----------------------------
+ * Operation 7: x
+ * This operation will be
+ * treated if no function has
+ * been specified.
+ *----------------------------*/
+ if (H5Pset_data_transform(dxpl_id, special7) < 0)
+ TEST_ERROR;
+
+ for (row = 0; row < ROWS; row++)
+ for (col = 0; col < COLS; col++)
+ data_res[row][col] = transformData[row][col];
+
+ if ((dset_id = H5Dcreate2(file, "/special7", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if (H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
if (H5Pclose(dxpl_id) < 0)
TEST_ERROR
if (H5Sclose(dataspace) < 0)