diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-08-25 18:57:27 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-08-25 18:57:27 (GMT) |
commit | b947f7e911e498f5455a78836a6f82a042dd5b33 (patch) | |
tree | 7e4286579c22f4b472073359520f18d030a5012a | |
parent | 169014d154064941e784f1e40145d62a77d2cedc (diff) | |
download | hdf5-b947f7e911e498f5455a78836a6f82a042dd5b33.zip hdf5-b947f7e911e498f5455a78836a6f82a042dd5b33.tar.gz hdf5-b947f7e911e498f5455a78836a6f82a042dd5b33.tar.bz2 |
[svn-r30321] HDFFV-9974: Correct parsing of UD filter parameters.
Verified by user, who reported issue.
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | tools/h5repack/CMakeTests.cmake | 3 | ||||
-rw-r--r-- | tools/h5repack/h5repack_parse.c | 13 | ||||
-rw-r--r-- | tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst | 9 |
4 files changed, 18 insertions, 8 deletions
@@ -2306,6 +2306,7 @@ ./tools/h5repack/testfiles/h5repack_layout.h5.ddl ./tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl ./tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +./tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst ./tools/h5repack/testfiles/1_vds.h5-vds_dset_chunk20x10x5-v.ddl ./tools/h5repack/testfiles/2_vds.h5-vds_chunk3x6x9-v.ddl ./tools/h5repack/testfiles/3_1_vds.h5-vds_chunk2x5x8-v.ddl diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index a93fe76..cad675e 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -121,6 +121,7 @@ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/3_1_vds.h5-vds_chunk2x5x8-v.ddl ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_compa-v.ddl ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v.ddl + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst ) foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) @@ -1145,6 +1146,8 @@ ############################################################################## ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) + # check for no parameters + ADD_H5_CMP_TEST (plugin_zero "" "TEST" 255 h5repack_layout.h5 -v -f UD=250,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index b414b10..004b9e4 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -44,7 +44,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, size_t i, m, u; char c; size_t len = HDstrlen(str); - int k, l, p, r, q, end_obj = -1, no_param = 0; + int k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; char scomp[10]; @@ -219,7 +219,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, else if (HDstrcmp(scomp, "UD") == 0) { l = -1; /* filter number index check */ p = -1; /* CD_VAL count check */ - r = -1; /* CD_VAL check */ for (m = 0, q = 0, u = i + 1; u < len; u++, m++, q++) { if (str[u] == ',') { stype[q] = '\0'; /* end digit */ @@ -232,7 +231,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, p = 0; } else - r = 0; + filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0); q = 0; u++; /* skip ',' */ } @@ -244,11 +243,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, HDexit(EXIT_FAILURE); } stype[q] = c; - if (l == 0 && p == 0) { - if (r == 0) - filt->cd_values[j++] = (unsigned) HDstrtoul(stype, NULL, 0); - } - } /* u */ + } /* for u */ stype[q] = '\0'; } /*if */ @@ -273,6 +268,8 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, } /*if */ filt->cd_values[j++] = (unsigned) HDstrtoul(stype, NULL, 0); + if(filt->cd_nelmts == 0) + j = 0; i += m; /* jump */ } else if (i == len - 1) { /*no more parameters */ diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst new file mode 100644 index 0000000..0993d5b --- /dev/null +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst @@ -0,0 +1,9 @@ +Objects to modify layout are... +Objects to apply filter are... + User Defined 250 +Making file <out-plugin_zero.h5repack_layout.h5>... +----------------------------------------- + Type Filter (Compression) Name +----------------------------------------- + group / +h5repack error: <h5repack_layout.h5>: Could not copy data to: out-plugin_zero.h5repack_layout.h5 |