summaryrefslogtreecommitdiffstats
path: root/test/direct_chunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/direct_chunk.c')
-rw-r--r--test/direct_chunk.c180
1 files changed, 90 insertions, 90 deletions
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
index d6f094e..95ff9df 100644
--- a/test/direct_chunk.c
+++ b/test/direct_chunk.c
@@ -204,7 +204,7 @@ test_direct_chunk_write(hid_t file)
direct_buf[i][j] = n++;
/* Allocate output (compressed) buffer */
- outbuf = HDmalloc(z_dst_nbytes);
+ outbuf = malloc(z_dst_nbytes);
z_dst = (Bytef *)outbuf;
/* Perform compression from the source to the destination buffer */
@@ -212,15 +212,15 @@ test_direct_chunk_write(hid_t file)
/* Check for various zlib errors */
if (Z_BUF_ERROR == ret) {
- HDfprintf(stderr, "overflow");
+ fprintf(stderr, "overflow");
goto error;
}
else if (Z_MEM_ERROR == ret) {
- HDfprintf(stderr, "deflate memory error");
+ fprintf(stderr, "deflate memory error");
goto error;
}
else if (Z_OK != ret) {
- HDfprintf(stderr, "other deflate error");
+ fprintf(stderr, "other deflate error");
goto error;
}
@@ -236,7 +236,7 @@ test_direct_chunk_write(hid_t file)
}
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
if (H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
goto error;
@@ -269,9 +269,9 @@ test_direct_chunk_write(hid_t file)
for (i = 0; i < CHUNK_NX; i++) {
for (j = 0; j < CHUNK_NY; j++) {
if (direct_buf[i][j] != check_chunk[i][j]) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]);
goto error;
}
}
@@ -283,7 +283,7 @@ test_direct_chunk_write(hid_t file)
direct_buf[i][j] = i + j;
/* Allocate output (compressed) buffer */
- outbuf = HDmalloc(z_dst_nbytes);
+ outbuf = malloc(z_dst_nbytes);
z_dst = (Bytef *)outbuf;
/* Perform compression from the source to the destination buffer */
@@ -291,15 +291,15 @@ test_direct_chunk_write(hid_t file)
/* Check for various zlib errors */
if (Z_BUF_ERROR == ret) {
- HDfprintf(stderr, "overflow");
+ fprintf(stderr, "overflow");
goto error;
}
else if (Z_MEM_ERROR == ret) {
- HDfprintf(stderr, "deflate memory error");
+ fprintf(stderr, "deflate memory error");
goto error;
}
else if (Z_OK != ret) {
- HDfprintf(stderr, "other deflate error");
+ fprintf(stderr, "other deflate error");
goto error;
}
@@ -316,7 +316,7 @@ test_direct_chunk_write(hid_t file)
}
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
if (H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
goto error;
@@ -335,9 +335,9 @@ test_direct_chunk_write(hid_t file)
for (i = 0; i < CHUNK_NX; i++) {
for (j = 0; j < CHUNK_NY; j++) {
if (direct_buf[i][j] != check_chunk[i][j]) {
- HDprintf(" 2. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]);
+ printf(" 2. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]);
goto error;
}
}
@@ -367,7 +367,7 @@ error:
H5E_END_TRY;
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
H5_FAILED();
return 1;
@@ -605,9 +605,9 @@ test_skip_compress_write1(hid_t file)
for (i = 0; i < CHUNK_NX; i++) {
for (j = 0; j < CHUNK_NY; j++) {
if (direct_buf[i][j] != check_chunk[i][j]) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[i][j], check_chunk[i][j]);
goto error;
}
}
@@ -620,7 +620,7 @@ test_skip_compress_write1(hid_t file)
goto error;
/* Read the raw chunk back */
- HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf));
+ memset(&read_direct_buf, 0, sizeof(read_direct_buf));
if ((status = H5Dread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, read_direct_buf)) < 0)
goto error;
if (read_filter_mask != filter_mask)
@@ -630,9 +630,9 @@ test_skip_compress_write1(hid_t file)
for (i = 0; i < CHUNK_NX; i++) {
for (j = 0; j < CHUNK_NY; j++) {
if (direct_buf[i][j] != read_direct_buf[i][j]) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]);
goto error;
}
}
@@ -880,10 +880,10 @@ test_skip_compress_write2(hid_t file)
for (i = 0; i < CHUNK_NX; i++) {
for (j = 0; j < CHUNK_NY; j++) {
if (origin_direct_buf[i][j] != check_chunk[i][j]) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j],
- check_chunk[i][j]);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j],
+ check_chunk[i][j]);
goto error;
}
}
@@ -896,7 +896,7 @@ test_skip_compress_write2(hid_t file)
goto error;
/* Read the raw chunk back */
- HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf));
+ memset(&read_direct_buf, 0, sizeof(read_direct_buf));
if ((status = H5Dread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, read_direct_buf)) < 0)
goto error;
if (read_filter_mask != filter_mask)
@@ -906,9 +906,9 @@ test_skip_compress_write2(hid_t file)
for (i = 0; i < CHUNK_NX; i++) {
for (j = 0; j < CHUNK_NY; j++) {
if (direct_buf[i][j] != read_direct_buf[i][j]) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]);
goto error;
}
}
@@ -1088,16 +1088,16 @@ test_data_conv(hid_t file)
(direct_buf[i][j]).c[3] != (read_chunk[i][j]).c[3] ||
(direct_buf[i][j]).d != (read_chunk[i][j]).d ||
(direct_buf[i][j]).e != (read_chunk[i][j]).e) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (direct_buf[i][j]).a,
- (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1],
- (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d,
- (direct_buf[i][j]).e);
- HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (read_chunk[i][j]).a,
- (read_chunk[i][j]).b, (read_chunk[i][j]).c[0], (read_chunk[i][j]).c[1],
- (read_chunk[i][j]).c[2], (read_chunk[i][j]).c[3], (read_chunk[i][j]).d,
- (read_chunk[i][j]).e);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (direct_buf[i][j]).a,
+ (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1],
+ (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d,
+ (direct_buf[i][j]).e);
+ printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (read_chunk[i][j]).a,
+ (read_chunk[i][j]).b, (read_chunk[i][j]).c[0], (read_chunk[i][j]).c[1],
+ (read_chunk[i][j]).c[2], (read_chunk[i][j]).c[3], (read_chunk[i][j]).d,
+ (read_chunk[i][j]).e);
goto error;
}
@@ -1131,15 +1131,15 @@ test_data_conv(hid_t file)
(direct_buf[i][j]).c[2] != (check_chunk[i][j]).c[2] ||
(direct_buf[i][j]).c[3] != (check_chunk[i][j]).c[3] ||
(direct_buf[i][j]).e != (check_chunk[i][j]).e) {
- HDprintf(" 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (direct_buf[i][j]).a,
- (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1],
- (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d,
- (direct_buf[i][j]).e);
- HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", (check_chunk[i][j]).a,
- (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2],
- (check_chunk[i][j]).c[3], (check_chunk[i][j]).e);
+ printf(" 1. Read different values than written.");
+ printf(" At index %d,%d\n", i, j);
+ printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", (direct_buf[i][j]).a,
+ (direct_buf[i][j]).b, (direct_buf[i][j]).c[0], (direct_buf[i][j]).c[1],
+ (direct_buf[i][j]).c[2], (direct_buf[i][j]).c[3], (direct_buf[i][j]).d,
+ (direct_buf[i][j]).e);
+ printf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", (check_chunk[i][j]).a,
+ (check_chunk[i][j]).c[0], (check_chunk[i][j]).c[1], (check_chunk[i][j]).c[2],
+ (check_chunk[i][j]).c[3], (check_chunk[i][j]).e);
goto error;
}
@@ -1510,7 +1510,7 @@ test_direct_chunk_read_no_cache(hid_t file)
goto error;
/* Allocate output (compressed) buffer */
- outbuf = HDmalloc(z_src_nbytes);
+ outbuf = malloc(z_src_nbytes);
z_src = (Bytef *)outbuf;
/* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */
@@ -1550,19 +1550,19 @@ test_direct_chunk_read_no_cache(hid_t file)
/* Check for various zlib errors */
if (Z_BUF_ERROR == ret) {
- HDfprintf(stderr, "overflow\n");
+ fprintf(stderr, "overflow\n");
goto error;
}
else if (Z_MEM_ERROR == ret) {
- HDfprintf(stderr, "deflate memory error\n");
+ fprintf(stderr, "deflate memory error\n");
goto error;
}
else if (Z_DATA_ERROR == ret) {
- HDfprintf(stderr, "corrupted data\n");
+ fprintf(stderr, "corrupted data\n");
goto error;
}
else if (Z_OK != ret) {
- HDfprintf(stderr, "other deflate error\n");
+ fprintf(stderr, "other deflate error\n");
goto error;
}
@@ -1570,9 +1570,9 @@ test_direct_chunk_read_no_cache(hid_t file)
for (k = 0; k < CHUNK_NX; k++) {
for (l = 0; l < CHUNK_NY; l++) {
if (direct_buf[k][l] != check_chunk[k][l]) {
- HDprintf("\n 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", k, l);
- HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
+ printf("\n 1. Read different values than written.");
+ printf(" At index %d,%d\n", k, l);
+ printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
goto error;
}
}
@@ -1589,7 +1589,7 @@ test_direct_chunk_read_no_cache(hid_t file)
H5Pclose(dapl);
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
PASSED();
return 0;
@@ -1607,7 +1607,7 @@ error:
H5E_END_TRY;
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
H5_FAILED();
return 1;
@@ -1694,7 +1694,7 @@ test_direct_chunk_read_cache(hid_t file, hbool_t flush)
}
/* Allocate output (compressed) buffer */
- outbuf = HDmalloc(z_src_nbytes);
+ outbuf = malloc(z_src_nbytes);
z_src = (Bytef *)outbuf;
/* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */
@@ -1741,19 +1741,19 @@ test_direct_chunk_read_cache(hid_t file, hbool_t flush)
/* Check for various zlib errors */
if (Z_BUF_ERROR == ret) {
- HDfprintf(stderr, "overflow\n");
+ fprintf(stderr, "overflow\n");
goto error;
}
else if (Z_MEM_ERROR == ret) {
- HDfprintf(stderr, "deflate memory error\n");
+ fprintf(stderr, "deflate memory error\n");
goto error;
}
else if (Z_DATA_ERROR == ret) {
- HDfprintf(stderr, "corrupted data\n");
+ fprintf(stderr, "corrupted data\n");
goto error;
}
else if (Z_OK != ret) {
- HDfprintf(stderr, "other deflate error\n");
+ fprintf(stderr, "other deflate error\n");
goto error;
}
@@ -1761,9 +1761,9 @@ test_direct_chunk_read_cache(hid_t file, hbool_t flush)
for (k = 0; k < CHUNK_NX; k++) {
for (l = 0; l < CHUNK_NY; l++) {
if (direct_buf[k][l] != check_chunk[k][l]) {
- HDprintf("\n 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", k, l);
- HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
+ printf("\n 1. Read different values than written.");
+ printf(" At index %d,%d\n", k, l);
+ printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
goto error;
}
}
@@ -1779,7 +1779,7 @@ test_direct_chunk_read_cache(hid_t file, hbool_t flush)
H5Pclose(dxpl);
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
PASSED();
return 0;
@@ -1796,7 +1796,7 @@ error:
H5E_END_TRY;
if (outbuf)
- HDfree(outbuf);
+ free(outbuf);
H5_FAILED();
return 1;
@@ -1910,7 +1910,7 @@ test_read_unfiltered_dset(hid_t file)
offset[0] = (hsize_t)i * CHUNK_NX;
offset[1] = (hsize_t)j * CHUNK_NY;
/* Read the raw chunk back */
- HDmemset(&direct_buf, 0, sizeof(direct_buf));
+ memset(&direct_buf, 0, sizeof(direct_buf));
filter_mask = UINT_MAX;
if ((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) < 0)
goto error;
@@ -1923,9 +1923,9 @@ test_read_unfiltered_dset(hid_t file)
for (k = 0; k < CHUNK_NX; k++) {
for (l = 0; l < CHUNK_NY; l++) {
if (direct_buf[k][l] != check_chunk[k][l]) {
- HDprintf("\n 1. Read different values than written.");
- HDprintf(" At index %d,%d\n", k, l);
- HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
+ printf("\n 1. Read different values than written.");
+ printf(" At index %d,%d\n", k, l);
+ printf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
goto error;
}
}
@@ -2014,7 +2014,7 @@ test_read_unallocated_chunk(hid_t file)
FAIL_STACK_ERROR;
/* Write a single chunk to initialize the chunk storage */
- HDmemset(direct_buf, 0, CHUNK_NX * CHUNK_NY * sizeof(int));
+ memset(direct_buf, 0, CHUNK_NX * CHUNK_NY * sizeof(int));
offset[0] = 0;
offset[1] = 0;
@@ -2299,41 +2299,41 @@ main(void)
continue;
/* Print configuration */
- HDprintf("Configuration: ");
+ printf("Configuration: ");
if (config == 0)
- HDprintf("<empty>");
+ printf("<empty>");
if (config & CONFIG_LATEST) {
if (need_comma)
- HDprintf(", ");
- HDprintf("latest format");
+ printf(", ");
+ printf("latest format");
need_comma = TRUE;
} /* end if */
if (config & CONFIG_REOPEN_FILE) {
if (need_comma)
- HDprintf(", ");
- HDprintf("reopen file");
+ printf(", ");
+ printf("reopen file");
need_comma = TRUE;
} /* end if */
else if (config & CONFIG_REOPEN_DSET) {
if (need_comma)
- HDprintf(", ");
- HDprintf("reopen dataset");
+ printf(", ");
+ printf("reopen dataset");
need_comma = TRUE;
} /* end if */
if (config & CONFIG_DIRECT_WRITE) {
if (need_comma)
- HDprintf(", ");
- HDprintf("direct write");
+ printf(", ");
+ printf("direct write");
need_comma = TRUE;
} /* end if */
if (config & CONFIG_DIRECT_READ) {
if (need_comma)
- HDprintf(", ");
- HDprintf("direct read");
+ printf(", ");
+ printf("direct read");
need_comma = TRUE;
} /* end if */
- HDprintf(":\n");
- HDfflush(stdout);
+ printf(":\n");
+ fflush(stdout);
nerrors += test_single_chunk(config);
} /* end for */