diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-05-06 22:59:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 22:59:52 (GMT) |
commit | cd4d97218f75c545be14f3148f2c64fd3c60337b (patch) | |
tree | e92d760f5517d171c0689195910bfbc27d3a1786 /test/dtransform.c | |
parent | 8ad163381083dfc6f0384deb793ba6ad59a936c5 (diff) | |
parent | ca737ece9acd8168d9df4a08c9907a294053a883 (diff) | |
download | hdf5-feature/werror-restrict.zip hdf5-feature/werror-restrict.tar.gz hdf5-feature/werror-restrict.tar.bz2 |
Merge branch 'develop' into feature/werror-restrictfeature/werror-restrict
Diffstat (limited to 'test/dtransform.c')
-rw-r--r-- | test/dtransform.c | 242 |
1 files changed, 129 insertions, 113 deletions
diff --git a/test/dtransform.c b/test/dtransform.c index 1f6d48b..84e00cc 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -120,7 +120,9 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, #define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ { \ - TYPE array[ROWS][COLS]; \ + struct { \ + TYPE arr[ROWS][COLS]; \ + } *array = NULL; \ const char *f_to_c = "(5/9.0)*(x-32)"; \ /* utrans is a transform for char types: numbers are restricted from -128 to 127, fits into char */ \ const char *utrans = "(x/4+25)*3"; \ @@ -129,6 +131,10 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, H5T_order_t order; \ hsize_t dim[2] = {ROWS, COLS}; \ \ + /* NOTE: If this macro encounters errors, this memory will leak */ \ + if (NULL == (array = HDcalloc(1, sizeof(*array)))) \ + TEST_ERROR; \ + \ if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0) \ TEST_ERROR; \ if ((dset = H5Dcreate2(file_id, "/transformtest_" TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, \ @@ -136,16 +142,16 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, TEST_ERROR; \ \ if ((dt_nn = H5Tcopy(HDF_TYPE)) < 0) \ - TEST_ERROR \ + TEST_ERROR; \ if ((order = H5Tget_order(dt_nn)) == H5T_ORDER_ERROR) \ - TEST_ERROR \ + TEST_ERROR; \ if (H5Tset_order(dt_nn, order == H5T_ORDER_LE ? H5T_ORDER_BE : H5T_ORDER_LE) < 0) \ - TEST_ERROR \ + TEST_ERROR; \ if ((dset_nn = H5Dcreate2(file_id, "/nonnative_transformtest_" TEST_STR, dt_nn, dataspace, \ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) \ - TEST_ERROR \ + TEST_ERROR; \ if (H5Tclose(dt_nn) < 0) \ - TEST_ERROR \ + TEST_ERROR; \ \ if (SIGNED) { \ if ((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) \ @@ -172,30 +178,30 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, TEST_ERROR; \ } \ \ - TESTING("contiguous, no data type conversion (" TEST_STR "->" TEST_STR ")") \ + TESTING("contiguous, no data type conversion (" TEST_STR "->" TEST_STR ")"); \ \ if (H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) \ TEST_ERROR; \ if (SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ + COMPARE(TYPE, array->arr, COMPARE_DATA, 2) \ else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + UCOMPARE(TYPE, array->arr, COMPARE_DATA, 4) \ \ - TESTING("contiguous, byte order conversion (" TEST_STR "->" TEST_STR ")") \ + TESTING("contiguous, byte order conversion (" TEST_STR "->" TEST_STR ")"); \ \ if (H5Dread(dset_nn, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) \ TEST_ERROR; \ if (SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ + COMPARE(TYPE, array->arr, COMPARE_DATA, 2) \ else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + UCOMPARE(TYPE, array->arr, COMPARE_DATA, 4) \ \ if (SIGNED) { \ - TESTING("contiguous, with type conversion (float->" TEST_STR ")") \ + TESTING("contiguous, with type conversion (float->" TEST_STR ")"); \ \ if (H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) \ TEST_ERROR; \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ + COMPARE(TYPE, array->arr, COMPARE_DATA, 2) \ } \ \ if (H5Dclose(dset_nn) < 0) \ @@ -204,11 +210,15 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, TEST_ERROR; \ if (H5Sclose(dataspace) < 0) \ TEST_ERROR; \ + \ + HDfree(array); \ } #define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ { \ - TYPE array[ROWS][COLS]; \ + struct { \ + TYPE arr[ROWS][COLS]; \ + } *array = NULL; \ const char *f_to_c = "(5/9.0)*(x-32)"; \ /* utrans is a transform for char types: numbers are restricted from -128 to 127, fits into char */ \ const char *utrans = "(x/4+25)*3"; \ @@ -217,6 +227,10 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, hsize_t dim[2] = {ROWS, COLS}; \ hsize_t offset[2] = {0, 0}; \ \ + /* NOTE: If this macro encounters errors, this memory will leak */ \ + if (NULL == (array = HDcalloc(1, sizeof(*array)))) \ + TEST_ERROR; \ + \ if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0) \ TEST_ERROR; \ \ @@ -229,9 +243,9 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) \ TEST_ERROR; \ if ((filespace = H5Dget_space(dset_chunk)) < 0) \ - TEST_ERROR \ + TEST_ERROR; \ if ((memspace = H5Screate_simple(2, dim, NULL)) < 0) \ - TEST_ERROR \ + TEST_ERROR; \ if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) \ TEST_ERROR; \ \ @@ -258,21 +272,21 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, TEST_ERROR; \ } \ \ - TESTING("chunked, no data type conversion (" TEST_STR "->" TEST_STR ")") \ + TESTING("chunked, no data type conversion (" TEST_STR "->" TEST_STR ")"); \ \ if (H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) \ TEST_ERROR; \ if (SIGNED) \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ + COMPARE(TYPE, array->arr, COMPARE_DATA, 2) \ else \ - UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ + UCOMPARE(TYPE, array->arr, COMPARE_DATA, 4) \ \ if (SIGNED) { \ - TESTING("chunked, with type conversion (float->" TEST_STR ")") \ + TESTING("chunked, with type conversion (float->" TEST_STR ")"); \ \ if (H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) \ TEST_ERROR; \ - COMPARE(TYPE, array, COMPARE_DATA, 2) \ + COMPARE(TYPE, array->arr, COMPARE_DATA, 2) \ } \ \ if (H5Pclose(cparms) < 0) \ @@ -283,6 +297,8 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, TEST_ERROR; \ if (H5Sclose(memspace) < 0) \ TEST_ERROR; \ + \ + HDfree(array); \ } #define INVALID_SET_TEST(TRANSFORM) \ @@ -446,65 +462,65 @@ init_test(hid_t file_id) hsize_t offset[2] = {0, 0}; if ((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) - TEST_ERROR + TEST_ERROR; if ((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) - TEST_ERROR + TEST_ERROR; if (H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) - TEST_ERROR + TEST_ERROR; cparms = H5Pcreate(H5P_DATASET_CREATE); if (H5Pset_chunk(cparms, 2, dim) < 0) - TEST_ERROR + TEST_ERROR; if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0) - TEST_ERROR + TEST_ERROR; - TESTING("Initializing test...") + TESTING("Initializing test..."); if ((dset_id_int = H5Dcreate2(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) - TEST_ERROR + TEST_ERROR; if ((dset_id_float = H5Dcreate2(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) - TEST_ERROR + TEST_ERROR; if ((dset_id_int_chunk = H5Dcreate2(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if ((filespace = H5Dget_space(dset_id_int_chunk)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) - TEST_ERROR + TEST_ERROR; if ((dset_id_float_chunk = H5Dcreate2(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) - TEST_ERROR + TEST_ERROR; if (H5Pclose(cparms) < 0) - TEST_ERROR + TEST_ERROR; if (H5Pclose(dxpl_id_f_to_c) < 0) - TEST_ERROR + TEST_ERROR; if (H5Pclose(dxpl_id_utrans) < 0) - TEST_ERROR + TEST_ERROR; if (H5Sclose(dataspace) < 0) - TEST_ERROR + TEST_ERROR; if (H5Sclose(filespace) < 0) - TEST_ERROR + TEST_ERROR; PASSED(); @@ -539,9 +555,9 @@ test_poly(const hid_t dxpl_id_polynomial) polyflres[row][col] = ((2.0F + (float)windchillC) * (((float)windchillC - 8.0F) / 2.0F)); } - TESTING("data transform, polynomial transform (int->float)") + TESTING("data transform, polynomial transform (int->float)"); if (H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread) < 0) - TEST_ERROR + TEST_ERROR; COMPARE(float, polyflread, polyflres, 2.0F) @@ -551,9 +567,9 @@ test_poly(const hid_t dxpl_id_polynomial) polyflres[row][col] = (float)((2 + windchillC) * ((windchillC - 8) / 2)); } - TESTING("data transform, polynomial transform (float->int)") + TESTING("data transform, polynomial transform (float->int)"); if (H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread) < 0) - TEST_ERROR + TEST_ERROR; COMPARE(int, polyintread, polyflres, 4) @@ -579,10 +595,10 @@ test_specials(hid_t file) const char *special6 = "2e+1*x"; const char *special7 = "x"; - TESTING("data transform of some special cases") + TESTING("data transform of some special cases"); if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0) - TEST_ERROR + TEST_ERROR; if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; @@ -599,16 +615,16 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special1", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; /*----------------------------- * Operation 2: 100-x @@ -622,16 +638,16 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special2", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; /*----------------------------- * Operation 3: 1000/x @@ -645,16 +661,16 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special3", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; /*----------------------------- * Operation 4: -x @@ -668,16 +684,16 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special4", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; /*----------------------------- * Operation 5: +x @@ -691,16 +707,16 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special5", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; /*----------------------------- * Operation 6: 2e+1*x @@ -714,16 +730,16 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special6", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; /*----------------------------- * Operation 7: x @@ -740,21 +756,21 @@ test_specials(hid_t file) if ((dset_id = H5Dcreate2(file, "/special7", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) - TEST_ERROR + TEST_ERROR; COMPARE_INT(read_buf, data_res) if (H5Dclose(dset_id) < 0) - TEST_ERROR + TEST_ERROR; if (H5Pclose(dxpl_id) < 0) - TEST_ERROR + TEST_ERROR; if (H5Sclose(dataspace) < 0) - TEST_ERROR + TEST_ERROR; PASSED(); return 0; @@ -778,15 +794,15 @@ test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy) polyflres[row][col] = (float)((2 + windchillC) * ((windchillC - 8) / 2)); } - TESTING("data transform, linear transform w/ copied property") + TESTING("data transform, linear transform w/ copied property"); if (H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread) < 0) - TEST_ERROR + TEST_ERROR; COMPARE(int, windchillFintread, windchillFfloat, 2) - TESTING("data transform, polynomial transform w/ copied property") + TESTING("data transform, polynomial transform w/ copied property"); if (H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread) < 0) - TEST_ERROR + TEST_ERROR; COMPARE(int, polyintread, polyflres, 2) @@ -803,9 +819,9 @@ test_trivial(const hid_t dxpl_id_simple) int windchillFintread[ROWS][COLS]; int row, col; - TESTING("data transform, trivial transform, without type conversion") + TESTING("data transform, trivial transform, without type conversion"); if (H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread) < 0) - TEST_ERROR + TEST_ERROR; for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { if ((windchillFfloatread[row][col] - 4.8F) > FLOAT_TOL) @@ -814,13 +830,13 @@ test_trivial(const hid_t dxpl_id_simple) PASSED(); - TESTING("data transform, trivial transform, with type conversion") + TESTING("data transform, trivial transform, with type conversion"); if (H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread) < 0) - TEST_ERROR + TEST_ERROR; for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { if (windchillFintread[row][col] != 4) - FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") + FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n"); } PASSED(); @@ -840,45 +856,45 @@ test_getset(const hid_t dxpl_id_c_to_f) const char *c_to_f = "(9/5.0)*x + 32"; char * ptrgetTest = NULL; - TESTING("H5Pget_data_transform") + TESTING("H5Pget_data_transform"); if (NULL == (ptrgetTest = (char *)HDmalloc(HDstrlen(simple) + 1))) - TEST_ERROR + TEST_ERROR; if (H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(c_to_f) + 1) < 0) - TEST_ERROR + TEST_ERROR; if (HDstrcmp(c_to_f, ptrgetTest) != 0) - FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n") + FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n"); PASSED(); HDfree(ptrgetTest); ptrgetTest = NULL; - TESTING("data transform, read after resetting of transform property") + TESTING("data transform, read after resetting of transform property"); if (H5Pset_data_transform(dxpl_id_c_to_f, simple) < 0) - TEST_ERROR + TEST_ERROR; if (H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread) < 0) - TEST_ERROR + TEST_ERROR; for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { if ((windchillFfloatread[row][col] - 4.8F) > FLOAT_TOL) - FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") + FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n"); } PASSED(); - TESTING("H5Pget_data_transform, after resetting transform property") + TESTING("H5Pget_data_transform, after resetting transform property"); if (NULL == (ptrgetTest = (char *)HDcalloc((size_t)1, HDstrlen(simple) + 1))) - TEST_ERROR + TEST_ERROR; if (H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(simple) + 1) < 0) - TEST_ERROR + TEST_ERROR; if (HDstrcmp(simple, ptrgetTest) != 0) - FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n") + FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n"); PASSED(); @@ -902,13 +918,13 @@ test_set(void) const char *str = "(9/5.0)*x + 32"; char * ptrgetTest = NULL; - TESTING("H5Pget_data_transform (get before set)") + TESTING("H5Pget_data_transform (get before set)"); if (NULL == (ptrgetTest = (char *)HDmalloc(HDstrlen(str) + 1))) - TEST_ERROR + TEST_ERROR; if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - TEST_ERROR + TEST_ERROR; /* Test get before set */ H5Eget_auto2(H5E_DEFAULT, &func, NULL); @@ -926,34 +942,34 @@ test_set(void) TESTING("H5Pset_data_transform (set with NULL transform)"); INVALID_SET_TEST(NULL); - TESTING("H5Pset_data_transform (set with invalid transform 1)") + TESTING("H5Pset_data_transform (set with invalid transform 1)"); INVALID_SET_TEST("\0"); - TESTING("H5Pset_data_transform (set with invalid transform 2)") + TESTING("H5Pset_data_transform (set with invalid transform 2)"); INVALID_SET_TEST(" "); - TESTING("H5Pset_data_transform (set with invalid transform 3)") + TESTING("H5Pset_data_transform (set with invalid transform 3)"); INVALID_SET_TEST("x+"); - TESTING("H5Pset_data_transform (set with invalid transform 4)") + TESTING("H5Pset_data_transform (set with invalid transform 4)"); INVALID_SET_TEST("(x+5"); - TESTING("H5Pset_data_transform (set with invalid transform 5)") + TESTING("H5Pset_data_transform (set with invalid transform 5)"); INVALID_SET_TEST("+"); - TESTING("H5Pset_data_transform (set with invalid transform 6)") + TESTING("H5Pset_data_transform (set with invalid transform 6)"); INVALID_SET_TEST("(9/5)*x + x**2"); - TESTING("H5Pset_data_transform (set with invalid transform 7)") + TESTING("H5Pset_data_transform (set with invalid transform 7)"); INVALID_SET_TEST("(9/5)x"); - TESTING("H5Pset_data_transform (set with invalid transform 8)") + TESTING("H5Pset_data_transform (set with invalid transform 8)"); INVALID_SET_TEST("(9/5)*x + x^2"); H5Eset_auto2(H5E_DEFAULT, func, NULL); if (H5Pclose(dxpl_id) < 0) - TEST_ERROR + TEST_ERROR; return 0; |