diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-08-17 19:55:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 19:55:18 (GMT) |
commit | c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6 (patch) | |
tree | fb2bdf05e276e3614b3b5c343447cd82f4e6718b /c++/test/tattr.cpp | |
parent | 2bca2ca6f1ef1b60bb8541413c5f2e68ff5549d3 (diff) | |
download | hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.zip hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.gz hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.bz2 |
Reverts PR 906 and 907 due to binary compatibility issues (#918)
Diffstat (limited to 'c++/test/tattr.cpp')
-rw-r--r-- | c++/test/tattr.cpp | 60 |
1 files changed, 24 insertions, 36 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 6802b3b..adaa237 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -169,8 +169,7 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Create two more attributes for this dataset, but only write to one. @@ -186,8 +185,7 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close both attributes @@ -450,8 +448,7 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Close attribute @@ -475,8 +472,7 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close attribute @@ -541,8 +537,7 @@ test_attr_basic_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d, read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d, read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); /* @@ -573,9 +568,8 @@ test_attr_basic_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) { - TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE - "]=%d, " - "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); } PASSED(); @@ -778,17 +772,14 @@ test_attr_compound_read() for (ii = 0; ii < ATTR4_DIM1; ii++) for (jj = 0; jj < ATTR4_DIM2; jj++) if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) { - TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE - "].i=%d, " - "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n", + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, " + "read_data4[%llu][%llu].i=%d\n", __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); - TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE - "].d=%f, " - "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].d=%f\n", + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].d=%f, " + "read_data4[%llu][%llu].d=%f\n", __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); - TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE - "].c=%c, " - "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].c=%c\n", + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].c=%c, " + "read_data4[%llu][%llu].c=%c\n", __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); } /* end if */ @@ -1051,10 +1042,10 @@ test_attr_mult_read() // Get the dims of the dataspace and verify them hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions - (void)space.getSimpleExtentDims(dims); - if (dims[0] != ATTR1_DIM1) - TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %" PRIuHSIZE "\n", - __LINE__, static_cast<int>(dims[0]), ATTR1_DIM1); + int ndims = space.getSimpleExtentDims(dims); + if ((long)dims[0] != (long)ATTR1_DIM1) + TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %llu\n", __LINE__, + (int)dims[0], ATTR1_DIM1); /* Verify Datatype */ @@ -1081,8 +1072,7 @@ test_attr_mult_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE - "]=%d,read_data1[%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); // Verify Name @@ -1105,7 +1095,7 @@ test_attr_mult_read() verify_val(rank, ATTR2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); // Get the dims of the dataspace and verify them - int ndims = space.getSimpleExtentDims(dims); + ndims = space.getSimpleExtentDims(dims); verify_val((long)dims[0], (long)ATTR2_DIM1, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); verify_val((long)dims[1], (long)ATTR2_DIM2, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); @@ -1137,9 +1127,8 @@ test_attr_mult_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) - TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE - "]=%d, " - "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); // Verify Name @@ -1192,10 +1181,9 @@ test_attr_mult_read() for (i = 0; i < ATTR3_DIM1; i++) for (j = 0; j < ATTR3_DIM2; j++) for (k = 0; k < ATTR3_DIM3; k++) - if (abs(attr_data3[i][j][k] - read_data3[i][j][k]) > DBL_EPSILON) - TestErrPrintf("%d: attribute data different: attr_data3[%" PRIuHSIZE "][%" PRIuHSIZE - "][%" PRIuHSIZE "]=%f, " - "read_data3[%" PRIuHSIZE "][%" PRIuHSIZE "][%" PRIuHSIZE "]=%f\n", + if (attr_data3[i][j][k] != read_data3[i][j][k]) + TestErrPrintf("%d: attribute data different: attr_data3[%llu][%llu][%llu]=%f, " + "read_data3[%llu][%llu][%llu]=%f\n", __LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]); // Verify Name |