diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-08-25 20:11:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 20:11:06 (GMT) |
commit | 6b1adb2ec97a529854613e091270f5b3cb37bc22 (patch) | |
tree | 2779f78bcfad97dcaeff4ef8560ee0c27ef850a1 /test/dtransform.c | |
parent | 9424fa2d5e9cab7e187f9e1efe0bc7ba50f691ca (diff) | |
download | hdf5-6b1adb2ec97a529854613e091270f5b3cb37bc22.zip hdf5-6b1adb2ec97a529854613e091270f5b3cb37bc22.tar.gz hdf5-6b1adb2ec97a529854613e091270f5b3cb37bc22.tar.bz2 |
Merge test changes from develop (#959)
Diffstat (limited to 'test/dtransform.c')
-rw-r--r-- | test/dtransform.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/test/dtransform.c b/test/dtransform.c index 9445d83..8d3a8c0 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -32,30 +32,30 @@ hid_t dset_id_int_chunk = -1; hid_t dset_id_float_chunk = -1; const float windchillFfloat[ROWS][COLS] = { - {36.0f, 31.0f, 25.0f, 19.0f, 13.0f, 7.0f, 1.0f, -5.0f, -11.0f, -16.0f, -22.0f, -28.0f, -34.0f, -40.0f, - -46.0f, -52.0f, -57.0f, -63.0f}, - {34.0f, 27.0f, 21.0f, 15.0f, 9.0f, 3.0f, -4.0f, -10.0f, -16.0f, -22.0f, -28.0f, -35.0f, -41.0f, -47.0f, - -53.0f, -59.0f, -66.0f, -72.0f}, - {32.0f, 25.0f, 19.0f, 13.0f, 6.0f, 0.0f, -7.0f, -13.0f, -19.0f, -26.0f, -32.0f, -39.0f, -45.0f, -51.0f, - -58.0f, -64.0f, -71.0f, -77.0f}, - {30.0f, 24.0f, 17.0f, 11.0f, 4.0f, -2.0f, -9.0f, -15.0f, -22.0f, -29.0f, -35.0f, -42.0f, -48.0f, -55.0f, - -61.0f, -68.0f, -74.0f, -81.0f}, - {29.0f, 23.0f, 16.0f, 9.0f, 3.0f, -4.0f, -11.0f, -17.0f, -24.0f, -31.0f, -37.0f, -44.0f, -51.0f, -58.0f, - -64.0f, -71.0f, -78.0f, -84.0f}, - {28.0f, 22.0f, 15.0f, 8.0f, 1.0f, -5.0f, -12.0f, -19.0f, -26.0f, -33.0f, -39.0f, -46.0f, -53.0f, -60.0f, - -67.0f, -73.0f, -80.0f, -87.0f}, - {28.0f, 21.0f, 14.0f, 7.0f, 0.0f, -7.0f, -14.0f, -21.0f, -27.0f, -34.0f, -41.0f, -48.0f, -55.0f, -62.0f, - -69.0f, -76.0f, -82.0f, -89.0f}, - {27.0f, 20.0f, 13.0f, 6.0f, -1.0f, -8.0f, -15.0f, -22.0f, -29.0f, -36.0f, -43.0f, -50.0f, -57.0f, -64.0f, - -71.0f, -78.0f, -84.0f, -91.0f}, - {26.0f, 19.0f, 12.0f, 5.0f, -2.0f, -9.0f, -16.0f, -23.0f, -30.0f, -37.0f, -44.0f, -51.0f, -58.0f, -65.0f, - -72.0f, -79.0f, -86.0f, -93.0f}, - {26.0f, 19.0f, 12.0f, 4.0f, -3.0f, -10.0f, -17.0f, -24.0f, -31.0f, -38.0f, -45.0f, -52.0f, -60.0f, -67.0f, - -74.0f, -81.0f, -88.0f, -95.0f}, - {25.0f, 18.0f, 11.0f, 4.0f, -3.0f, -11.0f, -18.0f, -25.0f, -32.0f, -39.0f, -46.0f, -54.0f, -61.0f, -68.0f, - -75.0f, -82.0f, -89.0f, -97.0f}, - {25.0f, 17.0f, 10.0f, 3.0f, -4.0f, -11.0f, -19.0f, -26.0f, -33.0f, -40.0f, -48.0f, -55.0f, -62.0f, -69.0f, - -76.0f, -84.0f, -91.0f, -98.0f}}; + {36.0F, 31.0F, 25.0F, 19.0F, 13.0F, 7.0F, 1.0F, -5.0F, -11.0F, -16.0F, -22.0F, -28.0F, -34.0F, -40.0F, + -46.0F, -52.0F, -57.0F, -63.0F}, + {34.0F, 27.0F, 21.0F, 15.0F, 9.0F, 3.0F, -4.0F, -10.0F, -16.0F, -22.0F, -28.0F, -35.0F, -41.0F, -47.0F, + -53.0F, -59.0F, -66.0F, -72.0F}, + {32.0F, 25.0F, 19.0F, 13.0F, 6.0F, 0.0F, -7.0F, -13.0F, -19.0F, -26.0F, -32.0F, -39.0F, -45.0F, -51.0F, + -58.0F, -64.0F, -71.0F, -77.0F}, + {30.0F, 24.0F, 17.0F, 11.0F, 4.0F, -2.0F, -9.0F, -15.0F, -22.0F, -29.0F, -35.0F, -42.0F, -48.0F, -55.0F, + -61.0F, -68.0F, -74.0F, -81.0F}, + {29.0F, 23.0F, 16.0F, 9.0F, 3.0F, -4.0F, -11.0F, -17.0F, -24.0F, -31.0F, -37.0F, -44.0F, -51.0F, -58.0F, + -64.0F, -71.0F, -78.0F, -84.0F}, + {28.0F, 22.0F, 15.0F, 8.0F, 1.0F, -5.0F, -12.0F, -19.0F, -26.0F, -33.0F, -39.0F, -46.0F, -53.0F, -60.0F, + -67.0F, -73.0F, -80.0F, -87.0F}, + {28.0F, 21.0F, 14.0F, 7.0F, 0.0F, -7.0F, -14.0F, -21.0F, -27.0F, -34.0F, -41.0F, -48.0F, -55.0F, -62.0F, + -69.0F, -76.0F, -82.0F, -89.0F}, + {27.0F, 20.0F, 13.0F, 6.0F, -1.0F, -8.0F, -15.0F, -22.0F, -29.0F, -36.0F, -43.0F, -50.0F, -57.0F, -64.0F, + -71.0F, -78.0F, -84.0F, -91.0F}, + {26.0F, 19.0F, 12.0F, 5.0F, -2.0F, -9.0F, -16.0F, -23.0F, -30.0F, -37.0F, -44.0F, -51.0F, -58.0F, -65.0F, + -72.0F, -79.0F, -86.0F, -93.0F}, + {26.0F, 19.0F, 12.0F, 4.0F, -3.0F, -10.0F, -17.0F, -24.0F, -31.0F, -38.0F, -45.0F, -52.0F, -60.0F, -67.0F, + -74.0F, -81.0F, -88.0F, -95.0F}, + {25.0F, 18.0F, 11.0F, 4.0F, -3.0F, -11.0F, -18.0F, -25.0F, -32.0F, -39.0F, -46.0F, -54.0F, -61.0F, -68.0F, + -75.0F, -82.0F, -89.0F, -97.0F}, + {25.0F, 17.0F, 10.0F, 3.0F, -4.0F, -11.0F, -19.0F, -26.0F, -33.0F, -40.0F, -48.0F, -55.0F, -62.0F, -69.0F, + -76.0F, -84.0F, -91.0F, -98.0F}}; const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, 28, 34, 40, 46, 52, 57, 63}, {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 1}, @@ -77,9 +77,9 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, for (i = 0; i < ROWS; i++) \ for (j = 0; j < COLS; j++) { \ if (!((((VAR1)[i][j] >= (TYPE)((VAR2)[i][j])) && \ - (((VAR1)[i][j] - TOL) < (TYPE)((VAR2)[i][j]))) || \ + (((VAR1)[i][j] - (TOL)) < (TYPE)((VAR2)[i][j]))) || \ (((VAR1)[i][j] <= (TYPE)((VAR2)[i][j])) && \ - (((VAR1)[i][j] + TOL) > (TYPE)((VAR2)[i][j]))))) { \ + (((VAR1)[i][j] + (TOL)) > (TYPE)((VAR2)[i][j]))))) { \ H5_FAILED(); \ HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \ goto error; \ @@ -94,8 +94,8 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, \ for (i = 0; i < ROWS; i++) \ for (j = 0; j < COLS; j++) { \ - if (!(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + TOL)) && \ - ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - TOL)))) { \ + if (!(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + (TOL))) && \ + ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - (TOL))))) { \ H5_FAILED(); \ HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \ goto error; \ @@ -540,19 +540,19 @@ test_poly(const hid_t dxpl_id_polynomial) for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { - windchillC = (int)((5.0f / 9.0f) * (windchillFfloat[row][col] - 32)); - polyflres[row][col] = ((2.0f + (float)windchillC) * (((float)windchillC - 8.0f) / 2.0f)); + windchillC = (int)((5.0F / 9.0F) * (windchillFfloat[row][col] - 32)); + polyflres[row][col] = ((2.0F + (float)windchillC) * (((float)windchillC - 8.0F) / 2.0F)); } 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 - COMPARE(float, polyflread, polyflres, 2.0f) + COMPARE(float, polyflread, polyflres, 2.0F) for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { - windchillC = (int)((5.0f / 9.0f) * (windchillFfloat[row][col] - 32)); + windchillC = (int)((5.0F / 9.0F) * (windchillFfloat[row][col] - 32)); polyflres[row][col] = (float)((2 + windchillC) * ((windchillC - 8) / 2)); } @@ -752,7 +752,7 @@ test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy) for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { - windchillC = (int)((5.0f / 9.0f) * (windchillFfloat[row][col] - 32)); + windchillC = (int)((5.0F / 9.0F) * (windchillFfloat[row][col] - 32)); polyflres[row][col] = (float)((2 + windchillC) * ((windchillC - 8) / 2)); } @@ -786,7 +786,7 @@ test_trivial(const hid_t dxpl_id_simple) TEST_ERROR for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { - if ((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL) + if ((windchillFfloatread[row][col] - 4.8F) > FLOAT_TOL) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n"); } @@ -843,7 +843,7 @@ test_getset(const hid_t dxpl_id_c_to_f) for (row = 0; row < ROWS; row++) for (col = 0; col < COLS; col++) { - if ((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL) + if ((windchillFfloatread[row][col] - 4.8F) > FLOAT_TOL) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") } |