summaryrefslogtreecommitdiffstats
path: root/test/fillval.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-04-30 16:07:50 (GMT)
committerGitHub <noreply@github.com>2021-04-30 16:07:50 (GMT)
commit27198d814a58640a6088f44b72d43d3bd4bb6629 (patch)
tree81ea462c0cd993553c7f3820d8ab288e9bea8ed5 /test/fillval.c
parent4155e595e2ab16d81de79ed19d7de4fab5eb3302 (diff)
downloadhdf5-27198d814a58640a6088f44b72d43d3bd4bb6629.zip
hdf5-27198d814a58640a6088f44b72d43d3bd4bb6629.tar.gz
hdf5-27198d814a58640a6088f44b72d43d3bd4bb6629.tar.bz2
Hdf5 1 10 merge of printf specifiers and VS2015 min changes (#612)
* HDFFV-10865 - merge from dev, HDFArray perf fix. * Remove duplicate setting * Whitespace changes after clang format * Undo version 11 clang format changes * Merge CMake changes from develop * test testing script merge from develop * Update supported platforms * PR#3 merge from develop * Merge gcc 10 diagnostics option from develop * Merge #318 OSX changes from develop * Merge small changes from develop * Minor non-space formatting changes * #386 copyright corrections for java folder * Merges from develop #358 patches from vtk #361 fix header guard spelling * Merge updates #358 patches from vtk #361 fix header guard spelling * format fix * Fix missing underscore and make H5public.h closer to dev * Merges from develop #340 clang -Wformat-security warnings #360 Fixed uninitialized warnings header guard underscore cleanup JNI cleanup * format alignment * Add missing test ref file * Merge #380 from develop * Finish java merges from develop * Fix java issues with tests and javadoc * Correct use of attribute access plist * Remove debug code * Remove unused variable * Change file access to read only for java tests * Split clang format operations. * More javadoc comments * Remove pre-split setting * format source * Change windows TS to use older VS. * Mostly all javadoc fixes, one argument rename. * synch file * Merge of long double fix and compiler flags * HDFFV-11229 merge changes from develop * HDFFV-11229 correct test script * HDFFV-11229 update autotools test script for two ref files * HDFFV-11229 merge dev changes for long double display in tools * Committing clang-format changes * minor whitespace * remove unneeded macro * Committing clang-format changes * Add "option" command for clang options * Rework CMake add_custom to use the BYPRODUCTS argument Update pkgconfig scripts for parallel builds. Fix install COPYING file reference. Remove unused round defines. Change CMake default setting of BUILD_CPP to off. * Fortran target depends * Remove incorrect source attribute * Revert define removal * printf specifiers and VS2015 min changes * Committing clang-format changes * Add time struct Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test/fillval.c')
-rw-r--r--test/fillval.c77
1 files changed, 41 insertions, 36 deletions
diff --git a/test/fillval.c b/test/fillval.c
index bfba392..8e21648 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -207,7 +207,7 @@ test_getset(void)
H5E_END_TRY;
if (fill_i != 0) {
H5_FAILED();
- puts(" H5Pget_fill_value() should return default 0");
+ HDputs(" H5Pget_fill_value() should return default 0");
goto error;
}
@@ -226,8 +226,8 @@ test_getset(void)
goto error;
if (fill_ss.v1 != fill_ss_rd.v1 || fill_ss.v2 != fill_ss_rd.v2) {
H5_FAILED();
- puts(" Failed to get fill value using same data type that was ");
- puts(" used to set the fill value.");
+ HDputs(" Failed to get fill value using same data type that was ");
+ HDputs(" used to set the fill value.");
goto error;
}
@@ -238,8 +238,8 @@ test_getset(void)
goto error;
if (fill_ss.v1 != fill_si.v1 || fill_ss.v2 != fill_si.v2) {
H5_FAILED();
- puts(" Failed to get fill value using a data type other than what");
- puts(" was used to set the fill value.");
+ HDputs(" Failed to get fill value using a data type other than what");
+ HDputs(" was used to set the fill value.");
goto error;
}
@@ -252,7 +252,7 @@ test_getset(void)
goto error;
if (fill_si.v1 != fill_ss.v1 || fill_si.v2 != fill_ss.v2) {
H5_FAILED();
- puts(" Resetting the fill value was unsuccessful.");
+ HDputs(" Resetting the fill value was unsuccessful.");
goto error;
}
@@ -670,12 +670,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
goto error;
if (alloc_time != H5D_ALLOC_TIME_LATE) {
H5_FAILED();
- puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
+ HDputs(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
HDprintf(" Got %d\n", alloc_time);
}
if (fill_time != H5D_FILL_TIME_ALLOC) {
H5_FAILED();
- puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
+ HDputs(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
HDprintf(" Got %d\n", fill_time);
}
if (H5Dclose(dset3) < 0)
@@ -690,7 +690,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
goto error;
if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
H5_FAILED();
- puts(" Got allocated space instead of unallocated.");
+ HDputs(" Got allocated space instead of unallocated.");
HDprintf(" Got %d\n", allocation);
goto error;
}
@@ -702,12 +702,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
goto error;
if (alloc_time != H5D_ALLOC_TIME_LATE) {
H5_FAILED();
- puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
+ HDputs(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
HDprintf(" Got %d\n", alloc_time);
}
if (fill_time != H5D_FILL_TIME_NEVER) {
H5_FAILED();
- puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
+ HDputs(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
HDprintf(" Got %d\n", fill_time);
}
if (H5Dclose(dset4) < 0)
@@ -725,7 +725,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 ||
rd_c.z != '\0') {
H5_FAILED();
- puts(" Got wrong fill value");
+ HDputs(" Got wrong fill value");
HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y,
rd_c.x, rd_c.z);
}
@@ -754,14 +754,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
goto error;
if (alloc_time != H5D_ALLOC_TIME_EARLY) {
H5_FAILED();
- puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
+ HDputs(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
HDprintf(" Got %d\n", alloc_time);
}
if (H5Pget_fill_time(dcpl, &fill_time) < 0)
goto error;
if (fill_time != H5D_FILL_TIME_NEVER) {
H5_FAILED();
- puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
+ HDputs(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
HDprintf(" Got %d\n", fill_time);
}
if (H5Dclose(dset5) < 0)
@@ -794,14 +794,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
goto error;
if (alloc_time != H5D_ALLOC_TIME_EARLY) {
H5_FAILED();
- puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
+ HDputs(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
HDprintf(" Got %d\n", alloc_time);
}
if (H5Pget_fill_time(dcpl, &fill_time) < 0)
goto error;
if (fill_time != H5D_FILL_TIME_ALLOC) {
H5_FAILED();
- puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
+ HDputs(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
HDprintf(" Got %d\n", fill_time);
}
if (H5Dclose(dset6) < 0)
@@ -819,7 +819,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 ||
rd_c.z != '\0') {
H5_FAILED();
- puts(" Got wrong fill value");
+ HDputs(" Got wrong fill value");
HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x,
rd_c.z);
}
@@ -935,7 +935,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
+ " Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE
+ "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], val_rd,
fillval);
@@ -952,7 +953,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %f, %d, %f, %c"
+ " Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE
+ "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4],
(double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)fill_c.a, fill_c.x, fill_c.y,
@@ -994,7 +996,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %u, "
+ " Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ ", %" PRIuHSIZE "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], buf[u],
fillval);
@@ -1020,7 +1023,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %f, %d, %f, %c"
+ " Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ ", %" PRIuHSIZE "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4],
(double)buf_c[u].a, buf_c[u].x, buf_c[u].y, buf_c[u].z, (double)fill_c.a,
@@ -1445,7 +1449,8 @@ test_extend_verify_integer(unsigned lineno, const hsize_t *offset, const void *_
if (*test_val != *compare_val) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
HDfprintf(stdout,
- " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: %d, "
+ " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ "}, read: %d, "
"expected: %d\n",
offset[0], offset[1], offset[2], offset[3], offset[4], *test_val, *compare_val);
goto error;
@@ -1536,7 +1541,8 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_
HDstrcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
HDfprintf(stdout,
- " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: {%d, '%s', '%s', %d} "
+ " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ "}, read: {%d, '%s', '%s', %d} "
"expected: {%d, '%s', '%s', %d}\n",
offset[0], offset[1], offset[2], offset[3], offset[4], test_val->x, test_val->a,
test_val->b, test_val->y, compare_val->x, compare_val->a, compare_val->b, compare_val->y);
@@ -1651,7 +1657,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t
} /* end if */
else {
/* Sanity check */
- assert(dtype_class == H5T_COMPOUND);
+ HDassert(dtype_class == H5T_COMPOUND);
/* Initialize specific values for this datatype */
val_size = sizeof(comp_vl_datatype);
@@ -1703,7 +1709,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t
} /* end for */
/* Check for overflow */
- assert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size)));
+ HDassert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size)));
/* Allocate & initialize buffer */
buf = HDmalloc((size_t)(nelmts * val_size));
@@ -2015,7 +2021,6 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t
HDfree(init_val_c.a);
HDfree(init_val_c.b);
HDfree(buf);
- buf = NULL;
/* Cleanup IDs */
if (H5Pclose(dcpl) < 0)
@@ -2144,7 +2149,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
*/
if (H5D_CONTIGUOUS == layout) {
SKIPPED();
- puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator");
+ HDputs(" Not implemented yet -- needs H5S_SELECT_DIFF operator");
goto skip;
}
#endif
@@ -2262,7 +2267,7 @@ test_compatible(void)
goto error;
if (dims[0] != 8 || dims[1] != 8) {
H5_FAILED();
- puts(" Got a different dimension size than what was set.");
+ HDputs(" Got a different dimension size than what was set.");
HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
goto error;
}
@@ -2274,7 +2279,7 @@ test_compatible(void)
goto error;
if (val_rd != 0) {
H5_FAILED();
- puts(" Got a different value than what was set.");
+ HDputs(" Got a different value than what was set.");
HDprintf(" Got %ld, set 0\n", (long)val_rd);
goto error;
}
@@ -2315,7 +2320,7 @@ test_compatible(void)
goto error;
if (dims[0] != 8 || dims[1] != 8) {
H5_FAILED();
- puts(" Got a different dimension size than what was set.");
+ HDputs(" Got a different dimension size than what was set.");
HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
goto error;
}
@@ -2327,7 +2332,7 @@ test_compatible(void)
goto error;
if (val_rd != fill_val) {
H5_FAILED();
- puts(" Got a different value than what was set.");
+ HDputs(" Got a different value than what was set.");
HDprintf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val);
goto error;
}
@@ -2662,11 +2667,11 @@ main(int argc, char *argv[])
if (argc >= 2) {
test_contig = test_chunk = test_compact = 0;
for (argno = 1; argno < argc; argno++) {
- if (!strcmp(argv[argno], "contiguous"))
+ if (!HDstrcmp(argv[argno], "contiguous"))
test_contig = 1;
- else if (!strcmp(argv[argno], "chunked"))
+ else if (!HDstrcmp(argv[argno], "chunked"))
test_chunk = 1;
- else if (!strcmp(argv[argno], "compact"))
+ else if (!HDstrcmp(argv[argno], "compact"))
test_compact = 1;
else {
HDfprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
@@ -2696,11 +2701,11 @@ main(int argc, char *argv[])
/* Set the FAPL for the type of format */
if (new_format) {
- puts("\nTesting with new file format:");
+ HDputs("\nTesting with new file format:");
my_fapl = fapl2;
} /* end if */
else {
- puts("Testing with old file format:");
+ HDputs("Testing with old file format:");
my_fapl = fapl;
} /* end else */