summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c1058
1 files changed, 530 insertions, 528 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 3e8a25d..8125d75 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -206,9 +206,9 @@ test_create(hid_t file)
* Create a dataset using the default dataset creation properties. We're
* not sure what they are, so we won't check.
*/
- dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT);
- if (dataset<0) goto error;
+ dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dataset < 0) goto error;
/* Close the dataset */
if(H5Dclose(dataset) < 0) goto error;
@@ -223,8 +223,8 @@ test_create(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
@@ -267,10 +267,10 @@ test_create(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
- create_parms);
+ dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, create_parms, H5P_DEFAULT);
} H5E_END_TRY;
- if (dataset >= 0) {
+ if(dataset >= 0) {
H5_FAILED();
puts(" Opened a dataset with incorrect chunking parameters.");
goto error;
@@ -281,10 +281,10 @@ test_create(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
- dataset = H5Dcreate(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
- create_parms);
- if (dataset < 0) goto error;
- H5Pclose (create_parms);
+ dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, create_parms, H5P_DEFAULT);
+ if(dataset < 0) goto error;
+ H5Pclose(create_parms);
/* Test dataset address. Should be undefined. */
if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
@@ -292,7 +292,7 @@ test_create(hid_t file)
/*
* Close the chunked dataset.
*/
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
/*
* Create a compact dataset, then close it.
@@ -304,11 +304,11 @@ test_create(hid_t file)
status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY);
assert(status >= 0);
- dataset = H5Dcreate(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE,
- small_space, create_parms);
+ dataset = H5Dcreate2(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE,
+ small_space, H5P_DEFAULT, create_parms, H5P_DEFAULT);
if(dataset < 0) goto error;
H5Pclose(create_parms);
- if(H5Dclose(dataset) <0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
return 0;
@@ -353,33 +353,33 @@ test_simple_io(hid_t fapl)
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
/* Initialize the dataset */
- for (i = n = 0; i < DSET_DIM1; i++)
- for (j = 0; j < DSET_DIM2; j++)
+ for(i = n = 0; i < DSET_DIM1; i++)
+ for(j = 0; j < DSET_DIM2; j++)
points[i][j] = n++;
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/* Create the data space */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* Create a small conversion buffer to test strip mining */
tconv_buf = HDmalloc((size_t)1000);
- xfer = H5Pcreate (H5P_DATASET_XFER);
- assert (xfer>=0);
- if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error;
+ xfer = H5Pcreate(H5P_DATASET_XFER);
+ assert(xfer>=0);
+ if(H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Test dataset address. Should be undefined. */
- if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+ if(H5Dget_offset(dataset) != HADDR_UNDEF) goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
@@ -388,13 +388,13 @@ test_simple_io(hid_t fapl)
if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0)
goto error;
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET_DIM1; i++) {
- for (j = 0; j < DSET_DIM2; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i = 0; i < DSET_DIM1; i++) {
+ for(j = 0; j < DSET_DIM2; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -412,9 +412,9 @@ test_simple_io(hid_t fapl)
HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2);
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET_DIM1; i++) {
- for (j = 0; j < DSET_DIM2; j++) {
- if (points[i][j] != rdata[i][j]) {
+ for(i = 0; i < DSET_DIM1; i++) {
+ for(j = 0; j < DSET_DIM2; j++) {
+ if(points[i][j] != rdata[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -468,26 +468,26 @@ test_userblock_offset(hid_t fapl)
if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error;
if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error;
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
goto error;
/* Create the data space */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
* the data position as H5Dget_offset points to, read the dataset, and
* compare it with the data written in.*/
- if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
+ if((offset = H5Dget_offset(dataset)) == HADDR_UNDEF) goto error;
if(H5Dclose(dataset) < 0) goto error;
if(H5Fclose(file) < 0) goto error;
@@ -497,9 +497,9 @@ test_userblock_offset(hid_t fapl)
HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2);
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET_DIM1; i++) {
- for (j = 0; j < DSET_DIM2; j++) {
- if (points[i][j] != rdata[i][j]) {
+ for(i = 0; i < DSET_DIM1; i++) {
+ for(j = 0; j < DSET_DIM2; j++) {
+ if(points[i][j] != rdata[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -570,11 +570,11 @@ test_compact_io(hid_t fapl)
if(H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
/* Create and write to a compact dataset */
- if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Test dataset address. Should be undefined. */
- if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
+ if(H5Dget_offset(dataset) != HADDR_UNDEF) TEST_ERROR
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
TEST_ERROR
@@ -601,7 +601,7 @@ test_compact_io(hid_t fapl)
/* Check that the values read are the same as the values written */
for(i = 0; i < 16; i++)
for(j = 0; j < 8; j++)
- if (rbuf[i][j] != wbuf[i][j]) {
+ if(rbuf[i][j] != wbuf[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -679,7 +679,7 @@ test_max_compact(hid_t fapl)
assert(status >= 0);
/* Create and write to a compact dataset */
- if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, plist)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
goto error;
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
@@ -736,7 +736,7 @@ test_max_compact(hid_t fapl)
/* Create and write to a compact dataset */
H5E_BEGIN_TRY {
- H5Dcreate(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, plist);
+ H5Dcreate2(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT);
} H5E_END_TRY;
/* Close file */
@@ -805,15 +805,15 @@ test_conv_buffer(hid_t fid)
cf = (CmpField *)HDcalloc((size_t)1, sizeof(CmpField));
/* Populate the data members */
- for (j = 0; j < DIM1; j++)
- for (k = 0; k < DIM2; k++)
- for (l = 0; l < DIM3; l++)
+ for(j = 0; j < DIM1; j++)
+ for(k = 0; k < DIM2; k++)
+ for(l = 0; l < DIM3; l++)
cf->a[j][k][l] = 10*(j+1) + l + k;
- for (j = 0; j < DIM2; j++)
+ for(j = 0; j < DIM2; j++)
cf->b[j] = (float)(100.*(j+1) + 0.01*j);
- for (j = 0; j < DIM3; j++)
+ for(j = 0; j < DIM3; j++)
cf->c[j] = 100.*(j+1) + 0.02*j;
@@ -839,7 +839,7 @@ test_conv_buffer(hid_t fid)
if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3) < 0) goto error;
/* Create the dataset */
- if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf) < 0) goto error;
if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR))) < 0) goto error;
@@ -863,7 +863,7 @@ test_conv_buffer(hid_t fid)
H5E_BEGIN_TRY {
status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR);
} H5E_END_TRY;
- if (status >= 0) {
+ if(status >= 0) {
H5_FAILED();
puts(" Library shouldn't allow conversion buffer too small");
goto error;
@@ -932,7 +932,7 @@ test_tconv(hid_t file)
TESTING("data type conversion");
/* Initialize the dataset */
- for (i = 0; i < 1000000; i++) {
+ for(i = 0; i < 1000000; i++) {
out[i*4+0] = 0x11;
out[i*4+1] = 0x22;
out[i*4+2] = 0x33;
@@ -941,23 +941,24 @@ test_tconv(hid_t file)
/* Create the data space */
dims[0] = 1000000;
- if ((space = H5Screate_simple (1, dims, NULL)) < 0) goto error;
+ if((space = H5Screate_simple (1, dims, NULL)) < 0) goto error;
/* Create the data set */
- if ((dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_STD_I32LE, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_TCONV_NAME, H5T_STD_I32LE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- out) < 0) goto error;
+ if(H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, out) < 0)
+ goto error;
/* Read data with byte order conversion */
- if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0)
+ if(H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0)
goto error;
/* Check */
- for (i = 0; i < 1000000; i++) {
- if (in[4*i+0]!=out[4*i+3] ||
+ for(i = 0; i < 1000000; i++) {
+ if(in[4*i+0]!=out[4*i+3] ||
in[4*i+1]!=out[4*i+2] ||
in[4*i+2]!=out[4*i+1] ||
in[4*i+3]!=out[4*i+0]) {
@@ -967,7 +968,7 @@ test_tconv(hid_t file)
}
}
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
free (out);
free (in);
puts(" PASSED");
@@ -1134,7 +1135,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts,
/* Check if this filter is supposed to do something */
if(cd_values[2]>0) {
/* Check whether we are "uncompressing" */
- if (flags & H5Z_FLAG_REVERSE) {
+ if(flags & H5Z_FLAG_REVERSE) {
/* Do nothing */
} /* end if */
/* "Compressing" */
@@ -1199,7 +1200,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts,
unsigned int value;
void *data;
- if (cd_nelmts!=3 || !cd_values)
+ if(cd_nelmts!=3 || !cd_values)
return 0;
offset = cd_values[0];
length = cd_values[1];
@@ -1210,7 +1211,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts,
data = HDmalloc((size_t)length);
HDmemset(data, (int)value, (size_t)length);
- if (flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */
+ if(flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */
dst += offset;
if(HDmemcmp(data, dst, (size_t)length)!=0) return 0;
*buf_size = nbytes;
@@ -1315,18 +1316,18 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
herr_t status; /* Error status */
/* Create the data space */
- if ((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
/*
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
- if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
tconv_buf = HDmalloc((size_t)1000);
- if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error;
- if ((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
+ if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error;
+ if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
- if (if_fletcher32==DISABLE_FLETCHER32) {
+ if(if_fletcher32==DISABLE_FLETCHER32) {
if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC) < 0)
goto error;
if(H5Z_DISABLE_EDC != H5Pget_edc_check(dxpl))
@@ -1343,8 +1344,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
} /* end if */
/* Create the dataset */
- if ((dataset = H5Dcreate(fid, name, H5T_NATIVE_INT, sid,
- dcpl)) < 0) goto error;
+ if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
+ dcpl, H5P_DEFAULT)) < 0) goto error;
+
PASSED();
/*----------------------------------------------------------------------
@@ -1353,12 +1355,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (uninitialized read)");
- if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
goto error;
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (0!=check[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(0!=check[i][j]) {
H5_FAILED();
printf(" Read a non-zero value.\n");
printf(" At index %lu,%lu\n",
@@ -1376,13 +1378,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (write)");
- for (i=n=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
+ for(i=n=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
points[i][j] = (int)(n++);
}
}
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
TEST_ERROR;
if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR;
@@ -1417,13 +1419,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
fprintf(stderr," Read different values than written.\n");
fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -1446,12 +1448,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (modify)");
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]/2; j++) {
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]/2; j++) {
points[i][j] = (int)HDrandom ();
}
}
- if (H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
TEST_ERROR;
if(corrupted) {
@@ -1476,13 +1478,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
} else {
/* Read the dataset back and check it */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n",
@@ -1556,15 +1558,15 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (partial I/O)");
- for (i=0; i<(size_t)hs_size[0]; i++) {
- for (j=0; j<(size_t)hs_size[1]; j++) {
+ for(i=0; i<(size_t)hs_size[0]; i++) {
+ for(j=0; j<(size_t)hs_size[1]; j++) {
points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom();
}
}
- if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
NULL) < 0) TEST_ERROR;
/* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */
- if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
TEST_ERROR;
if(corrupted) {
@@ -1588,13 +1590,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
+ if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)hs_size[0]; i++) {
- for (j=0; j<(size_t)hs_size[1]; j++) {
- if (points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
+ for(i=0; i<(size_t)hs_size[0]; i++) {
+ for(j=0; j<(size_t)hs_size[1]; j++) {
+ if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
H5_FAILED();
fprintf(stderr," Read different values than written.\n");
@@ -1616,9 +1618,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Get the storage size of the dataset */
if((*dset_size=H5Dget_storage_size(dataset))==0) goto error;
/* Clean up objects used for this test */
- if (H5Dclose (dataset) < 0) goto error;
- if (H5Sclose (sid) < 0) goto error;
- if (H5Pclose (dxpl) < 0) goto error;
+ if(H5Dclose (dataset) < 0) goto error;
+ if(H5Sclose (sid) < 0) goto error;
+ if(H5Pclose (dxpl) < 0) goto error;
free (tconv_buf);
return(0);
@@ -1709,10 +1711,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
if(space_id < 0) goto error;
H5E_BEGIN_TRY{
- test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id);
+ test_dset_id = H5Dcreate2(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
}H5E_END_TRY
- if (test_dset_id >= 0) goto error;
+ if(test_dset_id >= 0) goto error;
/* Attempt to extend the dataset. This should fail because
* the dataset has a fill value and is instructed to fill on
@@ -1745,15 +1747,15 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
error:
H5_FAILED();
- if (dset_id != -1)
+ if(dset_id != -1)
H5Dclose(dset_id);
- if (test_dset_id != -1)
+ if(test_dset_id != -1)
H5Dclose(test_dset_id);
- if (space_id != -1)
+ if(space_id != -1)
H5Sclose(space_id);
- if (dcpl_id != -1)
+ if(dcpl_id != -1)
H5Pclose(dcpl_id);
- if (file_id != -1)
+ if(file_id != -1)
H5Fclose(file_id);
return -1;
}
@@ -1827,13 +1829,13 @@ test_get_filter_info(void)
/* Verify that get_filter_info throws an error when given a bad filter */
/* (Depends on 1.6 compatibility flag) */
#ifdef H5_WANT_H5_V1_6_COMPAT
- if (H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR
- if (flags != 0) TEST_ERROR
+ if(H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR
+ if(flags != 0) TEST_ERROR
#else /* H5_WANT_H5_V1_6_COMPAT */
H5E_BEGIN_TRY {
err = H5Zget_filter_info(-1, &flags);
} H5E_END_TRY;
- if (err >= 0) TEST_ERROR
+ if(err >= 0) TEST_ERROR
#endif /* H5_WANT_H5_V1_6_COMPAT */
PASSED();
@@ -1894,7 +1896,7 @@ UNUSED
hsize_t shuffle_size; /* Size of dataset with shuffle filter */
#endif /* H5_HAVE_FILTER_SHUFFLE */
-#if (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
+#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */
#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
@@ -1907,14 +1909,14 @@ UNUSED
*/
puts("Testing 'null' filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Zregister (H5Z_BOGUS) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Zregister (H5Z_BOGUS) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_BOGUS, 0, (size_t)0, NULL) < 0) goto error;
if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
/*----------------------------------------------------------
* STEP 1: Test Fletcher32 Checksum by itself.
@@ -1923,7 +1925,7 @@ UNUSED
#ifdef H5_HAVE_FILTER_FLETCHER32
puts("Testing Fletcher32 checksum(enabled for read)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error;
/* Enable checksum during read */
@@ -1951,7 +1953,7 @@ UNUSED
/* Temporarily disable this test because the changes in chunk caching conflicts with
* the way this test is conducted. -slu 2007/7/20 */
- if (H5Zregister (H5Z_CORRUPT) < 0) goto error;
+ if(H5Zregister (H5Z_CORRUPT) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_CORRUPT, 0, (size_t)3, data_corrupt) < 0) goto error;
if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
@@ -1961,7 +1963,7 @@ UNUSED
} /* end if */
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_FLETCHER32 */
TESTING("fletcher32 checksum");
@@ -1976,12 +1978,12 @@ UNUSED
#ifdef H5_HAVE_FILTER_DEFLATE
puts("Testing deflate filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_deflate (dc, 6) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_deflate (dc, 6) < 0) goto error;
if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_DEFLATE */
TESTING("deflate filter");
SKIPPED();
@@ -1994,21 +1996,21 @@ UNUSED
*/
#ifdef H5_HAVE_FILTER_SZIP
TESTING("szip filter (with encoder)");
- if ( h5_szip_can_encode() == 1) {
+ if( h5_szip_can_encode() == 1) {
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error;
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
} else {
SKIPPED();
}
TESTING("szip filter (without encoder)");
- if ( h5_szip_can_encode() != 1) {
+ if( h5_szip_can_encode() != 1) {
puts("");
if(test_filter_noencoder(NOENCODER_SZIP_DATASET, fapl) < 0) goto error;
} else {
@@ -2028,8 +2030,8 @@ UNUSED
#ifdef H5_HAVE_FILTER_SHUFFLE
puts("Testing shuffle filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error;
if(shuffle_size!=null_size) {
@@ -2039,7 +2041,7 @@ UNUSED
} /* end if */
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_SHUFFLE */
TESTING("shuffle filter");
SKIPPED();
@@ -2053,27 +2055,27 @@ UNUSED
#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
puts("Testing shuffle+deflate+checksum filters(checksum first)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
- if (H5Pset_deflate (dc, 6) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_deflate (dc, 6) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
puts("Testing shuffle+deflate+checksum filters(checksum last)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
- if (H5Pset_deflate (dc, 6) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_deflate (dc, 6) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
TESTING("shuffle+deflate+fletcher32 filters");
SKIPPED();
@@ -2088,14 +2090,14 @@ UNUSED
TESTING("shuffle+szip+checksum filters(checksum first, with encoder)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
/* Make sure encoding is enabled */
- if ( h5_szip_can_encode() == 1) {
+ if( h5_szip_can_encode() == 1) {
puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
} else {
SKIPPED();
@@ -2103,31 +2105,31 @@ UNUSED
TESTING("shuffle+szip+checksum filters(checksum first, without encoder)");
- if ( h5_szip_can_encode() != 1) {
+ if( h5_szip_can_encode() != 1) {
puts("");
- if (test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET,fapl) < 0) goto error;
+ if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET,fapl) < 0) goto error;
} else {
SKIPPED();
}
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
TESTING("shuffle+szip+checksum filters(checksum last, with encoder)");
/* Make sure encoding is enabled */
- if ( h5_szip_can_encode() == 1) {
+ if( h5_szip_can_encode() == 1) {
puts("");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
} else {
SKIPPED();
@@ -2185,7 +2187,7 @@ test_missing_filter(hid_t file)
} /* end if */
/* Unregister deflate filter (use internal function) */
- if (H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) {
+ if(H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) {
H5_FAILED();
printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
@@ -2229,28 +2231,28 @@ test_missing_filter(hid_t file)
} /* end if */
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
+ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
printf(" Line %d: Error flushing file\n",__LINE__);
goto error;
@@ -2272,7 +2274,7 @@ test_missing_filter(hid_t file)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -2280,9 +2282,9 @@ test_missing_filter(hid_t file)
/* Compare data */
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)dims[0]; i++) {
- for (j=0; j<(size_t)dims[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<(size_t)dims[0]; i++) {
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -2342,7 +2344,7 @@ test_missing_filter(hid_t file)
H5E_BEGIN_TRY {
ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check);
} H5E_END_TRY;
- if (ret>=0) {
+ if(ret>=0) {
H5_FAILED();
printf(" Line %d: Should not be able to read dataset data\n", __LINE__);
goto error;
@@ -2429,19 +2431,19 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use shuffling algorithm with 8-bit */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
- for (i= 0;i< 10; i++)
- for (j = 0; j < 20; j++)
+ for(i= 0;i< 10; i++)
+ for(j = 0; j < 20; j++)
orig_data[i][j] = (unsigned char)HDrandom();
PASSED();
@@ -2458,7 +2460,7 @@ test_onebyte_shuffle(hid_t file)
TESTING("8-bit shuffling (write)");
#ifdef H5_HAVE_FILTER_SHUFFLE
- if (H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
@@ -2476,14 +2478,14 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n",
@@ -2497,8 +2499,8 @@ test_onebyte_shuffle(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Pclose (dc) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2562,20 +2564,20 @@ test_nbit_int(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_INT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_INT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of int */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)(precision - 1))) << offset);
@@ -2598,7 +2600,7 @@ test_nbit_int(hid_t file)
TESTING(" nbit int (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -2615,7 +2617,7 @@ test_nbit_int(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
@@ -2623,9 +2625,9 @@ test_nbit_int(hid_t file)
* Use mask for checking the significant bits, ignoring the padding bits
*/
mask = ~(~0 << (precision + offset)) & (~0 << offset);
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if ((new_data[i][j] & mask) != (orig_data[i][j] & mask)) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if((new_data[i][j] & mask) != (orig_data[i][j] & mask)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -2638,11 +2640,11 @@ test_nbit_int(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Tclose(mem_datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Tclose(mem_datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2703,16 +2705,16 @@ test_nbit_float(hid_t file)
if(H5Tset_ebias(datatype, (size_t)31) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_FLOAT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_FLOAT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -2727,7 +2729,7 @@ test_nbit_float(hid_t file)
TESTING(" nbit float (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
@@ -2745,17 +2747,17 @@ test_nbit_float(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
* Assume size of int = size of float
*/
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -2768,10 +2770,10 @@ test_nbit_float(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2836,16 +2838,16 @@ test_nbit_double(hid_t file)
if(H5Tset_ebias(datatype, (size_t)255) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_DOUBLE_NAME, datatype,
- space, dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_DOUBLE_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
PASSED();
#else
@@ -2861,7 +2863,7 @@ test_nbit_double(hid_t file)
TESTING(" nbit double (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -2878,17 +2880,17 @@ test_nbit_double(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
* Assume size of long_long = size of double
*/
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -2901,10 +2903,10 @@ test_nbit_double(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2974,22 +2976,22 @@ test_nbit_array(hid_t file)
mem_array_datatype = H5Tarray_create(mem_base_datatype, 2, adims, NULL);
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_ARRAY_NAME, array_datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_ARRAY_NAME, array_datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of unsigned int */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++)
- for (m = 0; m < (size_t)adims[0]; m++)
- for (n = 0; n < (size_t)adims[1]; n++)
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++)
+ for(m = 0; m < (size_t)adims[0]; m++)
+ for(n = 0; n < (size_t)adims[1]; n++)
orig_data[i][j][m][n] = (unsigned int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)precision)) << offset);
PASSED();
@@ -3006,7 +3008,7 @@ test_nbit_array(hid_t file)
TESTING(" nbit array (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
@@ -3024,17 +3026,17 @@ test_nbit_array(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
*/
- for (i=0; i<(size_t)size[0]; i++)
- for (j=0; j<(size_t)size[1]; j++)
- for (m = 0; m < (size_t)adims[0]; m++)
- for (n = 0; n < (size_t)adims[1]; n++) {
- if (new_data[i][j][m][n]!= orig_data[i][j][m][n]) {
+ for(i=0; i<(size_t)size[0]; i++)
+ for(j=0; j<(size_t)size[1]; j++)
+ for(m = 0; m < (size_t)adims[0]; m++)
+ for(n = 0; n < (size_t)adims[1]; n++) {
+ if(new_data[i][j][m][n]!= orig_data[i][j][m][n]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu,%lu,%lu\n",
@@ -3047,13 +3049,13 @@ test_nbit_array(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(array_datatype) < 0) goto error;
- if (H5Tclose(base_datatype) < 0) goto error;
- if (H5Tclose(mem_array_datatype) < 0) goto error;
- if (H5Tclose(mem_base_datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(array_datatype) < 0) goto error;
+ if(H5Tclose(base_datatype) < 0) goto error;
+ if(H5Tclose(mem_array_datatype) < 0) goto error;
+ if(H5Tclose(mem_base_datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3156,20 +3158,20 @@ test_nbit_compound(hid_t file)
if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of member datatypes */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j].i = (int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]);
orig_data[i][j].c = (char)(((long_long)HDrandom() %
@@ -3199,7 +3201,7 @@ test_nbit_compound(hid_t file)
TESTING(" nbit compound (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -3216,7 +3218,7 @@ test_nbit_compound(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
@@ -3226,9 +3228,9 @@ test_nbit_compound(hid_t file)
i_mask = ~(~0 << (precision[0] + offset[0])) & (~0 << offset[0]);
c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]);
s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]);
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- if ((new_data[i][j].i & i_mask) != (orig_data[i][j].i & i_mask) ||
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
+ if((new_data[i][j].i & i_mask) != (orig_data[i][j].i & i_mask) ||
(new_data[i][j].c & c_mask) != (orig_data[i][j].c & c_mask) ||
(new_data[i][j].s & s_mask) != (orig_data[i][j].s & s_mask) ||
(orig_data[i][j].f==orig_data[i][j].f && new_data[i][j].f != orig_data[i][j].f))
@@ -3245,15 +3247,15 @@ test_nbit_compound(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(i_tid) < 0) goto error;
- if (H5Tclose(c_tid) < 0) goto error;
- if (H5Tclose(s_tid) < 0) goto error;
- if (H5Tclose(f_tid) < 0) goto error;
- if (H5Tclose(cmpd_tid) < 0) goto error;
- if (H5Tclose(mem_cmpd_tid) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(i_tid) < 0) goto error;
+ if(H5Tclose(c_tid) < 0) goto error;
+ if(H5Tclose(s_tid) < 0) goto error;
+ if(H5Tclose(f_tid) < 0) goto error;
+ if(H5Tclose(cmpd_tid) < 0) goto error;
+ if(H5Tclose(mem_cmpd_tid) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3403,20 +3405,20 @@ test_nbit_compound_2(hid_t file)
if(H5Tinsert(cmpd_tid2, "d", HOFFSET(complex, d), array_cmplx_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of member datatypes */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j].a.i = (int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]);
orig_data[i][j].a.c = (char)(((long_long)HDrandom() %
@@ -3459,7 +3461,7 @@ test_nbit_compound_2(hid_t file)
TESTING(" nbit compound complex (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -3476,7 +3478,7 @@ test_nbit_compound_2(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
@@ -3487,8 +3489,8 @@ test_nbit_compound_2(hid_t file)
c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]);
s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]);
b_mask = ~(~0 << (precision[4] + offset[4])) & (~0 << offset[4]);
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
b_failed = 0;
d_failed = 0;
@@ -3529,22 +3531,22 @@ test_nbit_compound_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(i_tid) < 0) goto error;
- if (H5Tclose(c_tid) < 0) goto error;
- if (H5Tclose(s_tid) < 0) goto error;
- if (H5Tclose(f_tid) < 0) goto error;
- if (H5Tclose(v_tid) < 0) goto error;
- if (H5Tclose(cmpd_tid2) < 0) goto error;
- if (H5Tclose(cmpd_tid1) < 0) goto error;
- if (H5Tclose(mem_cmpd_tid2) < 0) goto error;
- if (H5Tclose(mem_cmpd_tid1) < 0) goto error;
- if (H5Tclose(array_tid) < 0) goto error;
- if (H5Tclose(base_tid) < 0) goto error;
- if (H5Tclose(array_cmplx_tid) < 0) goto error;
- if (H5Tclose(mem_array_cmplx_tid) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(i_tid) < 0) goto error;
+ if(H5Tclose(c_tid) < 0) goto error;
+ if(H5Tclose(s_tid) < 0) goto error;
+ if(H5Tclose(f_tid) < 0) goto error;
+ if(H5Tclose(v_tid) < 0) goto error;
+ if(H5Tclose(cmpd_tid2) < 0) goto error;
+ if(H5Tclose(cmpd_tid1) < 0) goto error;
+ if(H5Tclose(mem_cmpd_tid2) < 0) goto error;
+ if(H5Tclose(mem_cmpd_tid1) < 0) goto error;
+ if(H5Tclose(array_tid) < 0) goto error;
+ if(H5Tclose(base_tid) < 0) goto error;
+ if(H5Tclose(array_cmplx_tid) < 0) goto error;
+ if(H5Tclose(mem_array_cmplx_tid) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3627,20 +3629,20 @@ test_nbit_compound_3(hid_t file)
if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(1, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(1, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 1, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 1, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid,
- space, dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the dataset object reference points to */
- if ((obj_ref_dataset = H5Dcreate(file, "nbit_obj_ref", H5T_NATIVE_INT,
- space, H5P_DEFAULT)) < 0) goto error;
+ if((obj_ref_dataset = H5Dcreate2(file, "nbit_obj_ref", H5T_NATIVE_INT,
+ space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
for(i = 0; i < (size_t)size[0]; i++) {
@@ -3672,7 +3674,7 @@ test_nbit_compound_3(hid_t file)
TESTING(" nbit compound with no-op type (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -3689,12 +3691,12 @@ test_nbit_compound_3(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
- for (i = 0; i < (size_t)size[0]; i++) {
+ for(i = 0; i < (size_t)size[0]; i++) {
if(new_data[i].i != orig_data[i].i ||
strcmp(new_data[i].str, orig_data[i].str) !=0 ||
strcmp(new_data[i].vl_str, orig_data[i].vl_str) !=0 ||
@@ -3730,18 +3732,18 @@ test_nbit_compound_3(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
- if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
- if (H5Tclose(i_tid) < 0) goto error;
- if (H5Tclose(str_tid) < 0) goto error;
- if (H5Tclose(vl_str_tid) < 0) goto error;
- if (H5Tclose(v_tid) < 0) goto error;
- if (H5Tclose(o_tid) < 0) goto error;
- if (H5Tclose(cmpd_tid) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(obj_ref_dataset) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
+ if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
+ if(H5Tclose(i_tid) < 0) goto error;
+ if(H5Tclose(str_tid) < 0) goto error;
+ if(H5Tclose(vl_str_tid) < 0) goto error;
+ if(H5Tclose(v_tid) < 0) goto error;
+ if(H5Tclose(o_tid) < 0) goto error;
+ if(H5Tclose(cmpd_tid) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(obj_ref_dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3795,25 +3797,25 @@ test_scaleoffset_int(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
+ if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, let library calculate minbits */
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_INT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = HDrandom() % 10000;
/* even-numbered values are negtive */
@@ -3835,7 +3837,7 @@ test_scaleoffset_int(hid_t file)
TESTING(" scaleoffset int without fill value (write)");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -3851,13 +3853,13 @@ test_scaleoffset_int(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -3870,10 +3872,10 @@ test_scaleoffset_int(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3930,25 +3932,25 @@ test_scaleoffset_int_2(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000;
- if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error;
+ if(H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, let library calculate minbits */
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME_2, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_INT_NAME_2, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -3961,7 +3963,7 @@ test_scaleoffset_int_2(hid_t file)
stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (int)HDrandom() % 10000;
/* even-numbered values are negtive */
@@ -3984,7 +3986,7 @@ test_scaleoffset_int_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4000,12 +4002,12 @@ test_scaleoffset_int_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (j=0; j<(size_t)size[1]; j++) {
- if (new_data[0][j] != orig_data[0][j]) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[0][j] != orig_data[0][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -4017,10 +4019,10 @@ test_scaleoffset_int_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4072,27 +4074,27 @@ test_scaleoffset_float(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
+ if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 3,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (float)((HDrandom() % 100000) / (float)1000.0);
/* even-numbered values are negtive */
@@ -4114,7 +4116,7 @@ test_scaleoffset_float(hid_t file)
TESTING(" scaleoffset float without fill value, D-scaling (write)");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4130,13 +4132,13 @@ test_scaleoffset_float(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -3.0)) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -3.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -4149,10 +4151,10 @@ test_scaleoffset_float(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4209,27 +4211,27 @@ test_scaleoffset_float_2(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000.0;
- if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error;
+ if(H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 3,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -4242,7 +4244,7 @@ test_scaleoffset_float_2(hid_t file)
stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (float)((HDrandom() % 100000) / (float)1000.0);
/* even-numbered values are negtive */
@@ -4265,7 +4267,7 @@ test_scaleoffset_float_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
- if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4281,12 +4283,12 @@ test_scaleoffset_float_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -4297,10 +4299,10 @@ test_scaleoffset_float_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4352,27 +4354,27 @@ test_scaleoffset_double(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
+ if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 7,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0;
/* even-numbered values are negtive */
@@ -4394,7 +4396,7 @@ test_scaleoffset_double(hid_t file)
TESTING(" scaleoffset double without fill value, D-scaling (write)");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4410,13 +4412,13 @@ test_scaleoffset_double(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -4429,10 +4431,10 @@ test_scaleoffset_double(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4489,27 +4491,27 @@ test_scaleoffset_double_2(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000.0;
- if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error;
+ if(H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 7,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -4522,7 +4524,7 @@ test_scaleoffset_double_2(hid_t file)
stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0;
/* even-numbered values are negtive */
@@ -4545,7 +4547,7 @@ test_scaleoffset_double_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
- if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4561,12 +4563,12 @@ test_scaleoffset_double_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -4578,10 +4580,10 @@ test_scaleoffset_double_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4627,7 +4629,7 @@ test_multiopen (hid_t file)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk(dcpl, 1, cur_size) < 0) goto error;
if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
- if((dset1 = H5Dcreate(file, "multiopen", H5T_NATIVE_INT, space, dcpl)) < 0) goto error;
+ if((dset1 = H5Dcreate2(file, "multiopen", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if((dset2 = H5Dopen2(dset1, ".", H5P_DEFAULT)) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
@@ -4692,61 +4694,61 @@ test_types(hid_t file)
/* bitfield_1 */
nelmts = sizeof(buf);
- if ((type=H5Tcopy(H5T_STD_B8LE)) < 0 ||
+ if((type=H5Tcopy(H5T_STD_B8LE)) < 0 ||
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT)) < 0)
+ (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* bitfield_2 */
nelmts = sizeof(buf)/2;
- if ((type=H5Tcopy(H5T_STD_B16LE)) < 0 ||
+ if((type=H5Tcopy(H5T_STD_B16LE)) < 0 ||
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT)) < 0)
+ (dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* opaque_1 */
nelmts = sizeof(buf);
if((type = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0 ||
H5Tset_tag(type, "testing 1-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset = H5Dcreate(grp, "opaque_1", type, space, H5P_DEFAULT)) < 0)
+ (dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* opaque_2 */
nelmts = sizeof(buf)/4;
if((type = H5Tcreate(H5T_OPAQUE, (size_t)4)) < 0 ||
H5Tset_tag(type, "testing 4-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset = H5Dcreate(grp, "opaque_2", type, space, H5P_DEFAULT)) < 0)
+ (dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* Cleanup */
- if (H5Gclose(grp) < 0) goto error;
+ if(H5Gclose(grp) < 0) goto error;
PASSED();
return 0;
@@ -4822,7 +4824,7 @@ test_can_apply(hid_t file)
}
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -4831,9 +4833,9 @@ test_can_apply(hid_t file)
/* Create new dataset */
/* (Should fail because the 'can apply' filter should indicate inappropriate combination) */
H5E_BEGIN_TRY {
- dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_DOUBLE, sid, dcpl);
+ dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dsid >=0) {
+ if(dsid >=0) {
H5_FAILED();
printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
@@ -4841,21 +4843,21 @@ test_can_apply(hid_t file)
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
+ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
printf(" Line %d: Error flushing file\n",__LINE__);
goto error;
@@ -4876,7 +4878,7 @@ test_can_apply(hid_t file)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -4884,9 +4886,9 @@ test_can_apply(hid_t file)
/* Compare data */
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)dims[0]; i++) {
- for (j=0; j<(size_t)dims[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<(size_t)dims[0]; i++) {
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -4965,9 +4967,9 @@ file)
#ifdef H5_HAVE_FILTER_SZIP
- if (h5_szip_can_encode() == 1) {
+ if(h5_szip_can_encode() == 1) {
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -5019,9 +5021,9 @@ file)
/* (Should succeed; according to the new algorithm, scanline should be reset
to 2*128 satisfying 'maximum blocks per scanline' condition) */
H5E_BEGIN_TRY {
- dsid = H5Dcreate(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, dcpl);
+ dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dsid <=0) {
+ if(dsid <=0) {
H5_FAILED();
printf(" Line %d: Should have created dataset!\n",__LINE__);
goto error;
@@ -5049,7 +5051,7 @@ file)
} /* end if */
/* Create another data space */
- if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims2, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -5078,9 +5080,9 @@ file)
/* Create new dataset */
/* (Should fail because the 'can apply' filter should indicate inappropriate combination) */
H5E_BEGIN_TRY {
- dsid = H5Dcreate(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, dcpl);
+ dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dsid >=0) {
+ if(dsid >=0) {
H5_FAILED();
printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
@@ -5166,14 +5168,14 @@ test_set_local(hid_t fapl)
/* Initialize the integer & floating-point dataset */
n=1.0;
- for (i = 0; i < DSET_DIM1; i++)
- for (j = 0; j < DSET_DIM2; j++) {
+ for(i = 0; i < DSET_DIM1; i++)
+ for(j = 0; j < DSET_DIM2; j++) {
points[i][j] = (int)n++;
points_dbl[i][j] = (double)1.5*n++;
}
/* Open file */
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open file\n",__LINE__);
goto error;
@@ -5202,21 +5204,21 @@ test_set_local(hid_t fapl)
}
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
@@ -5231,14 +5233,14 @@ test_set_local(hid_t fapl)
/* Create new dataset */
/* (Shouldn't get modified by output filter) */
- if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
@@ -5309,9 +5311,9 @@ test_set_local(hid_t fapl)
/* Compare data */
/* Check that the values read are the modified version of what was written */
- for (i=0; i<dims[0]; i++) {
- for (j=0; j<dims[1]; j++) {
- if ((points[i][j]+(int)sizeof(int)) != check[i][j]) {
+ for(i=0; i<dims[0]; i++) {
+ for(j=0; j<dims[1]; j++) {
+ if((points[i][j]+(int)sizeof(int)) != check[i][j]) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -5359,8 +5361,8 @@ test_set_local(hid_t fapl)
/* Compare data */
/* Check that the values read are the modified version of what was written */
- for (i=0; i<dims[0]; i++) {
- for (j=0; j<dims[1]; j++) {
+ for(i=0; i<dims[0]; i++) {
+ for(j=0; j<dims[1]; j++) {
/* If the difference between two values is greater than 0.001%, they're
* considered not equal. */
if(!DBL_REL_EQUAL(points_dbl[i][j],check_dbl[i][j],0.00001)) {
@@ -5382,7 +5384,7 @@ test_set_local(hid_t fapl)
} /* end if */
/* Close file */
- if (H5Fclose(file) < 0) {
+ if(H5Fclose(file) < 0) {
H5_FAILED();
printf(" Line %d: Can't close file\n",__LINE__);
goto error;
@@ -5425,7 +5427,7 @@ test_compare_dcpl(hid_t file)
TESTING("comparing dataset creation property lists");
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
@@ -5437,19 +5439,19 @@ test_compare_dcpl(hid_t file)
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Create first dataset */
- if ((dsid = H5Dcreate(file, DSET_COMPARE_DCPL_NAME, H5T_NATIVE_INT, sid, dcpl)) <0) TEST_ERROR
+ if((dsid = H5Dcreate2(file, DSET_COMPARE_DCPL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get copy of dataset's dataset creation property list */
- if ((dcpl1=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
+ if((dcpl1=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
/* Close dataset */
if(H5Dclose (dsid) < 0) TEST_ERROR
/* Create second dataset */
- if ((dsid = H5Dcreate(file, DSET_COMPARE_DCPL_NAME_2, H5T_NATIVE_INT, sid, dcpl)) <0) TEST_ERROR
+ if((dsid = H5Dcreate2(file, DSET_COMPARE_DCPL_NAME_2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get copy of dataset's dataset creation property list */
- if ((dcpl2=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
+ if((dcpl2=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
/* Close dataset */
if(H5Dclose (dsid) < 0) TEST_ERROR
@@ -5515,40 +5517,40 @@ test_filter_delete(hid_t file)
#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
/* create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl) < 0) goto error;
- if (H5Pset_deflate (dcpl, 6) < 0) goto error;
- if (H5Pset_shuffle (dcpl) < 0) goto error;
+ if(H5Pset_fletcher32 (dcpl) < 0) goto error;
+ if(H5Pset_deflate (dcpl, 6) < 0) goto error;
+ if(H5Pset_shuffle (dcpl) < 0) goto error;
/* create a dataset */
- if ((dsid = H5Dcreate(file,"dsetdel", H5T_NATIVE_INT, sid, dcpl)) <0) goto error;
+ if((dsid = H5Dcreate2(file,"dsetdel", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
/* get copy of dataset's dataset creation property list */
- if ((dcpl1=H5Dget_create_plist(dsid)) < 0) goto error;
+ if((dcpl1=H5Dget_create_plist(dsid)) < 0) goto error;
/*----------------------------------------------------------------------
* delete the deflate filter
*----------------------------------------------------------------------
*/
/* delete the deflate filter */
- if (H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE) < 0) goto error;
+ if(H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE) < 0) goto error;
/* get information about filters */
- if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
+ if((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
/* check if filter was deleted */
- for (i=0; i<nfilters; i++) {
+ for(i=0; i<nfilters; i++) {
#ifdef H5_WANT_H5_V1_6_COMPAT
filtn = H5Pget_filter(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL);
#else
filtn = H5Pget_filter(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL, NULL);
#endif
- if (H5Z_FILTER_DEFLATE==filtn)
+ if(H5Z_FILTER_DEFLATE==filtn)
goto error;
}
@@ -5556,7 +5558,7 @@ test_filter_delete(hid_t file)
H5E_BEGIN_TRY {
ret=H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE);
} H5E_END_TRY;
- if (ret >=0) {
+ if(ret >=0) {
H5_FAILED();
printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
goto error;
@@ -5567,13 +5569,13 @@ test_filter_delete(hid_t file)
*----------------------------------------------------------------------
*/
/* delete all filters */
- if (H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error;
+ if(H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error;
/* get information about filters */
- if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
+ if((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
/* check if filters were deleted */
- if (nfilters)goto error;
+ if(nfilters)goto error;
/*----------------------------------------------------------------------
* close
@@ -5581,10 +5583,10 @@ test_filter_delete(hid_t file)
*/
/* clean up objects used for this test */
- if (H5Pclose (dcpl) < 0) goto error;
- if (H5Pclose (dcpl1) < 0) goto error;
- if (H5Dclose (dsid) < 0) goto error;
- if (H5Sclose (sid) < 0) goto error;
+ if(H5Pclose (dcpl) < 0) goto error;
+ if(H5Pclose (dcpl1) < 0) goto error;
+ if(H5Dclose (dsid) < 0) goto error;
+ if(H5Sclose (sid) < 0) goto error;
PASSED();
#else
@@ -5683,7 +5685,7 @@ error:
H5Dclose(dset_id);
H5Tclose(ftype_id);
H5Tclose(mtype_id);
- if (buf)
+ if(buf)
free(buf);
} H5E_END_TRY;
return -1;
@@ -5718,7 +5720,7 @@ test_filters_endianess(hid_t fapl)
char *srcdir = getenv("srcdir"); /* the source directory */
char data_file[512]=""; /* buffer to hold name of existing file */
- for (i=0; i<2; i++){
+ for(i=0; i<2; i++){
buf[i]=1;
}
@@ -5733,25 +5735,25 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fcreate("test_filters.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
/* create a data space */
- if ((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error;
/* create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk(dcpl,rank,chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl) < 0) goto error;
+ if(H5Pset_fletcher32 (dcpl) < 0) goto error;
/* create a dataset */
- if ((dsid = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,dcpl)) <0) goto error;
+ if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto error;
/* close */
- if (H5Pclose (dcpl) < 0) goto error;
- if (H5Dclose (dsid) < 0) goto error;
- if (H5Sclose (sid) < 0) goto error;
- if (H5Fclose (fid) < 0) goto error;
+ if(H5Pclose (dcpl) < 0) goto error;
+ if(H5Dclose (dsid) < 0) goto error;
+ if(H5Sclose (sid) < 0) goto error;
+ if(H5Fclose (fid) < 0) goto error;
/*-------------------------------------------------------------------------
* step 2: open a file written on a little-endian machine in step 1
@@ -5760,7 +5762,7 @@ test_filters_endianess(hid_t fapl)
/* compose the name of the file to open, using the srcdir, if appropriate */
HDstrcpy(data_file, "");
- if ( srcdir ) {
+ if( srcdir ) {
HDstrcpy(data_file, srcdir);
HDstrcat(data_file, "/");
}
@@ -5770,10 +5772,10 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error;
/* read */
- if (auxread_fdata(fid,"dset") < 0) goto error;
+ if(auxread_fdata(fid,"dset") < 0) goto error;
/* close */
- if (H5Fclose(fid) < 0) goto error;
+ if(H5Fclose(fid) < 0) goto error;
/*-------------------------------------------------------------------------
* step 3: open a file written on a big-endian machine in step 1
@@ -5782,7 +5784,7 @@ test_filters_endianess(hid_t fapl)
/* compose the name of the file to open, using the srcdir, if appropriate */
HDstrcpy(data_file, "");
- if ( srcdir ) {
+ if( srcdir ) {
HDstrcpy(data_file, srcdir);
HDstrcat(data_file, "/");
}
@@ -5792,10 +5794,10 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error;
/* read */
- if (auxread_fdata(fid,"dset") < 0) goto error;
+ if(auxread_fdata(fid,"dset") < 0) goto error;
/* close */
- if (H5Fclose(fid) < 0) goto error;
+ if(H5Fclose(fid) < 0) goto error;
PASSED();
#else
@@ -5840,7 +5842,7 @@ test_zero_dims(hid_t file)
if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) TEST_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
if(H5Pset_chunk(dcpl, 1, &csize) < 0) TEST_ERROR;
- if((d = H5Dcreate(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) TEST_ERROR;
@@ -5912,14 +5914,14 @@ test_missing_chunk(hid_t file)
if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, NULL) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Select elements in every other chunk */
hs_start[0]=0;
hs_stride[0]=10;
hs_count[0]=10;
hs_block[0]=5;
- if (H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count,
+ if(H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count,
hs_block) < 0) TEST_ERROR;
/* Write selected data */
@@ -6000,7 +6002,7 @@ test_random_chunks(void)
assert(NPOINTS < 100);
/* Create file for first test */
- if ((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create dataspace */
if((s = H5Screate_simple(2, dsize, NULL)) < 0) TEST_ERROR;
@@ -6012,18 +6014,18 @@ test_random_chunks(void)
if(H5Pset_chunk(dcpl, 2, csize) < 0) TEST_ERROR;
/* Set early allocation time */
- if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Initialization of check array for repeated coordinates */
- for (i=0; i<dsize[0]/csize[0]; i++)
- for (j=0; j<dsize[1]/csize[1]; j++)
+ for(i=0; i<dsize[0]/csize[0]; i++)
+ for(j=0; j<dsize[1]/csize[1]; j++)
check2[i][j] = 0;
/* Generate random point coordinates. Only one point is selected per chunk */
- for (i=0; i<NPOINTS; i++){
+ for(i=0; i<NPOINTS; i++){
do {
chunk_row = (int)HDrandom () % (dsize[0]/csize[0]);
chunk_col = (int)HDrandom () % (dsize[1]/csize[1]);
@@ -6101,7 +6103,7 @@ test_random_chunks(void)
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Extend both dimensions of the dataset */
if(H5Dset_extent(d, nsize) < 0) TEST_ERROR;
@@ -6231,7 +6233,7 @@ test_deprec(hid_t file)
* Create a dataset using the default dataset creation properties. We're
* not sure what they are, so we won't check.
*/
- if(( dataset = H5Dcreate(file, DSET_DEPREC_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT)) < 0) goto error;
/* Close the dataset */
if(H5Dclose(dataset) < 0) goto error;
@@ -6242,7 +6244,7 @@ test_deprec(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
@@ -6285,7 +6287,7 @@ test_deprec(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space,
+ dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space,
create_parms);
} H5E_END_TRY;
if(dataset >= 0) {
@@ -6299,13 +6301,13 @@ test_deprec(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
- if((dataset = H5Dcreate(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error;
+ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error;
H5Pclose(create_parms);
/*
* Close the chunked dataset.
*/
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
/*
@@ -6325,7 +6327,7 @@ test_deprec(hid_t file)
status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY);
assert(status >= 0);
- if(( dataset = H5Dcreate(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) goto error;
+ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) goto error;
H5Pclose(create_parms);
if(H5Dclose(dataset) < 0) goto error;