diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-08-27 19:19:03 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-08-27 19:19:03 (GMT) |
commit | 89928e7c212a718e3d85d106733e415b7fb52d8c (patch) | |
tree | a274c8b44f49a19d24e723cde39066cc10da4d62 /hl/test/test_packet_vlen.c | |
parent | 68cd4eea0e450eb0b8e6e6313c31b612d1019a4f (diff) | |
parent | 506a5069a8b401db52ffe314e53751a0f1027128 (diff) | |
download | hdf5-89928e7c212a718e3d85d106733e415b7fb52d8c.zip hdf5-89928e7c212a718e3d85d106733e415b7fb52d8c.tar.gz hdf5-89928e7c212a718e3d85d106733e415b7fb52d8c.tar.bz2 |
Merge branch 'develop' into H5Pset_fapl_mpi
Diffstat (limited to 'hl/test/test_packet_vlen.c')
-rw-r--r-- | hl/test/test_packet_vlen.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index 4d83ae6..b41e73d 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -69,7 +69,7 @@ static int test_VLof_atomic(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int)); if (writeBuf[uu].p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -108,7 +108,7 @@ static int test_VLof_atomic(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -120,8 +120,8 @@ static int test_VLof_atomic(void) for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) { - printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); - printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); + HDprintf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); + HDprintf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); } } @@ -186,7 +186,7 @@ static int test_VLof_comptype(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t)); if(writeBuf[uu].p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -242,7 +242,7 @@ static int test_VLof_comptype(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -253,13 +253,13 @@ static int test_VLof_comptype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].len != readBuf[uu].len) { - fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len); + HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len); continue; } /* write len != read len */ for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) { - fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]); + HDfprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]); continue; } /* write value != read value */ } @@ -334,7 +334,7 @@ static int test_compound_VL_VLtype(void) writeBuf[uu].f = (float)(uu * 20) / 3.0F; writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t)); if (writeBuf[uu].v.p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].v.len = uu + L1_INCM; @@ -342,7 +342,7 @@ static int test_compound_VL_VLtype(void) { t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int)); if (t1->p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + L2_INCM; @@ -407,7 +407,7 @@ static int test_compound_VL_VLtype(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -418,27 +418,27 @@ static int test_compound_VL_VLtype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].u != readBuf[uu].u) { - fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u); + HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u); continue; } /* end if */ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f,readBuf[uu].f)) { - fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); + HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); continue; } /* end if */ if (writeBuf[uu].v.len != readBuf[uu].v.len) { - fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); + HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); continue; } /* end if */ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) { if (t1->len != t2->len) { - fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len); + HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len); continue; } /* end if */ for (ww = 0; (size_t)ww < t2->len; ww++) { if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) { - fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); + HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); continue; } /* end if */ } /* end for */ @@ -505,7 +505,7 @@ static int test_VLof_VLtype(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t)); if (writeBuf[uu].p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } /* end if */ writeBuf[uu].len = uu + 1; @@ -513,7 +513,7 @@ static int test_VLof_VLtype(void) { t1->p = HDmalloc((vv + 1) * sizeof(unsigned int)); if (t1->p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv * 1; @@ -559,7 +559,7 @@ static int test_VLof_VLtype(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -628,7 +628,7 @@ static int verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expecte HDstrcpy(lenthtype, "fixed-length"); if (expected_value == 1) HDstrcpy(lenthtype, "variable-length"); - fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); + HDfprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); ret = FAIL; } @@ -1062,7 +1062,7 @@ static int testfl_VLof_atomic(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int)); if (writeBuf[uu].p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -1101,7 +1101,7 @@ static int testfl_VLof_atomic(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1113,8 +1113,8 @@ static int testfl_VLof_atomic(void) for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) { - printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); - printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); + HDprintf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); + HDprintf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); } } @@ -1179,7 +1179,7 @@ static int testfl_VLof_comptype(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t)); if(writeBuf[uu].p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -1235,7 +1235,7 @@ static int testfl_VLof_comptype(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1246,13 +1246,13 @@ static int testfl_VLof_comptype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].len != readBuf[uu].len) { - fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len); + HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len); continue; } /* write len != read len */ for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) { - fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]); + HDfprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]); continue; } /* write value != read value */ } @@ -1327,7 +1327,7 @@ static int testfl_compound_VL_VLtype(void) writeBuf[uu].f = (float)(uu * 20) / 3.0F; writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t)); if (writeBuf[uu].v.p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].v.len = uu + L1_INCM; @@ -1335,7 +1335,7 @@ static int testfl_compound_VL_VLtype(void) { t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int)); if (t1->p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + L2_INCM; @@ -1400,7 +1400,7 @@ static int testfl_compound_VL_VLtype(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1411,27 +1411,27 @@ static int testfl_compound_VL_VLtype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].u != readBuf[uu].u) { - fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u); + HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u); continue; } /* end if */ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) { - fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); + HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); continue; } /* end if */ if (writeBuf[uu].v.len != readBuf[uu].v.len) { - fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); + HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); continue; } /* end if */ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) { if (t1->len != t2->len) { - fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len); + HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len); continue; } /* end if */ for (ww = 0; (size_t)ww < t2->len; ww++) { if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) { - fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); + HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); continue; } /* end if */ } /* end for */ @@ -1498,7 +1498,7 @@ static int testfl_VLof_VLtype(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t)); if (writeBuf[uu].p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } /* end if */ writeBuf[uu].len = uu + 1; @@ -1506,7 +1506,7 @@ static int testfl_VLof_VLtype(void) { t1->p = HDmalloc((vv + 1) * sizeof(unsigned int)); if (t1->p == NULL) { - fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + 1; @@ -1552,7 +1552,7 @@ static int testfl_VLof_VLtype(void) if (ret < 0) goto error; - sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); + HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ |