diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
commit | d9e5ca72f39934531b534524d07cf784c3d0e613 (patch) | |
tree | 1913b13a317132523091035f1175b2291c8b9db7 /test | |
parent | 053807fa81579e6bd9ac6a701ddcaac39e4d0b87 (diff) | |
download | hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.zip hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.gz hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.bz2 |
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test')
61 files changed, 1855 insertions, 1857 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 8ced149..1406df3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -59,9 +59,9 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat testmeta # --enable-build-all at configure time. # The gen_old_* files can only be compiled with older versions of the library # so do not appear in this list. -BUILD_ALL_PROGS=gen_bogus gen_deflate gen_filters gen_new_array gen_new_fill \ - gen_new_group gen_new_mtime gen_new_super gen_noencoder \ - gen_nullspace space_overflow gen_cross gen_udlinks +BUILD_ALL_PROGS=gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ + gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ + gen_nullspace gen_udlinks space_overflow if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) @@ -295,16 +295,16 @@ writer (char* filename, hid_t fapl, int wrt_n) * We should create a dataset allocating space late and never writing fill values. * EIP 4/8/03 - if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0 || - (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0) { + if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 || + (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { goto error; } */ dcpl = H5Pcreate(H5P_DATASET_CREATE); H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, dcpl)) < 0 || - (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, dcpl)) < 0) { + if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 || + (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { goto error; } diff --git a/test/cache_api.c b/test/cache_api.c index 1b9a37e..a1da62f 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1578,13 +1578,13 @@ mdc_api_call_smoke_check(void) if ( pass ) { sprintf(dset_name, "/dset%03d", i); - dataset_ids[i] = H5Dcreate(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, properties); + dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, + dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { pass = FALSE; - failure_mssg = "H5Dcreate() failed."; + failure_mssg = "H5Dcreate2() failed."; } } diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 223537d..85c2318 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -229,26 +229,25 @@ test_compound (char *filename, hid_t fapl) } /* Create the memory data type */ - if ((s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t))) < 0) + if((s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) goto error; array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL); - if (H5Tinsert (s1_tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0 || - H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0 || - H5Tinsert (s1_tid, "c", HOFFSET(s1_t,c), array_dt) < 0 || - H5Tinsert (s1_tid, "d", HOFFSET(s1_t,d), H5T_NATIVE_INT) < 0 || - H5Tinsert (s1_tid, "e", HOFFSET(s1_t,e), H5T_NATIVE_INT) < 0) + if(H5Tinsert(s1_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || + H5Tinsert(s1_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || + H5Tinsert(s1_tid, "c", HOFFSET(s1_t, c), array_dt) < 0 || + H5Tinsert(s1_tid, "d", HOFFSET(s1_t, d), H5T_NATIVE_INT) < 0 || + H5Tinsert(s1_tid, "e", HOFFSET(s1_t, e), H5T_NATIVE_INT) < 0) goto error; H5Tclose(array_dt); /* Create the dataset */ - if ((dataset = H5Dcreate (file, "s1", s1_tid, space, H5P_DEFAULT)) < 0) { + if((dataset = H5Dcreate2(file, "s1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - } /* Write the data */ - if (H5Dwrite (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) { + if(H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) goto error; - } + PASSED(); /* @@ -1387,7 +1386,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) TESTING("writing data to contiguous and chunked datasets"); /* Create contiguous data set */ - if((dataset = H5Dcreate(file, DSET_NAME[0], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[0], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1402,7 +1401,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl) goto error; /* Create chunked data set */ - if((dataset = H5Dcreate(file, DSET_NAME[1], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[1], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1591,7 +1590,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) TESTING("writing data to contiguous and chunked datasets"); /* Create contiguous data set */ - if((dataset = H5Dcreate(file, DSET_NAME[2], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[2], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1606,7 +1605,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) goto error; /* Create chunked data set */ - if((dataset = H5Dcreate(file, DSET_NAME[3], src_tid, space, dcpl)) < 0) + if((dataset = H5Dcreate2(file, DSET_NAME[3], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ diff --git a/test/dangle.c b/test/dangle.c index 834d659..039c405 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -67,21 +67,21 @@ test_dangle_dataset(H5F_close_degree_t degree) TEST_ERROR; /* Create file access property list */ - if((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set file close degree */ - if(H5Pset_fclose_degree(fapl,degree) < 0) + if(H5Pset_fclose_degree(fapl, degree) < 0) TEST_ERROR; h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename); - if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; - if((sid = H5Screate (H5S_SCALAR)) < 0) + if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; - if((dsid = H5Dcreate (fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; if(H5Dclose(dsid) < 0) @@ -89,7 +89,7 @@ test_dangle_dataset(H5F_close_degree_t degree) /* Try creating duplicate dataset */ H5E_BEGIN_TRY { - if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) >= 0) + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) TEST_ERROR; } H5E_END_TRY; @@ -370,7 +370,7 @@ test_dangle_datatype2(H5F_close_degree_t degree) /* Create a dataset that uses the named datatype & leave it open */ if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; - if((did = H5Dcreate(fid, DSETNAME, tid, sid, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; if(H5Sclose(sid) < 0) TEST_ERROR; @@ -452,7 +452,7 @@ test_dangle_attribute(H5F_close_degree_t degree) if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; - if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create an attribute on the dataset */ 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; diff --git a/test/dtransform.c b/test/dtransform.c index 3b53aed..b1bca24 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -107,28 +107,28 @@ const int transformData[ROWS][COLS] = hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset; \ hsize_t dim[2] = {ROWS, COLS}; \ \ - if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; \ - if((dset = H5Dcreate(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT))<0) TEST_ERROR; \ + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ + if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \ \ if(SIGNED) \ { \ - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; \ - if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; \ + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ + if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ } \ else \ { \ - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; \ - if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; \ + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ + if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ } \ \ \ TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \ \ - if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ @@ -138,15 +138,15 @@ const int transformData[ROWS][COLS] = { \ TESTING("contiguous, with type conversion (float->"TEST_STR")") \ \ - if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ UCOMPARE(TYPE, array, COMPARE_DATA, 4) \ } \ \ - if(H5Dclose(dset)<0) TEST_ERROR; \ - if(H5Sclose(dataspace)<0) TEST_ERROR; \ + if(H5Dclose(dset) < 0) TEST_ERROR; \ + if(H5Sclose(dataspace) < 0) TEST_ERROR; \ } #define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ @@ -161,35 +161,35 @@ const int transformData[ROWS][COLS] = hsize_t offset[2] = {0, 0}; \ \ \ - if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; \ + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \ \ cparms = H5Pcreate(H5P_DATASET_CREATE); \ if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \ \ - if((dset_chunk = H5Dcreate(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, cparms))<0) TEST_ERROR; \ + if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \ filespace = H5Dget_space (dset_chunk); \ memspace = H5Screate_simple(2, dim, NULL); \ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \ \ if(SIGNED) \ { \ - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; \ - if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; \ + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \ } \ else \ { \ - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \ - if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; \ - if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData)<0) TEST_ERROR; \ - if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; \ + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \ + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \ + if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \ + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \ } \ \ \ TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \ \ - if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ @@ -199,7 +199,7 @@ const int transformData[ROWS][COLS] = { \ TESTING("chunked, with type conversion (float->"TEST_STR")") \ \ - if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array)<0) TEST_ERROR; \ + if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \ if(SIGNED) \ COMPARE(TYPE, array, COMPARE_DATA, 2) \ else \ @@ -207,15 +207,15 @@ const int transformData[ROWS][COLS] = } \ \ \ - if(H5Pclose(cparms)<0) TEST_ERROR; \ - if(H5Dclose(dset_chunk)<0) TEST_ERROR; \ - if(H5Sclose(dataspace)<0) TEST_ERROR; \ - if(H5Sclose(memspace)<0) TEST_ERROR; \ + if(H5Pclose(cparms) < 0) TEST_ERROR; \ + if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \ + if(H5Sclose(dataspace) < 0) TEST_ERROR; \ + if(H5Sclose(memspace) < 0) TEST_ERROR; \ } #define INVALID_SET_TEST(TRANSFORM) \ { \ - if(H5Pset_data_transform(dxpl_id, TRANSFORM)<0) \ + if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \ { \ PASSED(); \ } \ @@ -237,16 +237,16 @@ int main(void) /* inverses the utrans transform in init_test to get back original array */ const char* utrans_inv = "(x/3)*4 - 100"; - if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR; - - if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_utrans_inv = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_polynomial = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_c_to_f, c_to_f)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_polynomial, polynomial)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_simple, simple)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv)<0) TEST_ERROR; + if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + + if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_utrans_inv = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_polynomial = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_c_to_f, c_to_f) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_polynomial, polynomial) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_simple, simple) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv) < 0) TEST_ERROR; if((dxpl_id_polynomial_copy = H5Pcopy(dxpl_id_polynomial)) < 0) TEST_ERROR; if((dxpl_id_c_to_f_copy = H5Pcopy(dxpl_id_c_to_f)) < 0) TEST_ERROR; @@ -317,17 +317,17 @@ int main(void) if(test_getset(dxpl_id_c_to_f) < 0) TEST_ERROR; /* Close the objects we opened/created */ - if(H5Dclose(dset_id_int)<0) TEST_ERROR; - if(H5Dclose(dset_id_int_chunk)<0) TEST_ERROR; - if(H5Dclose(dset_id_float)<0) TEST_ERROR; - if(H5Dclose(dset_id_float_chunk)<0) TEST_ERROR; - if(H5Fclose(file_id)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_c_to_f)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_c_to_f_copy)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_polynomial)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_polynomial_copy)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_simple)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_utrans_inv)<0) TEST_ERROR; + if(H5Dclose(dset_id_int) < 0) TEST_ERROR; + if(H5Dclose(dset_id_int_chunk) < 0) TEST_ERROR; + if(H5Dclose(dset_id_float) < 0) TEST_ERROR; + if(H5Dclose(dset_id_float_chunk) < 0) TEST_ERROR; + if(H5Fclose(file_id) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_c_to_f) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_c_to_f_copy) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_polynomial) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_polynomial_copy) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_simple) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_utrans_inv) < 0) TEST_ERROR; return 0; @@ -346,43 +346,43 @@ int init_test(hid_t file_id) hsize_t dim[2] = {ROWS, COLS}; hsize_t offset[2] = {0, 0}; - if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; + if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; + if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; - if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; cparms = H5Pcreate(H5P_DATASET_CREATE); - if(H5Pset_chunk(cparms, 2, dim)<0) TEST_ERROR; + if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; - if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; + if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; TESTING("Intializing test...") - if((dset_id_int = H5Dcreate(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT))<0) TEST_ERROR; - if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_int = H5Dcreate2(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; - if((dset_id_float = H5Dcreate(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT))<0) TEST_ERROR; - if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_float = H5Dcreate2(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; - if((dset_id_int_chunk = H5Dcreate(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, cparms))<0) TEST_ERROR; + if((dset_id_int_chunk = H5Dcreate2(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; filespace = H5Dget_space (dset_id_int_chunk); if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; - if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; - if((dset_id_float_chunk = H5Dcreate(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, cparms))<0) TEST_ERROR; - if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_float_chunk = H5Dcreate2(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; + if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; PASSED(); - if(H5Pclose(cparms)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; - if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; - if(H5Sclose(dataspace)<0) TEST_ERROR; + if(H5Pclose(cparms) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; + if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; + if(H5Sclose(dataspace) < 0) TEST_ERROR; return 0; error: @@ -407,7 +407,7 @@ int test_poly(const hid_t dxpl_id_polynomial) } TESTING("data transform, polynomial transform (int->float)") - if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread)<0) TEST_ERROR; + if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread) < 0) TEST_ERROR; COMPARE(float, polyflread, polyflres, 2.0) @@ -421,7 +421,7 @@ int test_poly(const hid_t dxpl_id_polynomial) } TESTING("data transform, polynomial transform (float->int)") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread) < 0) TEST_ERROR; COMPARE(int, polyintread, polyflres, 4) return 0; @@ -449,11 +449,11 @@ int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_co TESTING("data transform, linear transform w/ copied property") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread) < 0) TEST_ERROR; COMPARE(int, windchillFintread, windchillFfloat, 2) TESTING("data transform, polynomial transform w/ copied property") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread) < 0) TEST_ERROR; COMPARE(int, polyintread, polyflres, 2) return 0; @@ -469,7 +469,7 @@ int test_trivial(const hid_t dxpl_id_simple) int row, col; TESTING("data transform, trivial transform, without type conversion") - if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread) < 0) TEST_ERROR; for(row = 0; row<ROWS; row++) { for(col = 0; col<COLS; col++) @@ -485,7 +485,7 @@ int test_trivial(const hid_t dxpl_id_simple) PASSED(); TESTING("data transform, trivial transform, with type conversion") - if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread) < 0) TEST_ERROR; for(row = 0; row<ROWS; row++) { for(col = 0; col<COLS; col++) @@ -525,10 +525,10 @@ int test_getset(const hid_t dxpl_id_c_to_f) PASSED(); free(ptrgetTest); - if(H5Pset_data_transform(dxpl_id_c_to_f, simple)<0) TEST_ERROR; + if(H5Pset_data_transform(dxpl_id_c_to_f, simple) < 0) TEST_ERROR; TESTING("data transform, read after reseting of transform property") - if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread)<0) TEST_ERROR; + if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread) < 0) TEST_ERROR; for(row = 0; row<ROWS; row++) { for(col = 0; col<COLS; col++) @@ -573,7 +573,7 @@ int test_set(void) const char* str = "(9/5.0)*x + 32"; char* ptrgetTest = malloc(strlen(str)+1); - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; /* Test get before set */ H5Eget_auto2(H5E_DEFAULT,&func,NULL); diff --git a/test/dtypes.c b/test/dtypes.c index d509a39..e527757 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1600,25 +1600,25 @@ test_compound_9(void) goto error; } /* end if */ - if((dset_id = H5Dcreate(file,"Dataset",dup_tid,space_id,H5P_DEFAULT)) < 0) { + if((dset_id = H5Dcreate2(file, "Dataset", dup_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); printf("Can't create dataset\n"); goto error; } /* end if */ - if(H5Dwrite(dset_id,dup_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) { + if(H5Dwrite(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) { H5_FAILED(); AT(); printf("Can't write data\n"); goto error; } /* end if */ - if(H5Dread(dset_id,dup_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) { + if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); printf("Can't read data\n"); goto error; } /* end if */ - if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { + if(rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { H5_FAILED(); AT(); printf("incorrect read data\n"); goto error; @@ -1810,33 +1810,33 @@ test_compound_10(void) } /* end if */ dim1[0] = 1; - if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) { + if((space_id = H5Screate_simple(1,dim1,NULL)) < 0) { H5_FAILED(); AT(); printf("Can't create space\n"); goto error; } /* end if */ - if((dset_id = H5Dcreate(file,"Dataset",arr_tid,space_id,H5P_DEFAULT)) < 0) { + if((dset_id = H5Dcreate2(file, "Dataset", arr_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); AT(); printf("Can't create dataset\n"); goto error; } /* end if */ - if(H5Dwrite(dset_id,arr_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) { + if(H5Dwrite(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) { H5_FAILED(); AT(); printf("Can't write data\n"); goto error; } /* end if */ - if(H5Dread(dset_id,arr_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) { + if(H5Dread(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); printf("Can't read data\n"); goto error; } /* end if */ - for(i=0; i<ARRAY_DIM; i++) { - if(rdata[i].i1!=wdata[i].i1 || rdata[i].i2!=wdata[i].i2 || - strcmp(rdata[i].str, wdata[i].str)) { + for(i = 0; i < ARRAY_DIM; i++) { + if(rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 || + HDstrcmp(rdata[i].str, wdata[i].str)) { H5_FAILED(); AT(); printf("incorrect read data\n"); goto error; @@ -2498,7 +2498,7 @@ test_transient (hid_t fapl) /* Create a dataset from a transient datatype */ if(H5Tclose(type) < 0) goto error; if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) goto error; - if((dset = H5Dcreate(file, "dset1", type, space, H5P_DEFAULT)) < 0) + if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* The type returned from a dataset should not be modifiable */ @@ -2670,7 +2670,7 @@ test_named (hid_t fapl) } /* Create a dataset that uses the named type */ - if((dset = H5Dcreate(file, "dset1", type, space, H5P_DEFAULT)) < 0) + if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Get the dataset's datatype and make sure it's a named type */ @@ -2701,7 +2701,7 @@ test_named (hid_t fapl) * first dataset. */ if(H5Dclose(dset) < 0) goto error; - if((dset = H5Dcreate(file, "dset2", t2, space, H5P_DEFAULT)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset2", t2, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Reopen the second dataset and make sure the type is shared */ if(H5Tclose(t2) < 0) goto error; @@ -2735,7 +2735,7 @@ test_named (hid_t fapl) HDputs (" Copied type should not be a named type!"); goto error; } - if((dset = H5Dcreate(file, "dset3", t2, space, H5P_DEFAULT)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset3", t2, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if((t3 = H5Dget_type(dset)) < 0) goto error; if((status = H5Tcommitted(t3)) < 0) goto error; if(status) { diff --git a/test/enum.c b/test/enum.c index bb50d11..e40965c 100644 --- a/test/enum.c +++ b/test/enum.c @@ -148,8 +148,8 @@ test_noconv(hid_t file) if(H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE)) < 0) FAIL_STACK_ERROR if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR - if((space=H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR - if((dset=H5Dcreate(cwg, "color_table", type, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR + if((dset = H5Dcreate2(cwg, "color_table", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR if(H5Dread(dset, type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR @@ -237,7 +237,7 @@ test_tr1(hid_t file) if(H5Tenum_insert(f_type, "BLACK", CPTR(ival, 101)) < 0) FAIL_STACK_ERROR if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR - if((dset = H5Dcreate(cwg, "color_table", f_type, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dset = H5Dcreate2(cwg, "color_table", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dwrite(dset, m_type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR if(H5Dread(dset, m_type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR @@ -329,7 +329,7 @@ test_tr2(hid_t file) if(H5Tenum_insert(f_type, "BLACK", CPTR(val2, 1010)) < 0) FAIL_STACK_ERROR if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR - if((dset = H5Dcreate(cwg, "color_table", f_type, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dset = H5Dcreate2(cwg, "color_table", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dwrite(dset, m_type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR if(H5Dread(dset, m_type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR @@ -350,8 +350,7 @@ test_tr2(hid_t file) PASSED(); } - else - { + else { SKIPPED(); puts(" Test not compatible with current Virtual File Driver"); } diff --git a/test/err_compat.c b/test/err_compat.c index beb6bfc..33c172f 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -81,14 +81,14 @@ test_error(hid_t file) /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { - dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; /* Create the dataset */ - if ((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space, - H5P_DEFAULT))<0) { + if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE, - "H5Dcreate failed"); + "H5Dcreate2 failed"); goto error; } diff --git a/test/error_test.c b/test/error_test.c index 3b3b617..97da864 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -64,7 +64,7 @@ hid_t ERR_MIN_GETNUM; #define ERR_MAJ_API_MSG "Error in API" #define ERR_MIN_SUBROUTINE_MSG "Error in subroutine" #define ERR_MIN_ERRSTACK_MSG "Error in error stack" -#define ERR_MIN_CREATE_MSG "Error in H5Dcreate" +#define ERR_MIN_CREATE_MSG "Error in H5Dcreate2" #define ERR_MIN_WRITE_MSG "Error in H5Dwrite" #define ERR_MIN_GETNUM_MSG "Error in H5Eget_num" @@ -114,13 +114,13 @@ test_error(hid_t file) /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { - dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT); + dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT)) < 0) { + if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, - "H5Dcreate failed"); + "H5Dcreate2 failed"); goto error; } /* end if */ diff --git a/test/extend.c b/test/extend.c index 64037fa..2248b5d 100644 --- a/test/extend.c +++ b/test/extend.c @@ -61,7 +61,7 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me TESTING(msg); /* Create the dataset */ - if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, mem_space, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data */ for(i = 0; i < 5; i++) @@ -157,7 +157,7 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h TESTING(msg); /* Create the dataset */ - if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, mem_space, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data */ for(i = 0; i < 5; i++) diff --git a/test/external.c b/test/external.c index 20ece60..44e586d 100644 --- a/test/external.c +++ b/test/external.c @@ -113,7 +113,7 @@ test_1a(hid_t file) if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0) goto error; if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; - if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0) + if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(dset) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -183,28 +183,29 @@ test_1a(hid_t file) static int test_1b(hid_t file) { - hid_t dcpl=-1; /*dataset creation properties */ - hid_t space=-1; /*data space */ - hid_t dset=-1; /*dataset */ + hid_t dcpl = -1; /*dataset creation properties */ + hid_t space = -1; /*data space */ + hid_t dset = -1; /*dataset */ hsize_t cur_size[1]; /*current data space size */ hsize_t max_size[1]; /*maximum data space size */ TESTING("external storage is too small"); if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = max_size[0] = 100; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, - (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error; - if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error; + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, + (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) goto error; + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; H5E_BEGIN_TRY { - dset = H5Dcreate (file, "dset2", H5T_NATIVE_INT, space, dcpl); + dset = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; - if (dset>=0) { + if(dset >= 0) { H5_FAILED(); puts(" Small external file succeeded instead of failing."); goto error; } - if (H5Sclose (space) < 0) goto error; - if (H5Pclose (dcpl) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; @@ -246,21 +247,23 @@ test_1c(hid_t file) hsize_t max_size[1]; /*maximum data space size */ TESTING("extendible dataspace, exact external size"); - if((dcpl=H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; + + if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = 100; max_size[0] = 200; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, - (hsize_t)(max_size[0]*sizeof(int))) < 0) goto error; - if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error; - if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl)) < 0) + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, + (hsize_t)(max_size[0] * sizeof(int))) < 0) goto error; + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset3", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if (H5Dclose (dset) < 0) goto error; - if (H5Sclose (space) < 0) goto error; - if (H5Pclose (dcpl) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Dclose(dset); H5Pclose(dcpl); @@ -297,22 +300,24 @@ test_1d(hid_t file) hsize_t max_size[1]; /*maximum data space size */ TESTING("extendible dataspace, external storage is too small"); - if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = 100; max_size[0] = 200; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, - (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error; - if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, + (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) goto error; + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; H5E_BEGIN_TRY { - dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT, space, dcpl); + dset = H5Dcreate2(file, "dset4", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; - if (dset>=0) { + if(dset >= 0) { H5_FAILED(); puts(" Small external file succeeded instead of failing."); goto error; } - if (H5Sclose (space) < 0) goto error; - if (H5Pclose (dcpl) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; @@ -364,7 +369,7 @@ test_1e(hid_t file) cur_size[0] = 100; max_size[0] = H5S_UNLIMITED; if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; - if((dset = H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0) + if((dset = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(dset) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -437,26 +442,28 @@ test_1f(hid_t file) hsize_t max_size[1]; /*data space maximum size */ TESTING("multiple external files"); - if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; cur_size[0] = max_size[0] = 100; - if (H5Pset_external(dcpl, "ext1.data", (off_t)0, + if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if (H5Pset_external(dcpl, "ext2.data", (off_t)0, + if(H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if (H5Pset_external(dcpl, "ext3.data", (off_t)0, + if(H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if (H5Pset_external(dcpl, "ext4.data", (off_t)0, + if(H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error; - if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error; - if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl)) < 0) + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset6", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if (H5Dclose(dset) < 0) goto error; - if (H5Sclose(space) < 0) goto error; - if (H5Pclose(dcpl) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Dclose(dset); H5Pclose(dcpl); @@ -638,33 +645,32 @@ test_2 (hid_t fapl) goto error; cur_size = 100; if((space = H5Screate_simple(1, &cur_size, NULL)) < 0) goto error; - if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* * Read the entire dataset and compare with the original */ memset(whole, 0, sizeof(whole)); if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0) goto error; - for(i = 0; i < 100; i++) { - if (whole[i]!=(signed)i) { + for(i = 0; i < 100; i++) + if(whole[i] != (signed)i) { H5_FAILED(); puts(" Incorrect value(s) read."); goto error; - } - } + } /* end if */ /* * Read the middle of the dataset */ - if ((hs_space=H5Scopy(space)) < 0) goto error; - if (H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL, + if((hs_space = H5Scopy(space)) < 0) goto error; + if(H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL, &hs_count, NULL) < 0) goto error; - memset(whole, 0, sizeof(whole)); - if (H5Dread (dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT, + HDmemset(whole, 0, sizeof(whole)); + if(H5Dread(dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT, whole) < 0) goto error; - if (H5Sclose (hs_space) < 0) goto error; - for (i=hs_start; i<hs_start+hs_count; i++) { - if (whole[i]!=(signed)i) { + if(H5Sclose(hs_space) < 0) goto error; + for(i = hs_start; i<hs_start+hs_count; i++) { + if(whole[i] != (signed)i) { H5_FAILED(); puts(" Incorrect value(s) read."); goto error; @@ -755,7 +761,7 @@ test_3 (hid_t fapl) /* Create the dataset */ if((mem_space = H5Screate_simple(1, &cur_size, &max_size)) < 0) goto error; if((file_space = H5Scopy(mem_space)) < 0) goto error; - if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, file_space, dcpl)) < 0) + if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, file_space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the entire dataset and compare with the original */ diff --git a/test/fillval.c b/test/fillval.c index 2d4d136..acbd2b9 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -322,7 +322,7 @@ test_getset_vl(hid_t fapl) /* Write an dataset of this type. */ if((spaceid = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR - if((datasetid = H5Dcreate(fileid, "Dataset", typeid, spaceid, plistid)) < 0) TEST_ERROR + if((datasetid = H5Dcreate2(fileid, "Dataset", typeid, spaceid, H5P_DEFAULT, plistid, H5P_DEFAULT)) < 0) TEST_ERROR /* Close IDs (except datatype) */ if(H5Dclose(datasetid) < 0) TEST_ERROR @@ -432,7 +432,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error; fill_ctype.y = 4444; if(H5Pset_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error; - if((dset9 = H5Dcreate(file, "dset9", comp_type_id, space, dcpl)) < 0) + if((dset9 = H5Dcreate2(file, "dset9", comp_type_id, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* The three datasets test three fill @@ -443,26 +443,26 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) #ifndef NO_FILLING if(H5Pset_fill_value(dcpl, H5T_NATIVE_SHORT, &fill_s) < 0) goto error; #endif - if((dset1=H5Dcreate(file, "dset1", H5T_NATIVE_LONG, space, dcpl)) < 0) + if((dset1=H5Dcreate2(file, "dset1", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* 3. Large to small fill conversion */ #ifndef NO_FILLING if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error; #endif - if((dset2=H5Dcreate(file, "dset2", H5T_NATIVE_SHORT, space, dcpl)) < 0) + if((dset2=H5Dcreate2(file, "dset2", H5T_NATIVE_SHORT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* 4. No conversion */ #ifndef NO_FILLING if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error; #endif - if((dset3=H5Dcreate(file, "dset3", H5T_NATIVE_LONG, space, dcpl)) < 0) + if((dset3=H5Dcreate2(file, "dset3", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* 5. late space allocation and never write fill value */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; - if((dset4=H5Dcreate(file, "dset4", H5T_NATIVE_LONG, space, dcpl)) < 0) + if((dset4=H5Dcreate2(file, "dset4", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. @@ -470,7 +470,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; H5E_BEGIN_TRY { - if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) + if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL) goto error; } H5E_END_TRY; } @@ -490,7 +490,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error; fill_ctype.y = 4444; if(H5Pset_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error; - if((dset8 = H5Dcreate(file, "dset8", comp_type_id, space, dcpl)) < 0) + if((dset8 = H5Dcreate2(file, "dset8", comp_type_id, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; @@ -498,19 +498,19 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 2. Never write fill value */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; - if((dset5 = H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0) + if((dset5 = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* 3. Write fill value at space allocation time */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; - if((dset6 = H5Dcreate(file, "dset6", H5T_NATIVE_LONG, space, dcpl)) < 0) + if((dset6 = H5Dcreate2(file, "dset6", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; H5E_BEGIN_TRY { - if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) + if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL) goto error; } H5E_END_TRY; @@ -777,9 +777,9 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, /* Create dataset */ if((fspace = H5Screate_simple(5, cur_size, cur_size)) < 0) goto error; - if(datatype == H5T_INTEGER && (dset1 = H5Dcreate(file, dname, H5T_NATIVE_INT, fspace, dcpl)) < 0) + if(datatype == H5T_INTEGER && (dset1 = H5Dcreate2(file, dname, H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if(datatype == H5T_COMPOUND && (dset2 = H5Dcreate(file, dname, ctype_id, fspace, dcpl)) < 0) + if(datatype == H5T_COMPOUND && (dset2 = H5Dcreate2(file, dname, ctype_id, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Read some data and make sure it's the fill value */ @@ -1455,7 +1455,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, if((fspace = H5Screate_simple(5, start_size, max_size)) < 0) TEST_ERROR /* Create dataset */ - if((dset = H5Dcreate(file, dset_name, dtype, fspace, dcpl)) < 0) TEST_ERROR + if((dset = H5Dcreate2(file, dset_name, dtype, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR /* Set up pointers to elements */ diff --git a/test/flush1.c b/test/flush1.c index 04345e0..97ddf76 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -64,7 +64,7 @@ create_file(char* name, hid_t fapl) if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR if(H5Pset_chunk(dcpl, 2, ch_size) < 0) FAIL_STACK_ERROR if((space = H5Screate_simple(2, ds_size, NULL)) < 0) FAIL_STACK_ERROR - if((dset = H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Write some data */ for(i = 0; i < ds_size[0]; i++) @@ -82,7 +82,7 @@ create_file(char* name, hid_t fapl) for(i = 0; i < 100; i++) { sprintf(name, "grp%02u", (unsigned)i); if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Gclose(grp)<0) FAIL_STACK_ERROR + if(H5Gclose(grp) < 0) FAIL_STACK_ERROR } /* end for */ return file; @@ -117,10 +117,10 @@ extend_file(hid_t file) size_t i, j; /* Create a chunked dataset */ - if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dcpl, 2, ch_size)<0) goto error; - if ((space=H5Screate_simple(2, ds_size, NULL))<0) goto error; - if ((dset=H5Dcreate(file, "dset2", H5T_NATIVE_FLOAT, space, H5P_DEFAULT))<0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; + if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset2", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Write some data */ @@ -135,7 +135,7 @@ extend_file(hid_t file) } } if (H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, - the_data)<0) goto error; + the_data) < 0) goto error; return file; @@ -185,13 +185,13 @@ main(void) h5_fixname(FILENAME[0], fapl, name, sizeof name); file = create_file(name, fapl); /* Flush and exit without closing the library */ - if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) goto error; + if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error; /* Create the file */ h5_fixname(FILENAME[2], fapl, name, sizeof name); file = create_file(name, fapl); /* Flush and exit without closing the library */ - if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) goto error; + if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error; /* Add a bit to the file and don't flush the new part */ extend_file(file); diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 93ed08c..a4daedc 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -56,7 +56,7 @@ int main(void) if(H5Pinsert(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, H5O_BOGUS_MSG_FLAGS_SIZE, &bogus_flags, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error; /* Create dataset with "bogus" message, but no message flags */ - if((did = H5Dcreate(fid, "/Dataset1", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error; + if((did = H5Dcreate2(fid, "/Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; /* Set "fail if unknown" message flag for bogus message */ @@ -64,7 +64,7 @@ int main(void) if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; /* Create second dataset, with "fail if unknown" message flag */ - if((did = H5Dcreate(fid, "/Dataset2", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error; + if((did = H5Dcreate2(fid, "/Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; /* Set "mark if unknown" message flag for bogus message */ @@ -72,7 +72,7 @@ int main(void) if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; /* Create second dataset, with "mark if unknown" message flag */ - if((did = H5Dcreate(fid, "/Dataset3", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error; + if((did = H5Dcreate2(fid, "/Dataset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; /* Close dataset creation property list */ diff --git a/test/gen_cross.c b/test/gen_cross.c index 9642577..46afc35 100755 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -82,8 +82,8 @@ main (void) * Create a new dataset within the file using defined dataspace and * datatype and default dataset creation properties. */ - dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace, - H5P_DEFAULT); + dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. diff --git a/test/gen_deflate.c b/test/gen_deflate.c index 00d6011..16de92e 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -90,7 +90,7 @@ main(void) printf("H5Pset_deflate() failed!\n"); /* Create the compressed dataset */ - dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, dcpl); + dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); diff --git a/test/gen_filters.c b/test/gen_filters.c index a938531..6d24fb3 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -57,7 +57,7 @@ test_filters_endianess(void) 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; diff --git a/test/gen_new_array.c b/test/gen_new_array.c index 3e625b9..3f54e79 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -128,7 +128,7 @@ main(void) printf("field 4 insert<0!\n"); /* Create the dataset with compound array fields */ - dset = H5Dcreate(file, "Dataset1", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); H5Dclose(dset); @@ -142,7 +142,7 @@ main(void) printf("type<0!\n"); /* Create the dataset with array datatype */ - dset = H5Dcreate(file, "Dataset2", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); H5Dclose(dset); diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 8f0aa45..4ba85ad 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -39,40 +39,40 @@ main(void) int fill_val1 = 4444, fill_val2=5555; if((file=H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) <0) goto error; - if((space=H5Screate_simple(2, cur_size, cur_size))<0) goto error; - if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((space=H5Screate_simple(2, cur_size, cur_size)) < 0) goto error; + if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Create a dataset with space being allocated and fill value written */ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; - if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1)<0) goto error; - if((dset1 = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl))<0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1) < 0) goto error; + if((dset1 = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if (H5Dget_space_status(dset1, &allocation)<0) goto error; - if (allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) { + if(H5Dget_space_status(dset1, &allocation) < 0) goto error; + if(allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) { puts(" Got unallocated space instead of allocated."); printf(" Got %d\n", allocation); goto error; } - if(H5Dclose(dset1)<0) goto error; + if(H5Dclose(dset1) < 0) goto error; /* Create a dataset with space allocation being delayed */ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; - if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2)<0) goto error; - if((dset2 = H5Dcreate(file, "dset2", H5T_NATIVE_INT, space, dcpl))<0) + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2) < 0) goto error; + if((dset2 = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if (H5Dget_space_status(dset2, &allocation)<0) goto error; - if (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) { + if(H5Dget_space_status(dset2, &allocation) < 0) goto error; + if(allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) { puts(" Got allocated space instead of unallocated."); printf(" Got %d\n", allocation); goto error; } - if(H5Dclose(dset2)<0) goto error; + if(H5Dclose(dset2) < 0) goto error; - if(H5Sclose(space)<0) goto error; - if(H5Pclose(dcpl)<0) goto error; - if(H5Fclose(file)<0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + if(H5Fclose(file) < 0) goto error; return 0; diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 18a5416..1a57b6f 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -80,11 +80,11 @@ int main(void) if((gid = H5Gcreate2(fid, "links", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Create dataset in group */ - if((did = H5Dcreate(gid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) goto error; + if((did = H5Dcreate2(gid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did)<0) goto error; /* Create second dataset in group */ - if((did = H5Dcreate(gid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) goto error; + if((did = H5Dcreate2(gid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did)<0) goto error; /* Close dataspace */ diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index 6ff2635..d7a0f32 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -63,7 +63,7 @@ main(void) printf("space<0!\n"); /* Create the dataset with compound array fields */ - dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); diff --git a/test/gen_noencoder.c b/test/gen_noencoder.c index 9204192..3266374 100644 --- a/test/gen_noencoder.c +++ b/test/gen_noencoder.c @@ -55,7 +55,7 @@ main(void) H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC); /* Create dataset noencoder_szip_dset.h5 */ - dset_id = H5Dcreate(file_id, "noencoder_szip_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id); + dset_id = H5Dcreate2(file_id, "noencoder_szip_dset.h5", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf); @@ -71,7 +71,7 @@ main(void) H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC); /* Create dataset noencoder_szip_shuffle_fletcher_dset.h5 */ - dset_id = H5Dcreate(file_id, "noencoder_szip_shuffle_fletcher_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id); + dset_id = H5Dcreate2(file_id, "noencoder_szip_shuffle_fletcher_dset.h5", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf); diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 385564f..1c422df 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -51,7 +51,7 @@ main(void) assert(sid>0); /* Create dataset */ - did = H5Dcreate(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(did>0); /* Close the dataset */ diff --git a/test/gen_old_array.c b/test/gen_old_array.c index 9163ac7..a4162f2 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -107,7 +107,7 @@ main(void) printf("field 3 insert<0!\n"); /* Create the dataset with compound non-array fields */ - dset = H5Dcreate(file, "Dataset1", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); H5Dclose(dset); @@ -141,7 +141,7 @@ main(void) printf("field 4 insert<0!\n"); /* Create the dataset with compound array fields */ - dset = H5Dcreate(file, "Dataset2", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); H5Dclose(dset); diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 1533f8e..312ee58 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -82,7 +82,7 @@ main(void) printf("H5Pset_alloc_time() failed!\n"); /* Create the dataset with deferred storage allocation */ - dset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, space, dcpl); + dset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index 999184c..ca6012a 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -63,7 +63,7 @@ main(void) printf("space<0!\n"); /* Create the dataset with compound array fields */ - dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT); + dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dset<0) printf("dset<0!\n"); diff --git a/test/getname.c b/test/getname.c index 670489f..685bfbf 100644 --- a/test/getname.c +++ b/test/getname.c @@ -181,17 +181,17 @@ test_main(hid_t file_id, hid_t fapl) /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Dcreate + * Test H5Iget_name with H5Dcreate2 *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Dcreate"); + TESTING("H5Iget_name with H5Dcreate2"); /* Create the dataspace */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR @@ -203,7 +203,7 @@ test_main(hid_t file_id, hid_t fapl) if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset inside "g1" */ - if((dataset_id = H5Dcreate(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR @@ -265,7 +265,7 @@ test_main(hid_t file_id, hid_t fapl) /* Create a dataset */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR - if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR @@ -646,8 +646,8 @@ test_main(hid_t file_id, hid_t fapl) /* Create two datasets "g11/d" and "g11/g/d"*/ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR - if((dataset_id = H5Dcreate(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((dataset2_id = H5Dcreate(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dcreate2(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ if(H5Ldelete(file_id, "/g11/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -688,7 +688,7 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create the dataset */ - if((dataset_id = H5Dcreate(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR @@ -990,7 +990,7 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(group_id , "d", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR @@ -1064,10 +1064,10 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ if(H5Ldelete(file2_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -1105,10 +1105,10 @@ test_main(hid_t file_id, hid_t fapl) if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ if(H5Ldelete(file3_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -1198,7 +1198,7 @@ test_main(hid_t file_id, hid_t fapl) } /* Close */ - H5Gclose(group_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -1218,7 +1218,7 @@ test_main(hid_t file_id, hid_t fapl) if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file_id , "d2", type_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate2(file_id , "d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR { char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */ @@ -1235,9 +1235,9 @@ test_main(hid_t file_id, hid_t fapl) } /* Close */ - H5Dclose(dataset_id); - H5Sclose(space_id); - H5Tclose(type_id); + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -1256,7 +1256,7 @@ test_main(hid_t file_id, hid_t fapl) /* Also create a dataset and a datatype */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR - if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate2(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -2394,13 +2394,13 @@ test_obj_ref(hid_t fapl) /* Create a single dataset inside the second file, which will be mounted * and used to mask objects in the first file */ - if((dataset = H5Dcreate(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Create a dataset(inside Group1) */ - if((dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Initialize data buffer */ @@ -2416,7 +2416,7 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Create another dataset(inside Group1) */ - if((dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close Dataset */ @@ -2451,7 +2451,7 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Create dataset in that group */ - if((dataset = H5Dcreate(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close Dataset */ @@ -2467,7 +2467,7 @@ test_obj_ref(hid_t fapl) /* Open up that hard link and make a new dataset there */ if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((dataset = H5Dcreate(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) @@ -2477,7 +2477,7 @@ test_obj_ref(hid_t fapl) /* Create a dataset to store references */ - if((dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create reference to dataset */ @@ -2674,7 +2674,7 @@ test_reg_ref(hid_t fapl) TEST_ERROR /* Create integer dataset */ - if((dsetv_id = H5Dcreate(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) + if((dsetv_id = H5Dcreate2(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Write data to the dataset */ @@ -2684,7 +2684,7 @@ test_reg_ref(hid_t fapl) TEST_ERROR /* Dataset with references */ - if((dsetr_id = H5Dcreate(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0) + if((dsetr_id = H5Dcreate2(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* diff --git a/test/istore.c b/test/istore.c index 657e150..dfe5c41 100644 --- a/test/istore.c +++ b/test/istore.c @@ -123,24 +123,24 @@ new_object(hid_t f, const char *name, int ndims, hsize_t dims[], hsize_t cdims[] hid_t dcpl; /* Dataset creation property list ID */ /* Create the dataset creation property list */ - if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR; + if ((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; /* Set the chunk dimensions */ if(H5Pset_chunk(dcpl, ndims, cdims) < 0) TEST_ERROR; /* Create the dataspace */ - if((space = H5Screate_simple(ndims, dims, NULL))<0) TEST_ERROR; + if((space = H5Screate_simple(ndims, dims, NULL)) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate (f, name, TEST_DATATYPE, space, dcpl))<0) TEST_ERROR; + if((dataset = H5Dcreate2(f, name, TEST_DATATYPE, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Clean up */ /* Close property lists */ - if(H5Pclose(dcpl)<0) TEST_ERROR; + if(H5Pclose(dcpl) < 0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space) < 0) TEST_ERROR; return dataset; @@ -187,7 +187,7 @@ test_create(hid_t f, const char *prefix) return FAIL; /* Close dataset created */ - if(H5Dclose(dataset)<0) + if(H5Dclose(dataset) < 0) return FAIL; } @@ -268,7 +268,7 @@ test_extend(hid_t f, const char *prefix, } /* Get dataset's dataspace */ - if((fspace=H5Dget_space(dataset))<0) TEST_ERROR; + if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; for (ctr = 0; H5V_vector_lt_u((unsigned)ndims, max_corner, whole_size); @@ -316,13 +316,13 @@ test_extend(hid_t f, const char *prefix, HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); /* Create dataspace for selection in memory */ - if((mspace=H5Screate_simple(1,&nelmts,NULL))<0) TEST_ERROR; + if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR; /* Select region in file dataspace */ - if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL)<0) TEST_ERROR; + if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; /* Write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf)<0) { + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { H5_FAILED(); fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); goto error; @@ -330,7 +330,7 @@ test_extend(hid_t f, const char *prefix, /* Read from disk */ HDmemset(check, 0xff, (size_t)nelmts); - if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check)<0) { + if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { H5_FAILED(); fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); goto error; @@ -348,7 +348,7 @@ test_extend(hid_t f, const char *prefix, } /* Close memory dataspace */ - if(H5Sclose(mspace)<0) TEST_ERROR; + if(H5Sclose(mspace) < 0) TEST_ERROR; /* Write to `whole' buffer for later checking */ H5V_hyper_copy((unsigned)ndims, size, @@ -362,7 +362,7 @@ test_extend(hid_t f, const char *prefix, /* Now read the entire array back out and check it */ HDmemset(buf, 0xff, nx * ny * nz); - if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) { + if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { H5_FAILED(); fprintf(stderr," Read failed for whole array.\n"); goto error; @@ -390,10 +390,10 @@ test_extend(hid_t f, const char *prefix, } /* Close dataset's dataspace */ - if(H5Sclose(fspace)<0) TEST_ERROR; + if(H5Sclose(fspace) < 0) TEST_ERROR; /* Close dataset */ - if(H5Dclose(dataset)<0) TEST_ERROR; + if(H5Dclose(dataset) < 0) TEST_ERROR; /* Free memory used */ HDfree(buf); @@ -482,10 +482,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, } /* Get dataset's dataspace */ - if((fspace=H5Dget_space(dataset))<0) TEST_ERROR; + if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; /* Create dataspace for memory buffer */ - if((mspace=H5Screate_simple(ndims,size,NULL))<0) TEST_ERROR; + if((mspace=H5Screate_simple(ndims,size,NULL)) < 0) TEST_ERROR; for (ctr=0; ctr<nblocks; ctr++) { offset[0] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-nx)); @@ -493,10 +493,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, offset[2] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-nz)); /* Select region in file dataspace */ - if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL)<0) TEST_ERROR; + if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; /* write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf)<0) { + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { H5_FAILED(); printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); printf(" offset=(%lu", (unsigned long) (offset[0])); @@ -521,13 +521,13 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, } /* Close memory dataspace */ - if(H5Sclose(mspace)<0) TEST_ERROR; + if(H5Sclose(mspace) < 0) TEST_ERROR; /* Close dataset's dataspace */ - if(H5Sclose(fspace)<0) TEST_ERROR; + if(H5Sclose(fspace) < 0) TEST_ERROR; /* Close dataset */ - if(H5Dclose(dataset)<0) TEST_ERROR; + if(H5Dclose(dataset) < 0) TEST_ERROR; HDfree(buf); PASSED(); @@ -613,7 +613,7 @@ main(int argc, char *argv[]) /* Create the test file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0) { + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { printf("Cannot create file %s; test aborted\n", filename); exit(1); } @@ -628,7 +628,7 @@ main(int argc, char *argv[]) addr = 8 * ((uint64_t)1<<30); /*8 GB */ f=H5I_object(file); - if (H5FDset_eoa(f->shared->lf, H5FD_MEM_DEFAULT, addr)<0) { + if (H5FDset_eoa(f->shared->lf, H5FD_MEM_DEFAULT, addr) < 0) { printf("Cannot create large file family\n"); exit(1); } diff --git a/test/links.c b/test/links.c index 487bcee..52d76cd 100644 --- a/test/links.c +++ b/test/links.c @@ -134,7 +134,7 @@ mklinks(hid_t fapl, hbool_t new_format) if(H5Gclose(grp) < 0) TEST_ERROR /* Create a dataset */ - if((d1 = H5Dcreate(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR + if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(d1) < 0) TEST_ERROR /* Create a hard link */ @@ -208,8 +208,8 @@ new_links(hid_t fapl, hbool_t new_format) if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create datasets */ - if((dset1 = H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR - if((dset2 = H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR + if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create links within a file. Both of source and destination use * H5L_SAME_LOC. Both hard and soft links should fail. */ @@ -3411,7 +3411,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) /* Test creating each kind of object */ if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - if((did = H5Dcreate(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Close objects */ if(H5Gclose(gid) < 0) TEST_ERROR if(H5Tclose(tid) < 0) TEST_ERROR @@ -5087,7 +5087,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) dims[0] = 2; dims[1] = 2; if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR - if((did = H5Dcreate(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR /* Close group */ @@ -5199,7 +5199,7 @@ linkinfo(hid_t fapl, hbool_t new_format) if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR - if((did = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Lcreate_ud(fid, "ud_link", UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR diff --git a/test/mount.c b/test/mount.c index 6330504..e5e0d0a 100644 --- a/test/mount.c +++ b/test/mount.c @@ -874,7 +874,7 @@ test_interlink(hid_t fapl) if(H5Tcommit2(file1, "/type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if((space = H5Screate_simple(1, cur_dims, NULL)) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { - dset = H5Dcreate(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT); + dset = H5Dcreate2(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(dset >= 0) { H5_FAILED(); @@ -1128,7 +1128,7 @@ test_mount_after_close(hid_t fapl) if((gidX = H5Gcreate2(fid2, "/X", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((gidXY = H5Gcreate2(gidX, "Y", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((did = H5Dcreate(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((did = H5Dcreate2(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Soft link */ if(H5Lcreate_soft("./Y", gidX, "T", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR diff --git a/test/mtime.c b/test/mtime.c index d6eed1f..1969af2 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -77,7 +77,7 @@ main(void) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; if((space = H5Screate_simple(1, size, NULL)) < 0) TEST_ERROR; - if((dset = H5Dcreate(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT)) < 0) + if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; now = HDtime(NULL); if(H5Dclose(dset) < 0) TEST_ERROR; diff --git a/test/ntypes.c b/test/ntypes.c index 2535ce1..2f5dd5d 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -104,8 +104,8 @@ test_atomic_dtype(hid_t file) /*------------------- Test data values ------------------------*/ /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dataset */ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) @@ -146,16 +146,14 @@ test_atomic_dtype(hid_t file) TEST_ERROR; /* Check that the values read are the same as the values written */ - for (i = 0; i < DIM0; i++) { - for (j = 0; j < DIM1; j++) { + for(i = 0; i < DIM0; i++) + for(j = 0; j < DIM1; j++) if(ipoints2[i][j] != icheck2[i][j]) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); goto error; - } - } - } + } /* end if */ if(H5Dclose(dataset) < 0) TEST_ERROR; if(H5Tclose(native_type) < 0) TEST_ERROR; @@ -164,12 +162,12 @@ test_atomic_dtype(hid_t file) /*------------------ Test different data types ----------------*/ /* Create the dataset of H5T_STD_I64LE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -186,12 +184,12 @@ test_atomic_dtype(hid_t file) /* Create the dataset of H5T_STD_I8LE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_ASCEND)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_ASCEND)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -208,12 +206,12 @@ test_atomic_dtype(hid_t file) /* Create the dataset of H5T_IEEE_F32BE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -230,12 +228,12 @@ test_atomic_dtype(hid_t file) /* Create the dataset of H5T_IEEE_F64BE */ - if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR; + if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) + if((native_type = H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0) TEST_ERROR; /* Verify the datatype retrieved and converted */ @@ -243,7 +241,7 @@ test_atomic_dtype(hid_t file) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F64BE)) TEST_ERROR; - if(H5T_FLOAT!=H5Tget_class(native_type)) + if(H5T_FLOAT != H5Tget_class(native_type)) TEST_ERROR; if(H5Dclose(dataset) < 0) TEST_ERROR; @@ -343,9 +341,9 @@ test_compound_dtype2(hid_t file) /* Insert and pack members */ if(H5Tinsert(tid2, "c2", 0, H5T_STD_I16BE) < 0) TEST_ERROR; -#if H5_SIZEOF_LONG==4 +#if H5_SIZEOF_LONG == 4 if(H5Tinsert(tid2, "l2", 2, H5T_STD_I32LE) < 0) TEST_ERROR; -#elif H5_SIZEOF_LONG==8 +#elif H5_SIZEOF_LONG == 8 if(H5Tinsert(tid2, "l2", 2, H5T_STD_I64LE) < 0) TEST_ERROR; #else #error "Unknown 'long' size" @@ -354,21 +352,21 @@ test_compound_dtype2(hid_t file) if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; if(H5Tinsert(tid, "i", 1, H5T_STD_I32LE) < 0) TEST_ERROR; if(H5Tinsert(tid, "st", 5, tid2) < 0) TEST_ERROR; -#if H5_SIZEOF_LONG==4 +#if H5_SIZEOF_LONG == 4 if(H5Tinsert(tid, "l", 11, H5T_STD_U64BE) < 0) TEST_ERROR; -#elif H5_SIZEOF_LONG==8 +#elif H5_SIZEOF_LONG == 8 if(H5Tinsert(tid, "l", 15, H5T_STD_U64BE) < 0) TEST_ERROR; #else #error "Unknown 'long' size" #endif /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_2, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_2, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for memory */ - if((tid_m2=H5Tcreate(H5T_COMPOUND, sizeof(s2))) < 0) TEST_ERROR; - if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid_m2 = H5Tcreate(H5T_COMPOUND, sizeof(s2))) < 0) TEST_ERROR; + if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid_m2, "c2", HOFFSET(s2, c2), H5T_NATIVE_SHORT) < 0) TEST_ERROR; @@ -558,17 +556,16 @@ test_compound_dtype(hid_t file) /* Allocate space for the points & check arrays */ if((points=malloc(sizeof(s1)*DIM0*DIM1))==NULL) TEST_ERROR; - if((check=calloc(sizeof(s1),DIM0*DIM1))==NULL) + if((check = calloc(sizeof(s1), DIM0 * DIM1)) == NULL) TEST_ERROR; /* Initialize the dataset */ - for (i = n = 0, temp_point=points; i < DIM0; i++) { - for (j = 0; j < DIM1; j++,temp_point++) { + for(i = n = 0, temp_point=points; i < DIM0; i++) + for(j = 0; j < DIM1; j++,temp_point++) { temp_point->c = 't'; temp_point->i = n++; temp_point->l = (i*10+j*100)*n; - } - } + } /* end for */ /* Create the data space */ dims[0] = DIM0; @@ -576,7 +573,7 @@ test_compound_dtype(hid_t file) if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; @@ -584,11 +581,11 @@ test_compound_dtype(hid_t file) if(H5Tinsert(tid, "l", 5, H5T_STD_I64BE) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid2=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid2, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_UINT) < 0) TEST_ERROR; if(H5Tinsert(tid2, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -736,14 +733,13 @@ test_compound_dtype3(hid_t file) TEST_ERROR; /* Initialize the dataset */ - for (i = n = 0, temp_point=points; i < DIM0; i++) { - for (j = 0; j < DIM1; j++,temp_point++) { + for(i = n = 0, temp_point=points; i < DIM0; i++) + for(j = 0; j < DIM1; j++,temp_point++) { temp_point->c = 't'; temp_point->l = (i*10+j*100)*n; - for (k = 0; k < 5; k++) + for(k = 0; k < 5; k++) (temp_point->a)[k] = n++; - } - } + } /* end for */ /* Create the data space */ dims[0] = DIM0; @@ -754,7 +750,7 @@ test_compound_dtype3(hid_t file) if((tid2 = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid=H5Tcreate(H5T_COMPOUND, 29)) < 0) TEST_ERROR; + if((tid = H5Tcreate(H5T_COMPOUND, 29)) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; @@ -762,14 +758,14 @@ test_compound_dtype3(hid_t file) if(H5Tinsert(tid, "l", 21, H5T_STD_I64BE) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_3, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_3, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create array datatype */ if((tid_m2 = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "a", HOFFSET(s1, a), tid_m2) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -935,14 +931,13 @@ test_compound_opaque(hid_t file) TEST_ERROR; /* Initialize the dataset */ - for (i = n = 0, temp_point=points; i < DIM0; i++) { - for (j = 0; j < DIM1; j++,temp_point++) { + for(i = n = 0, temp_point=points; i < DIM0; i++) + for(j = 0; j < DIM1; j++,temp_point++) { temp_point->c = 't'; temp_point->l = (i*10+j*100)*n; - for (k = 0; k < 5; k++) + for(k = 0; k < 5; k++) (temp_point->o)[k] = n++; - } - } + } /* end for */ /* Create the data space */ dims[0] = DIM0; @@ -950,11 +945,11 @@ test_compound_opaque(hid_t file) if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Create opaque datatype */ - if((tid2=H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o))) < 0) TEST_ERROR; + if((tid2 = H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o))) < 0) TEST_ERROR; if(H5Tset_tag(tid2, "testing opaque field") < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid=H5Tcreate(H5T_COMPOUND, 14)) < 0) TEST_ERROR; + if((tid = H5Tcreate(H5T_COMPOUND, 14)) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR; @@ -962,11 +957,11 @@ test_compound_opaque(hid_t file) if(H5Tinsert(tid, "l", 6, H5T_STD_I64BE) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_4, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_4, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "o", HOFFSET(s1, o), tid2) < 0) TEST_ERROR; if(H5Tinsert(tid_m, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -1120,10 +1115,9 @@ test_enum_dtype(hid_t file) TESTING("enum datatype"); /* Initialize the dataset */ - for (i = 0; i < DIM0; i++) { - for (j=0, n=0; j < DIM1; j++, n++) + for(i = 0; i < DIM0; i++) + for(j = 0, n = 0; j < DIM1; j++, n++) spoints2[i][j] = (i*10+j*100+n)%8; - } /* Create the data space */ dims[0] = DIM0; @@ -1131,17 +1125,17 @@ test_enum_dtype(hid_t file) if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Construct enum type based on native type */ - if((tid=H5Tenum_create(H5T_STD_I16LE)) < 0) TEST_ERROR; + if((tid = H5Tenum_create(H5T_STD_I16LE)) < 0) TEST_ERROR; - for (i = 0; i < 8; i++) { - sub_colors[i*2]=i; - sub_colors[i*2+1]=0; + for(i = 0; i < 8; i++) { + sub_colors[i * 2] = i; + sub_colors[i * 2 + 1] = 0; if(H5Tenum_insert(tid, mname[i], &(sub_colors[i*2])) < 0) TEST_ERROR; - } + } /* end for */ /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ENUM_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ENUM_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Construct enum type based on native type in memory */ if((tid_m = H5Tenum_create(H5T_NATIVE_SHORT)) < 0) TEST_ERROR; @@ -1149,7 +1143,7 @@ test_enum_dtype(hid_t file) for(i = 0; i < 8; i++) { colors[i] = i; if(H5Tenum_insert(tid_m, mname[i], &(colors[i])) < 0) TEST_ERROR; - } + } /* end for */ /* Write the data to the dataset */ if(H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, spoints2) < 0) @@ -1266,7 +1260,7 @@ test_array_dtype(hid_t file) if((space = H5Screate_simple(2, space_dims, NULL)) < 0) TEST_ERROR; /* Create compound datatype for disk storage */ - if((tid2=H5Tcreate(H5T_COMPOUND, 13)) < 0) TEST_ERROR; + if((tid2 = H5Tcreate(H5T_COMPOUND, 13)) < 0) TEST_ERROR; /* Insert members */ if(H5Tinsert(tid2, "c", 0, H5T_STD_U8BE) < 0) TEST_ERROR; @@ -1277,11 +1271,11 @@ test_array_dtype(hid_t file) if((tid = H5Tarray_create(tid2, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ARRAY_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create compound datatype for datatype in memory */ - if((tid3=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; + if((tid3 = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR; if(H5Tinsert(tid3, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR; if(H5Tinsert(tid3, "i", HOFFSET(s1, i), H5T_NATIVE_UINT) < 0) TEST_ERROR; if(H5Tinsert(tid3, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR; @@ -1405,8 +1399,8 @@ test_array_dtype2(hid_t file) if((tid = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR; /* Create the dataset */ - if((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space, - H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_ARRAY2_NAME, tid, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create array datatype for memory */ if((tid_m = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR; @@ -1537,7 +1531,7 @@ test_vl_dtype(hid_t file) if((tid = H5Tvlen_create(tid2)) < 0) TEST_ERROR /* Create a dataset */ - if((dataset = H5Dcreate(file, DSET_VL_NAME, tid, space, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(file, DSET_VL_NAME, tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create a base VL datatype for memory */ @@ -1682,10 +1676,10 @@ test_vlstr_dtype(hid_t file) TEST_ERROR; /* Create a dataset */ - if((dataset = H5Dcreate(file,DSET_VLSTR_NAME,tid1,sid1,H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_VLSTR_NAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write dataset to disk */ - if(H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata) < 0) TEST_ERROR; + if(H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0) TEST_ERROR; /* Close Dataset */ if(H5Dclose(dataset) < 0) TEST_ERROR; @@ -1791,7 +1785,7 @@ test_str_dtype(hid_t file) if(H5T_STRING != H5Tget_class(tid1)) TEST_ERROR; /* Create a dataset */ - if((dataset = H5Dcreate(file, DSET_STR_NAME, tid1, sid1, H5P_DEFAULT)) < 0) TEST_ERROR; + if((dataset = H5Dcreate2(file, DSET_STR_NAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write dataset to disk */ if(H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0) TEST_ERROR; @@ -1934,7 +1928,7 @@ test_refer_dtype(hid_t file) TEST_ERROR; /* Create a dataset */ - if((dataset = H5Dcreate(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0) + if((dataset = H5Dcreate2(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create reference to named datatype */ @@ -2058,22 +2052,22 @@ test_refer_dtype2(hid_t file) TESTING("dataset region reference"); /* Allocate write & read buffers */ - dwbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + dwbuf = malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create dataspace for datasets */ if((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0) TEST_ERROR; /* Create a dataset */ - if((dset2=H5Dcreate(file,"Dataset2",H5T_STD_U8LE,sid2,H5P_DEFAULT)) < 0) + if((dset2 = H5Dcreate2(file, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - for(tu8=dwbuf,i=0; i<SPACE2_DIM1*SPACE2_DIM2; i++) + for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) *tu8++=i*3; /* Write selection to disk */ - if(H5Dwrite(dset2,H5T_STD_U8LE,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf) < 0) + if(H5Dwrite(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf) < 0) TEST_ERROR; /* Close Dataset */ @@ -2086,7 +2080,7 @@ test_refer_dtype2(hid_t file) TEST_ERROR; /* Create a reference dataset */ - if((dset1 = H5Dcreate(file, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create references */ @@ -2244,7 +2238,7 @@ test_opaque_dtype(hid_t file) if((type = H5Tcreate(H5T_OPAQUE, 1)) < 0 || H5Tset_tag(type, "testing 1-byte opaque type") < 0 || (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || - (dset = H5Dcreate(file, DSET_OPAQUE_NAME, type, space, H5P_DEFAULT)) < 0) + (dset = H5Dcreate2(file, DSET_OPAQUE_NAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i = 0; i < sizeof(wbuf); i++) @@ -2320,7 +2314,7 @@ test_bitfield_dtype(hid_t file) nelmts = sizeof(wbuf); if((type = H5Tcopy(H5T_STD_B8LE)) < 0 || (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || - (dset = H5Dcreate(file, DSET_BITFIELD_NAME, type, space, H5P_DEFAULT)) < 0) + (dset = H5Dcreate2(file, DSET_BITFIELD_NAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i = 0; i < sizeof(wbuf); i++) @@ -2415,7 +2409,7 @@ test_ninteger(void) if((dcpl1 = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* create a dataset */ - if((did1 = H5Dcreate(fid1, "dset", H5T_NATIVE_INT, sid1, dcpl1)) < 0) goto error; + if((did1 = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, sid1, H5P_DEFAULT, dcpl1, H5P_DEFAULT)) < 0) goto error; /* write */ if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) @@ -2467,36 +2461,36 @@ test_ninteger(void) goto error; /* create a file using default properties */ - if((fid2=H5Fcreate("tstint2.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid2 = H5Fcreate("tstint2.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* create a dataset using the native type */ - if((did2 = H5Dcreate(fid2,"dset",nid1,sid1,dcpl1)) <0) goto error; + if((did2 = H5Dcreate2(fid2, "dset", nid1, sid1, H5P_DEFAULT, dcpl1, H5P_DEFAULT)) < 0) goto error; /* write */ - if(H5Dwrite(did2,nid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,chk) < 0) + if(H5Dwrite(did2, nid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, chk) < 0) goto error; /* get dcpl */ - if((dcpl2=H5Dget_create_plist(did2)) < 0) + if((dcpl2 = H5Dget_create_plist(did2)) < 0) goto error; /* get file datatype */ - if((tid2=H5Dget_type (did2)) < 0) + if((tid2 = H5Dget_type(did2)) < 0) goto error; /* get native datatype */ - if((nid2=H5Tget_native_type(tid2,H5T_DIR_DEFAULT)) < 0) + if((nid2 = H5Tget_native_type(tid2, H5T_DIR_DEFAULT)) < 0) goto error; /* check */ - if(H5Tget_precision(nid1)!=H5Tget_precision(nid2)) { + if(H5Tget_precision(nid1) != H5Tget_precision(nid2)) { printf(" Precision differ.\n"); goto error; } /* compare dataset creation property lists */ - if(H5Pequal(dcpl1,dcpl2)<=0) { + if(H5Pequal(dcpl1, dcpl2) <= 0) { printf(" Property lists differ.\n"); goto error; } diff --git a/test/objcopy.c b/test/objcopy.c index d35db59..88fee57 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -248,9 +248,9 @@ attach_ref_attr(hid_t file_id, hid_t loc_id) /* creates two simple datasets */ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR if((sid_ref = H5Screate_simple(1, dims_ref, NULL)) < 0) TEST_ERROR - if((did1 = H5Dcreate(file_id, dsetname1, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did1 = H5Dcreate2(file_id, dsetname1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data1) < 0) TEST_ERROR - if((did2 = H5Dcreate(file_id, dsetname2, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did2 = H5Dcreate2(file_id, dsetname2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data2) < 0) TEST_ERROR /* create an attribute with two object references */ @@ -316,7 +316,7 @@ attach_reg_ref_attr(hid_t file_id, hid_t loc_id) /* create a 2D dataset */ if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0) TEST_ERROR - if((dsetv_id = H5Dcreate(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data) < 0) TEST_ERROR /* create reg_ref of block selection */ @@ -397,9 +397,9 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0) TEST_ERROR - if((dsetv_id = H5Dcreate(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data) < 0) TEST_ERROR - if((dsetr_id = H5Dcreate(loc_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dsetr_id = H5Dcreate2(loc_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR start[0] = 0; start[1] = 3; @@ -417,7 +417,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR - if((dsetr_id = H5Dcreate(loc_id, dsetnamer1, H5T_STD_REF_DSETREG, spacer_id, pid)) < 0) TEST_ERROR + if((dsetr_id = H5Dcreate2(loc_id, dsetnamer1, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Pclose(pid) < 0) TEST_ERROR if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0) TEST_ERROR if(H5Dclose(dsetr_id) < 0) TEST_ERROR @@ -427,7 +427,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) if(H5Pset_chunk(pid, 1, &chunk_size) < 0) TEST_ERROR if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR - if((dsetr_id = H5Dcreate(loc_id, dsetnamer2, H5T_STD_REF_DSETREG, spacer_id, pid)) < 0) TEST_ERROR + if((dsetr_id = H5Dcreate2(loc_id, dsetnamer2, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Pclose(pid) < 0) TEST_ERROR if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref) < 0) TEST_ERROR if(H5Dclose(dsetr_id) < 0) TEST_ERROR @@ -1165,8 +1165,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) /* Check raw data read in against data written out */ if(wbuf) { - if(!compare_data(did, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, did) ) TEST_ERROR - if(!compare_data(did2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2) ) TEST_ERROR + if(!compare_data(did, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR + if(!compare_data(did2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR } /* end if */ /* Don't have written data, just compare data between the two datasets */ else @@ -1712,7 +1712,7 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* create 2D int dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -1822,7 +1822,7 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* create 2D int dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close dataspace */ if(H5Sclose(sid) < 0) TEST_ERROR @@ -1946,7 +1946,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Tinsert(tid, "double_name", HOFFSET(comp_t, d), H5T_NATIVE_DOUBLE) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_COMPOUND, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_COMPOUND, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -2074,7 +2074,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -2194,7 +2194,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -2322,7 +2322,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -2462,7 +2462,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -2590,7 +2590,7 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_COMPACT, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_COMPACT, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -2720,7 +2720,7 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_external(pid, FILE_EXT, (off_t)0, size) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_EXTERNAL, H5T_NATIVE_INT, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_EXTERNAL, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -2841,7 +2841,7 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ if(H5Tclose(tid) < 0) TEST_ERROR @@ -2966,7 +2966,7 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((H5Tcommit2(gid, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create first dataset at SRC file */ - if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -2975,7 +2975,7 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Dclose(did) < 0) TEST_ERROR /* create second dataset at SRC file */ - if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3105,7 +3105,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create first dataset at SRC file */ - if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3114,7 +3114,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t if(H5Dclose(did) < 0) TEST_ERROR /* create second dataset at SRC file */ - if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3239,13 +3239,13 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR /* create first dataset at SRC file */ - if((did = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* create second dataset at SRC file */ - if((did2 = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR2, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did2 = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3377,13 +3377,13 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create first dataset at SRC file */ - if((did = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* create second dataset at SRC file */ - if((did2 = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR2, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did2 = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3518,7 +3518,7 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3653,7 +3653,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -3790,7 +3790,7 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -3910,7 +3910,7 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* create 2D int dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close dataspace */ if(H5Sclose(sid) < 0) TEST_ERROR @@ -4053,7 +4053,7 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR /* create dataset */ - if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, tid, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR @@ -4286,7 +4286,7 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* add a dataset to the group */ - if((did = H5Dcreate(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* close dataspace */ @@ -4420,7 +4420,7 @@ test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* add a dataset to the group */ - if((did = H5Dcreate(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* close dataspace */ @@ -4564,7 +4564,7 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) sprintf(objname, "Dataset #%d", k); /* add a dataset to the group */ - if((did = H5Dcreate(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR } /* end for */ @@ -4933,7 +4933,7 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* add a dataset to the group */ - if((did = H5Dcreate(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* close dataspace */ @@ -5068,7 +5068,7 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* add a dataset to the group */ - if((did = H5Dcreate(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* close dataspace */ @@ -5195,7 +5195,7 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* add a dataset to the group */ - if((did = H5Dcreate(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* close dataspace */ @@ -5322,7 +5322,7 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* create 2D int dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -5431,7 +5431,7 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* create 2D int dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -5739,7 +5739,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -5882,7 +5882,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6027,7 +6027,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6177,7 +6177,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6336,7 +6336,7 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6490,7 +6490,7 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6645,7 +6645,7 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6802,7 +6802,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR /* create dataset at SRC file */ - if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, pid)) < 0) TEST_ERROR + if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR /* write data into file */ if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -6942,7 +6942,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR /* add a dataset to the top group */ - if((did = H5Dcreate(gid, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(gid, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR @@ -6950,7 +6950,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if((gid_sub = H5Gcreate2(fid_src, NAME_GROUP_SUB, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* add a dataset to the sub group */ - if((did = H5Dcreate(gid_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(gid_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR @@ -6958,7 +6958,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if((gid_sub_sub = H5Gcreate2(gid_sub, NAME_GROUP_SUB_SUB2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* add a dataset to the sub sub group */ - if((did = H5Dcreate(gid_sub_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR + if((did = H5Dcreate2(gid_sub_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR /* close dataset */ diff --git a/test/reserved.c b/test/reserved.c index f719545..eeab056 100755 --- a/test/reserved.c +++ b/test/reserved.c @@ -76,7 +76,7 @@ rsrv_heap(void) sprintf(dset_name, "Dset %d", i); H5E_BEGIN_TRY { - dataset_id = H5Dcreate(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT); + dataset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY if(dataset_id < 0) @@ -174,28 +174,27 @@ rsrv_ohdr(void) fcpl = H5Pcreate(H5P_FILE_CREATE); if(fcpl < 0) TEST_ERROR; - if( H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR; + if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR; file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); - if( file_id < 0) TEST_ERROR; + if(file_id < 0) TEST_ERROR; /* Create the data space for the dataset. */ dims[0] = 4; dims[1] = 6; dataspace_id = H5Screate_simple(2, dims, NULL); - if( dataspace_id < 0) TEST_ERROR; + if(dataspace_id < 0) TEST_ERROR; /* Create the dataset. */ - dataset_id = H5Dcreate(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT); - if( dataset_id < 0) TEST_ERROR; + dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dataset_id < 0) TEST_ERROR; - for(i=0; i<6; i++) - { + for(i = 0; i < 6; i++) { attrval[0][i] = 0; attrval[1][i] = 1; attrval[2][i] = 2; attrval[3][i] = 3; - } + } /* end for */ for(i = 0; i < 2000; i++) { sprintf(attrname, "attr %d", i); @@ -208,7 +207,7 @@ rsrv_ohdr(void) if(status < 0) break; - } + } /* end for */ /* The loop should have broken before completing--the file should not have had * enough address space to hold 2000 attributes (or this test needs to be updated @@ -302,43 +301,41 @@ rsrv_vlen(void) /* Make file address space very small */ fcpl = H5Pcreate(H5P_FILE_CREATE); - if( fcpl < 0) TEST_ERROR; - if( H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR; + if(fcpl < 0) TEST_ERROR; + if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR; file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); - if( file_id < 0) TEST_ERROR; + if(file_id < 0) TEST_ERROR; /* Create the data space for the dataset. */ dims[0] = 2000; dataspace_id = H5Screate_simple(1, dims, NULL); - if( dataspace_id < 0) TEST_ERROR; + if(dataspace_id < 0) TEST_ERROR; /* Create a variable length type */ type_id = H5Tvlen_create(H5T_NATIVE_INT); - if( type_id < 0) TEST_ERROR; + if(type_id < 0) TEST_ERROR; /* Create the dataset. */ - dataset_id = H5Dcreate(file_id, "/dset", type_id, dataspace_id, H5P_DEFAULT); - if( dataset_id < 0) TEST_ERROR; + dataset_id = H5Dcreate2(file_id, "/dset", type_id, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dataset_id < 0) TEST_ERROR; /* Create some data to write */ - for (i = 0; i < 20; i++) - write_buf[i] = i+1; + for(i = 0; i < 20; i++) + write_buf[i] = i + 1; vlen_data.p = write_buf; /* Create a memory dataspace for writing */ dims[0] = 1; mem_space_id = H5Screate_simple(1, dims, NULL); - if( mem_space_id < 0) TEST_ERROR; + if(mem_space_id < 0) TEST_ERROR; /* Create a selection to write to */ start[0] = 0; count[0] = 1; - if( H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, - start, NULL, count, NULL) < 0) TEST_ERROR; + if(H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0) TEST_ERROR; - for (i = 0; i< 2000; i++) - { + for(i = 0; i< 2000; i++) { vlen_data.len = (i%20) + 1; offset[0] = i; @@ -350,7 +347,7 @@ rsrv_vlen(void) if(status < 0) break; - } + } /* end for */ /* The loop should have broken before completing--the file should not have had * enough address space to hold 2000 attributes (or this test needs to be updated!). diff --git a/test/set_extent.c b/test/set_extent.c index 40beda4..aa94b82 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -68,17 +68,17 @@ int main( void ) /* Create a new file using default properties. */ - if ((file_id = H5Fcreate( "set_extent_create.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT )) < 0) TEST_ERROR; + if((file_id = H5Fcreate("set_extent_create.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; TESTING("extend dataset create with fill value"); /* Create the data space with unlimited dimensions. */ - if ((space_id = H5Screate_simple( RANK, dims, maxdims )) < 0) TEST_ERROR; + if((space_id = H5Screate_simple(RANK, dims, maxdims)) < 0) TEST_ERROR; /* Modify dataset creation properties, i.e. enable chunking. */ - if ((plist_id = H5Pcreate (H5P_DATASET_CREATE )) < 0) TEST_ERROR; - if (H5Pset_chunk( plist_id, RANK, dims_chunk ) < 0) TEST_ERROR; - if (H5Pset_fill_value( plist_id, H5T_NATIVE_INT, &fillvalue ) < 0) TEST_ERROR; + if((plist_id = H5Pcreate (H5P_DATASET_CREATE)) < 0) TEST_ERROR; + if(H5Pset_chunk(plist_id, RANK, dims_chunk) < 0) TEST_ERROR; + if(H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR; /*------------------------------------------------------------------------- @@ -87,10 +87,10 @@ int main( void ) */ /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file_id , "Dataset1", H5T_NATIVE_INT, space_id, plist_id )) < 0) TEST_ERROR; + if((dataset_id = H5Dcreate2(file_id , "Dataset1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data. */ - if (H5Dwrite( dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data ) < 0) TEST_ERROR; + if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR; /*------------------------------------------------------------------------- * Set new dimensions for the array; shrink it @@ -98,16 +98,16 @@ int main( void ) */ /* Set new dimensions for the array. */ - if (H5Dset_extent( dataset_id , dims_new ) < 0) TEST_ERROR; + if(H5Dset_extent(dataset_id , dims_new) < 0) TEST_ERROR; /* Get the space. */ - if ((space_id = H5Dget_space( dataset_id )) < 0) TEST_ERROR; + if((space_id = H5Dget_space(dataset_id)) < 0) TEST_ERROR; /* Get dimensions. */ - if (H5Sget_simple_extent_dims( space_id, dims_out, NULL ) < 0) TEST_ERROR; + if(H5Sget_simple_extent_dims(space_id, dims_out, NULL) < 0) TEST_ERROR; - if ( dims_out[0] != dims_new[0] ) TEST_ERROR; - if ( dims_out[1] != dims_new[1] ) TEST_ERROR; + if(dims_out[0] != dims_new[0]) TEST_ERROR; + if(dims_out[1] != dims_new[1]) TEST_ERROR; /*------------------------------------------------------------------------- @@ -175,20 +175,20 @@ int main( void ) *------------------------------------------------------------------------- */ - H5Dclose( dataset_id ); - H5Sclose( space_id ); - H5Pclose( plist_id ); + if(H5Dclose(dataset_id) < 0) TEST_ERROR + if(H5Sclose(space_id) < 0) TEST_ERROR + if(H5Pclose(plist_id) < 0) TEST_ERROR PASSED(); TESTING("extend dataset create without fill value"); /* Create the data space with unlimited dimensions. */ - if ((space_id = H5Screate_simple( RANK, dims, maxdims )) < 0) TEST_ERROR; + if((space_id = H5Screate_simple(RANK, dims, maxdims)) < 0) TEST_ERROR; /* Modify dataset creation properties, i.e. enable chunking. */ - if ((plist_id = H5Pcreate (H5P_DATASET_CREATE )) < 0) TEST_ERROR; - if (H5Pset_chunk( plist_id, RANK, dims_chunk ) < 0) TEST_ERROR; - if (H5Pset_fill_time( plist_id, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR; + if((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; + if(H5Pset_chunk(plist_id, RANK, dims_chunk) < 0) TEST_ERROR; + if(H5Pset_fill_time(plist_id, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR; /*------------------------------------------------------------------------- * Create and write one dataset @@ -196,10 +196,10 @@ int main( void ) */ /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file_id , "Dataset2", H5T_NATIVE_INT, space_id, plist_id )) < 0) TEST_ERROR; + if((dataset_id = H5Dcreate2(file_id , "Dataset2", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data. */ - if (H5Dwrite( dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data ) < 0) TEST_ERROR; + if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR; /*------------------------------------------------------------------------- * Set new dimensions for the array; shrink it @@ -207,15 +207,15 @@ int main( void ) */ /* Set new dimensions for the array. */ - if (H5Dset_extent( dataset_id , dims_new ) < 0) TEST_ERROR; + if(H5Dset_extent(dataset_id , dims_new) < 0) TEST_ERROR; /* Get the space. */ - if ((space_id = H5Dget_space( dataset_id )) < 0) TEST_ERROR; + if((space_id = H5Dget_space(dataset_id)) < 0) TEST_ERROR; /* Get dimensions. */ - if (H5Sget_simple_extent_dims( space_id, dims_out, NULL ) < 0) TEST_ERROR; + if(H5Sget_simple_extent_dims(space_id, dims_out, NULL) < 0) TEST_ERROR; - if ( dims_out[0] != dims_new[0] ) TEST_ERROR; + if(dims_out[0] != dims_new[0]) TEST_ERROR; /*------------------------------------------------------------------------- @@ -298,7 +298,7 @@ int main( void ) if(H5Pset_istore_k(fcpl,ISTORE_IK) < 0) TEST_ERROR; /* Create a new file using properties. */ - if ((file_id = H5Fcreate( "set_extent_read.h5", H5F_ACC_TRUNC, fcpl, H5P_DEFAULT )) < 0) TEST_ERROR; + if((file_id = H5Fcreate("set_extent_read.h5", H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Close property list */ if(H5Pclose(fcpl) < 0) TEST_ERROR; @@ -314,7 +314,7 @@ int main( void ) if(H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR; /* Create a new dataset within the file using cparms creation properties. */ - if((dataset_id = H5Dcreate(file_id , "Dataset1", H5T_NATIVE_INT, space_id, plist_id)) < 0) TEST_ERROR; + if((dataset_id = H5Dcreate2(file_id , "Dataset1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data. */ if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR; @@ -406,7 +406,7 @@ int main( void ) if(H5Pset_fill_time(plist_id, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR; /* Create a new dataset within the file using cparms creation properties. */ - if((dataset_id = H5Dcreate(file_id , "Dataset2", H5T_NATIVE_INT, space_id, plist_id)) < 0) TEST_ERROR; + if((dataset_id = H5Dcreate2(file_id , "Dataset2", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data. */ if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR; diff --git a/test/space_overflow.c b/test/space_overflow.c index dc3d4ec..f0e5e1d 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -53,15 +53,15 @@ main(void) int i; file = H5Fcreate("th5s.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if(file<0) + if(file < 0) printf("file<0!\n"); - for (i=0; i<H5S_MAX_RANK; i++) + for(i = 0; i < H5S_MAX_RANK; i++) cur_dim[i] = 1; space = H5Screate_simple(H5S_MAX_RANK, cur_dim, NULL); - if(space<0) + if(space < 0) printf("space<0!\n"); - dset = H5Dcreate(file, "dset", H5T_NATIVE_UCHAR, space, H5P_DEFAULT); - if(dset<0) + dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dset < 0) printf("dset<0!\n"); H5Sclose(space); H5Dclose(dset); diff --git a/test/stream_test.c b/test/stream_test.c index 7cd8267..8fbdc72 100644 --- a/test/stream_test.c +++ b/test/stream_test.c @@ -226,16 +226,15 @@ static int sender (void) * Create a new dataset within the file using defined dataspace and * default dataset creation properties. */ - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_INT, dataspace, - H5P_DEFAULT); - if (dataset < 0) - { - fprintf (stderr, "sender: couldn't create dataset '%s'\n", DATASETNAME); - free (data); - H5Fclose (file); - H5Sclose (dataspace); - H5Pclose (fapl); - return (-8); + dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, dataspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dataset < 0) { + fprintf(stderr, "sender: couldn't create dataset '%s'\n", DATASETNAME); + free(data); + H5Fclose(file); + H5Sclose(dataspace); + H5Pclose(fapl); + return(-8); } /* diff --git a/test/tarray.c b/test/tarray.c index a0e2b10..b4ec846 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -97,8 +97,8 @@ test_array_atomic_1d(void) CHECK(tid1, FAIL, "H5Tarray_create"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -276,8 +276,8 @@ test_array_atomic_3d(void) CHECK(tid, FAIL, "H5Tarray_create"); /* Create a dataset */ - dataset = H5Dcreate(fid, "Dataset1", tid, sid, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, "Dataset1", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -408,8 +408,8 @@ test_array_array_atomic(void) CHECK(tid1, FAIL, "H5Tarray_create"); /* Create a dataset */ - dataset = H5Dcreate(fid, "Dataset1", tid1, sid, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, "Dataset1", tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -579,8 +579,8 @@ test_array_compound_atomic(void) CHECK(ret, FAIL, "H5Tclose"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -775,11 +775,11 @@ test_array_compound_array(void) CHECK(tid3, FAIL, "H5Tarray_create"); /* Insert float array field */ - ret = H5Tinsert (tid2, "f", HOFFSET(s1_t,f), tid3); + ret = H5Tinsert(tid2, "f", HOFFSET(s1_t, f), tid3); CHECK(ret, FAIL, "H5Tinsert"); /* Close array of floats field datatype */ - ret=H5Tclose(tid3); + ret = H5Tclose(tid3); CHECK(ret, FAIL, "H5Tclose"); /* Create an array datatype to refer to */ @@ -787,15 +787,15 @@ test_array_compound_array(void) CHECK(tid1, FAIL, "H5Tarray_create"); /* Close compound datatype */ - ret=H5Tclose(tid2); + ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Close Dataset */ @@ -1070,15 +1070,15 @@ test_array_vlen_atomic(void) CHECK(tid1, FAIL, "H5Tarray_create"); /* Close VL datatype */ - ret=H5Tclose(tid2); + ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Close Dataset */ @@ -1282,7 +1282,7 @@ test_array_vlen_array(void) CHECK(tid2, FAIL, "H5Tcreate"); /* Close nested array datatype */ - ret=H5Tclose(tid3); + ret = H5Tclose(tid3); CHECK(ret, FAIL, "H5Tclose"); /* Create an array datatype to refer to */ @@ -1290,15 +1290,15 @@ test_array_vlen_array(void) CHECK(tid1, FAIL, "H5Tarray_create"); /* Close VL datatype */ - ret=H5Tclose(tid2); + ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Close Dataset */ @@ -1605,8 +1605,8 @@ test_array_bkg(void) /* Create the dataset */ /* ------------------ */ - dataset = H5Dcreate(fid, FIELDNAME, type, space, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, FIELDNAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write data to the dataset */ /* ------------------------- */ diff --git a/test/tattr.c b/test/tattr.c index 4f1e211..b391836 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -183,8 +183,8 @@ test_attr_basic_write(hid_t fapl) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL); @@ -497,8 +497,8 @@ test_attr_flush(hid_t fapl) spc = H5Screate(H5S_SCALAR); CHECK(spc, FAIL, "H5Screate"); - set = H5Dcreate(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT); - CHECK(set, FAIL, "H5Dcreate"); + set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(set, FAIL, "H5Dcreate2"); att = H5Acreate2(set, ".", ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(att, FAIL, "H5Acreate2"); @@ -568,8 +568,8 @@ test_attr_plist(hid_t fapl) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL); @@ -681,25 +681,24 @@ test_attr_compound_write(hid_t fapl) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataset's dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); /* Create the attribute datatype. */ - tid1 = H5Tcreate (H5T_COMPOUND, sizeof(struct attr4_struct)); + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(struct attr4_struct)); CHECK(tid1, FAIL, "H5Tcreate"); - attr4_field1_off=HOFFSET(struct attr4_struct, i); + attr4_field1_off = HOFFSET(struct attr4_struct, i); ret = H5Tinsert(tid1, ATTR4_FIELDNAME1, attr4_field1_off, H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - attr4_field2_off=HOFFSET(struct attr4_struct, d); + attr4_field2_off = HOFFSET(struct attr4_struct, d); ret = H5Tinsert(tid1, ATTR4_FIELDNAME2, attr4_field2_off, H5T_NATIVE_DOUBLE); CHECK(ret, FAIL, "H5Tinsert"); - attr4_field3_off=HOFFSET(struct attr4_struct, c); - ret = H5Tinsert(tid1, ATTR4_FIELDNAME3, attr4_field3_off, - H5T_NATIVE_SCHAR); + attr4_field3_off = HOFFSET(struct attr4_struct, c); + ret = H5Tinsert(tid1, ATTR4_FIELDNAME3, attr4_field3_off, H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); /* Create dataspace for 1st attribute */ @@ -917,8 +916,8 @@ test_attr_scalar_write(hid_t fapl) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset = H5Dcreate(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ sid2 = H5Screate_simple(ATTR5_RANK, NULL, NULL); @@ -1057,8 +1056,8 @@ test_attr_mult_write(hid_t fapl) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset = H5Dcreate(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataset's dataspace */ ret = H5Sclose(sid1); @@ -1435,8 +1434,8 @@ test_attr_iterate(hid_t fapl) CHECK(sid, FAIL, "H5Screate"); /* Create a new dataset */ - dataset = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataspace */ ret = H5Sclose(sid); @@ -1660,13 +1659,13 @@ test_attr_dtype_shared(hid_t fapl) CHECK(space_id, FAIL, "H5Screate"); /* Create dataset */ - dset_id = H5Dcreate(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Check reference count on named datatype */ ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info"); - VERIFY(oinfo.rc, 2, "H5Dcreate"); + VERIFY(oinfo.rc, 2, "H5Oget_info"); /* Create attribute on dataset */ attr_id = H5Acreate2(dset_id, ".", ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1899,8 +1898,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Retrieve limits for compact/dense attribute storage */ ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); @@ -2034,8 +2033,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pset_attr_creation_order"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Retrieve limits for compact/dense attribute storage */ ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); @@ -2174,8 +2173,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pset_attr_creation_order"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Retrieve limits for compact/dense attribute storage */ ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); @@ -2349,8 +2348,8 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Retrieve limits for compact/dense attribute storage */ ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); @@ -2508,8 +2507,8 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Retrieve limits for compact/dense attribute storage */ ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); @@ -2642,8 +2641,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pget_attr_phase_change"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Retrieve limits for compact/dense attribute storage */ ret = H5Pget_attr_phase_change(dcpl, &rmax_compact, &rmin_dense); @@ -2822,8 +2821,8 @@ test_attr_big(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pget_latest_format"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close property list */ ret = H5Pclose(dcpl); @@ -3072,8 +3071,8 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) CHECK(null_sid, FAIL, "H5Screate"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Add attribute with 'null' dataspace */ @@ -3265,8 +3264,8 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) CHECK(sid, FAIL, "H5Screate"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Add attribute to dataset */ @@ -3484,8 +3483,8 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) CHECK(sid, FAIL, "H5Screate"); /* Create a dataset */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataspace */ ret = H5Sclose(sid); @@ -3596,12 +3595,12 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) CHECK(sid, FAIL, "H5Screate"); /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -3796,12 +3795,12 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) CHECK(sid, FAIL, "H5Screate"); /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -4135,12 +4134,12 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) * that size after everything is deleted -QAK */ /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -4565,12 +4564,12 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(fid, FAIL, "H5Fopen"); /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -4895,12 +4894,12 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -5135,12 +5134,12 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -5952,12 +5951,12 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -6278,12 +6277,12 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -6562,12 +6561,12 @@ test_attr_open(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Create datasets */ - dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset1, FAIL, "H5Dcreate"); - dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset2, FAIL, "H5Dcreate"); - dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dset3, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); + dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); + dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); /* Work on all the datasets */ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { @@ -6845,10 +6844,10 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create datasets */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); - dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset2, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ if(test_shared != 0) { @@ -7171,10 +7170,10 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create datasets */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); - dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset2, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ if(test_shared != 0) { @@ -7612,10 +7611,10 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create datasets */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); - dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset2, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ if(test_shared != 0) { @@ -7976,10 +7975,10 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(dcpl, FAIL, "H5Pcreate"); /* Create datasets */ - dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); - dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl); - CHECK(dataset2, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset2, FAIL, "H5Dcreate2"); /* Check on dataset's message storage status */ if(test_shared != 0) { diff --git a/test/testmeta.c b/test/testmeta.c index 7d67af2..9aa4972 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -64,8 +64,8 @@ int main(void) dataspace_id = H5Screate(H5S_SCALAR); /* Create dataset */ - dataset_id = H5Dcreate(file_id, "/NumDataObj", - H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT); + dataset_id = H5Dcreate2(file_id, "/NumDataObj", + H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write value to NumDataObj dataset */ status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, @@ -90,8 +90,8 @@ int main(void) { /* Create dataset */ sprintf(name, "/ExtArray%06d", i); - dataset_id = H5Dcreate(file_id, name, - H5T_NATIVE_FLOAT, dataspace_id, prop_id); + dataset_id = H5Dcreate2(file_id, name, + H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); /* Close the identifier */ status = H5Dclose(dataset_id); @@ -131,8 +131,8 @@ int main(void) /* Create dataset */ sprintf(name, "DataArray%06d", i); - dataset_id = H5Dcreate(group_id, name, - H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT); + dataset_id = H5Dcreate2(group_id, name, + H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dataset_id < 0) { fprintf(stderr, "Failed to create DataArray dataset.\n"); status = H5Fclose(file_id); diff --git a/test/tfile.c b/test/tfile.c index a940277..d89686f 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -233,12 +233,12 @@ test_file_create(void) CHECK(dataspace_id, FAIL, "H5Screate_simple"); /* Create the dataset. */ - dataset_id = H5Dcreate(fid2, F2_DSET, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT); - CHECK(dataset_id, FAIL, "H5Dcreate"); + dataset_id = H5Dcreate2(fid2, F2_DSET, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); - for(i=0; i<F2_DIM0; i++) - for(j=0; j<F2_DIM1; j++) - data[i][j]=i*10+j; + for(i = 0; i < F2_DIM0; i++) + for(j = 0; j < F2_DIM1; j++) + data[i][j] = i * 10 + j; /* Write data to the new dataset */ ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); @@ -804,13 +804,12 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, CHECK(dataspace_id, FAIL, "H5Screate_simple"); /* Create the dataset. */ - dataset_id = H5Dcreate(fid1, "/dset", H5T_NATIVE_INT, dataspace_id, - H5P_DEFAULT); - CHECK(dataset_id, FAIL, "H5Dcreate"); + dataset_id = H5Dcreate2(fid1, "/dset", H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); - for(i=0; i<F2_DIM0; i++) - for(j=0; j<F2_DIM1; j++) - data[i][j]=i*10+j; + for(i = 0; i < F2_DIM0; i++) + for(j = 0; j < F2_DIM1; j++) + data[i][j] = i * 10 + j; /* Write data to the new dataset */ ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, @@ -941,9 +940,8 @@ test_get_file_id(void) dataspace_id = H5Screate_simple(F2_RANK, dims, NULL); CHECK(dataspace_id, FAIL, "H5Screate_simple"); - dataset_id = H5Dcreate(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id, - H5P_DEFAULT); - CHECK(dataset_id, FAIL, "H5Dcreate"); + dataset_id = H5Dcreate2(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Test H5Iget_file_id() */ check_file_id(fid, dataset_id); @@ -1149,8 +1147,8 @@ test_file_perm(void) CHECK(file, FAIL, "H5Fcreate"); /* Create a dataset with the read-write file handle */ - dset = H5Dcreate(file, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(file, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); @@ -1162,9 +1160,9 @@ test_file_perm(void) /* Create a dataset with the read-only file handle (should fail) */ H5E_BEGIN_TRY { - dset = H5Dcreate(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT); + dset = H5Dcreate2(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(dset, FAIL, "H5Dcreate"); + VERIFY(dset, FAIL, "H5Dcreate2"); if(dset!=FAIL) { ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); @@ -1228,8 +1226,8 @@ test_file_freespace(void) /* Create datasets in file */ for(u = 0; u < 10; u++) { sprintf(name, "Dataset %u", u); - dset = H5Dcreate(file, name, H5T_STD_U32LE, dspace, dcpl); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); @@ -1380,15 +1378,15 @@ test_file_open_dot(void) /* Create a dataset with no name using the file ID */ H5E_BEGIN_TRY { - did = H5Dcreate(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(did, FAIL, "H5Dcreate"); + VERIFY(did, FAIL, "H5Dcreate2"); /* Create a dataset with no name using the group ID */ H5E_BEGIN_TRY { - did = H5Dcreate(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(did, FAIL, "H5Dcreate"); + VERIFY(did, FAIL, "H5Dcreate2"); /* Open a dataset with no name using the file ID */ H5E_BEGIN_TRY { @@ -1512,8 +1510,8 @@ test_file_open_overlap(void) CHECK(sid, FAIL, "H5Screate"); /* Create dataset in group w/first file ID */ - did1 = H5Dcreate(gid, DSET1, H5T_NATIVE_INT, sid, H5P_DEFAULT); - CHECK(did1, FAIL, "H5Dcreate"); + did1 = H5Dcreate2(gid, DSET1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did1, FAIL, "H5Dcreate2"); /* Check number of objects opened in first file */ nobjs = H5Fget_obj_count(fid1, H5F_OBJ_LOCAL|H5F_OBJ_ALL); @@ -1533,8 +1531,8 @@ test_file_open_overlap(void) /* Create dataset with second file ID */ - did2 = H5Dcreate(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT); - CHECK(did2, FAIL, "H5Dcreate"); + did2 = H5Dcreate2(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did2, FAIL, "H5Dcreate2"); /* Check number of objects opened in first file */ nobjs = H5Fget_obj_count(fid2, H5F_OBJ_ALL); @@ -1612,8 +1610,8 @@ test_file_getname(void) VERIFY(name_len, FAIL, "H5Fget_name"); /* Create a new dataset */ - dataset_id = H5Dcreate(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dataset_id, FAIL, "H5Dcreate"); + dataset_id = H5Dcreate2(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Get and verify file name */ name_len = H5Fget_name(dataset_id, name, (size_t)TESTA_NAME_BUF_SIZE); @@ -1775,8 +1773,8 @@ test_file_double_dataset_open(void) space_id = H5Screate(H5S_SCALAR); CHECK(space_id, FAIL, "H5Screate"); - dset1_id = H5Dcreate(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dset1_id, FAIL, "H5Dcreate"); + dset1_id = H5Dcreate2(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset1_id, FAIL, "H5Dcreate2"); dset2_id = H5Dopen2(file2_id, DSET_NAME, H5P_DEFAULT); CHECK(dset2_id, FAIL, "H5Dopen2"); diff --git a/test/tgenprop.c b/test/tgenprop.c index ba60cee..aad0db8 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -1360,9 +1360,9 @@ test_genprop_list_addprop(void) /* Insert temporary property into class (with no callbacks) */ #ifdef H5_WANT_H5_V1_6_COMPAT - ret = H5Pinsert(pid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL); + ret = H5Pinsert(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL); #else /* H5_WANT_H5_V1_6_COMPAT */ - ret = H5Pinsert(pid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL); + ret = H5Pinsert(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); #endif /* H5_WANT_H5_V1_6_COMPAT */ CHECK_I(ret, "H5Pinsert"); @@ -1376,15 +1376,15 @@ test_genprop_list_addprop(void) VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); /* Create a dataset */ - did=H5Dcreate(fid,"Dataset1",H5T_NATIVE_INT,sid,pid); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check existence of added property (after using property list) */ - ret = H5Pexist(pid,PROP1_NAME); + ret = H5Pexist(pid, PROP1_NAME); VERIFY(ret, 1, "H5Pexist"); /* Check values of property (set with default value) (after using property list) */ - ret = H5Pget(pid,PROP1_NAME,&prop1_value); + ret = H5Pget(pid, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); @@ -1443,9 +1443,9 @@ test_genprop_class_addprop(void) /* Insert first property into class (with no callbacks) */ #ifdef H5_WANT_H5_V1_6_COMPAT - ret = H5Pregister(cid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL); + ret = H5Pregister(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); #else /* H5_WANT_H5_V1_6_COMPAT */ - ret = H5Pregister(cid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + ret = H5Pregister(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); #endif /* H5_WANT_H5_V1_6_COMPAT */ CHECK_I(ret, "H5Pregister"); @@ -1454,28 +1454,28 @@ test_genprop_class_addprop(void) CHECK(pid, FAIL, "H5Pcreate"); /* Check existence of an original property */ - ret = H5Pexist(pid,H5D_CRT_DATA_PIPELINE_NAME); + ret = H5Pexist(pid, H5D_CRT_DATA_PIPELINE_NAME); VERIFY(ret, 1, "H5Pexist"); /* Check existence of added property */ - ret = H5Pexist(pid,PROP1_NAME); + ret = H5Pexist(pid, PROP1_NAME); VERIFY(ret, 1, "H5Pexist"); /* Check values of property (set with default value) */ - ret = H5Pget(pid,PROP1_NAME,&prop1_value); + ret = H5Pget(pid, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); /* Create a dataset */ - did=H5Dcreate(fid,"Dataset1",H5T_NATIVE_INT,sid,pid); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check existence of added property (after using property list) */ - ret = H5Pexist(pid,PROP1_NAME); + ret = H5Pexist(pid, PROP1_NAME); VERIFY(ret, 1, "H5Pexist"); /* Check values of property (set with default value) (after using property list) */ - ret = H5Pget(pid,PROP1_NAME,&prop1_value); + ret = H5Pget(pid, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); diff --git a/test/th5o.c b/test/th5o.c index eb18515..f6e6f0b 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -77,8 +77,8 @@ test_h5o_open(void) CHECK(dspace, FAIL, "H5Screate_simple"); /* Create the dataset. */ - dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); ret = H5Sclose(dspace); @@ -183,8 +183,8 @@ test_h5o_close(void) CHECK(dspace, FAIL, "H5Screate_simple"); /* Create the dataset. */ - dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Oclose(dset); CHECK(ret, FAIL, "H5Oclose"); @@ -279,8 +279,8 @@ test_h5o_open_by_addr(void) CHECK(dspace, FAIL, "H5Screate_simple"); /* Create the dataset. */ - dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); ret = H5Sclose(dspace); @@ -404,8 +404,8 @@ test_h5o_refcount(void) CHECK(dspace, FAIL, "H5Screate_simple"); /* Create the dataset. */ - dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Sclose(dspace); CHECK(ret, FAIL, "H5Sclose"); diff --git a/test/th5s.c b/test/th5s.c index 3c872ca..196e777 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -243,12 +243,12 @@ test_h5s_basic(void) /* This dataset's space has no extent; it should not be created */ H5E_BEGIN_TRY { - dset1 = H5Dcreate(fid1, BASICDATASET, H5T_NATIVE_INT, sid1, H5P_DEFAULT); + dset1 = H5Dcreate2(fid1, BASICDATASET, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY - VERIFY(dset1, FAIL, "H5Dcreate"); + VERIFY(dset1, FAIL, "H5Dcreate2"); - dset1 = H5Dcreate(fid1, BASICDATASET2, H5T_NATIVE_INT, sid2, H5P_DEFAULT); - CHECK(dset1, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid1, BASICDATASET2, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset1, FAIL, "H5Dcreate2"); /* Try some writes with the bad dataspace (sid1) */ H5E_BEGIN_TRY { @@ -383,8 +383,8 @@ test_h5s_null(void) VERIFY(ret, FAIL, "H5Sselect_elements"); /* Create first dataset */ - did = H5Dcreate(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Write "nothing" to the dataset */ ret = H5Dwrite(did, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &uval); @@ -738,8 +738,8 @@ test_h5s_scalar_write(void) VERIFY(ext_type, H5S_SCALAR, "H5Sget_simple_extent_type"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data); CHECK(ret, FAIL, "H5Dwrite"); @@ -882,8 +882,8 @@ test_h5s_compound_scalar_write(void) VERIFY(rank, 0, "H5Sget_simple_extent_dims"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space4_data); CHECK(ret, FAIL, "H5Dwrite"); @@ -996,7 +996,7 @@ test_h5s_chunk(void) hsize_t csize[2]; int i,j; - fileID = H5Fcreate(DATAFILE,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); + fileID = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fileID, FAIL, "H5Fcreate"); plist_id = H5Pcreate(H5P_DATASET_CREATE); @@ -1013,24 +1013,24 @@ test_h5s_chunk(void) space_id = H5Screate_simple(2, dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dsetID = H5Dcreate(fileID,"coords",H5T_NATIVE_FLOAT,space_id,plist_id); - CHECK(dsetID, FAIL, "H5Dcreate"); + dsetID = H5Dcreate2(fileID, "coords", H5T_NATIVE_FLOAT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); + CHECK(dsetID, FAIL, "H5Dcreate2"); /* Initialize float array */ - for(i=0; i<50000; i++) - for(j=0; j<3; j++) - chunk_data_flt[i][j]=(float)((i+1)*2.5-j*100.3); + for(i = 0; i < 50000; i++) + for(j = 0; j < 3; j++) + chunk_data_flt[i][j] = (float)((i + 1) * 2.5 - j * 100.3); - status= H5Dwrite(dsetID,H5T_NATIVE_FLOAT,H5S_ALL,H5S_ALL,H5P_DEFAULT,chunk_data_flt); + status = H5Dwrite(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt); CHECK(status, FAIL, "H5Dwrite"); - status=H5Pclose(plist_id); + status = H5Pclose(plist_id); CHECK(status, FAIL, "H5Pclose"); - status=H5Sclose(space_id); + status = H5Sclose(space_id); CHECK(status, FAIL, "H5Sclose"); - status=H5Dclose(dsetID); + status = H5Dclose(dsetID); CHECK(status, FAIL, "H5Dclose"); - status=H5Fclose(fileID); + status = H5Fclose(fileID); CHECK(status, FAIL, "H5Fclose"); /* Reset/initialize the data arrays to read in */ diff --git a/test/titerate.c b/test/titerate.c index 9aef367..72038d9 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -157,8 +157,8 @@ test_iter_group(hid_t fapl, hbool_t new_format) for(i=0; i< NDATASETS; i++) { sprintf(name,"Dataset %d",i); - dataset = H5Dcreate(file, name, datatype, filespace, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Keep a copy of the dataset names around for later */ lnames[i] = HDstrdup(name); @@ -403,8 +403,8 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) filespace = H5Screate(H5S_SCALAR); CHECK(filespace, FAIL, "H5Screate"); - dataset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, filespace, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); for(i = 0; i < NATTR; i++) { sprintf(name, "Attribute %02d", i); @@ -624,8 +624,8 @@ test_iter_group_large(hid_t fapl) } /* end for */ /* Create a dataset */ - dataset = H5Dcreate(file, "Dataset1", H5T_STD_U32LE, sid, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, "Dataset1", H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Add the name to the list of objects in the root group */ HDstrcpy(names[ITER_NGROUPS].name, "Dataset1"); @@ -717,13 +717,13 @@ static void test_grp_memb_funcs(hid_t fapl) datatype = H5Tcopy(H5T_NATIVE_INT); CHECK(datatype, FAIL, "H5Tcopy"); - filespace=H5Screate(H5S_SCALAR); + filespace = H5Screate(H5S_SCALAR); CHECK(filespace, FAIL, "H5Screate"); - for(i = 0; i< NDATASETS; i++) { - sprintf(name,"Dataset %d",i); - dataset = H5Dcreate(file, name, datatype, filespace, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + for(i = 0; i < NDATASETS; i++) { + sprintf(name, "Dataset %d", i); + dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Keep a copy of the dataset names around for later */ dnames[i] = HDstrdup(name); diff --git a/test/tmisc.c b/test/tmisc.c index 41feb80..88c73b4 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -319,8 +319,8 @@ test_misc1(void) CHECK(dataspace, FAIL, "H5Screate"); /* Write the dataset the first time. */ - dataset = H5Dcreate(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); i = MISC1_VAL; ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &i); @@ -334,8 +334,8 @@ test_misc1(void) CHECK(ret, FAIL, "H5Ldelete"); /* Write the dataset for the second time with a different value. */ - dataset = H5Dcreate(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); i = MISC1_VAL2; ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &i); @@ -578,8 +578,8 @@ test_misc3(void) CHECK(dcpl, FAIL, "H5Pset_fill_value"); /* Create the dataset */ - dataset = H5Dcreate(file, MISC3_DSET_NAME, H5T_NATIVE_INT, dataspace, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, MISC3_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Read from the dataset (should be fill-values) */ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &read_buf); @@ -871,45 +871,45 @@ test_misc5(void) MESSAGE(5, ("Testing several level deep nested compound & VL datatypes \n")); /* Write the dataset out */ - loc_id=H5Fcreate(MISC5_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(loc_id,FAIL,"H5Fcreate"); + loc_id = H5Fcreate(MISC5_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(loc_id, FAIL, "H5Fcreate"); /* Create the memory structure to write */ - str1hndl=create_struct1(); - CHECK(str1hndl,NULL,"create_struct1"); + str1hndl = create_struct1(); + CHECK(str1hndl, NULL, "create_struct1"); /* Create the dataspace */ - dims[0]=MISC5_NELMTOPLVL; - space_id=H5Screate_simple(MISC5_DSETRANK, dims, NULL); - CHECK(space_id,FAIL,"H5Screate_simple"); + dims[0] = MISC5_NELMTOPLVL; + space_id = H5Screate_simple(MISC5_DSETRANK, dims, NULL); + CHECK(space_id, FAIL, "H5Screate_simple"); /* Create the dataset */ - dataset_id=H5Dcreate(loc_id, MISC5_DSETNAME, str1hndl->st1h_id, space_id, H5P_DEFAULT); - CHECK(dataset_id,FAIL,"H5Dcreate"); + dataset_id = H5Dcreate2(loc_id, MISC5_DSETNAME, str1hndl->st1h_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Create the variable-length buffer */ - buf.len=MISC5_DBGNELM1; - buf.p=malloc((buf.len)*sizeof(misc5_struct1)); - CHECK(buf.p,NULL,"malloc"); + buf.len = MISC5_DBGNELM1; + buf.p = malloc((buf.len) * sizeof(misc5_struct1)); + CHECK(buf.p, NULL, "malloc"); /* Create the top-level VL information */ - for(i=0; i<MISC5_DBGNELM1; i++) - set_struct1(&(((misc5_struct1 *) (buf.p))[i])); + for(i = 0; i < MISC5_DBGNELM1; i++) + set_struct1(&(((misc5_struct1 *)(buf.p))[i])); /* Write the data out */ - ret=H5Dwrite(dataset_id, str1hndl->st1h_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf); - CHECK(ret,FAIL,"H5Dwrite"); + ret = H5Dwrite(dataset_id, str1hndl->st1h_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf); + CHECK(ret, FAIL, "H5Dwrite"); /* Release the top-level VL information */ - for(j=0; j<MISC5_DBGNELM1; j++) - clear_struct1(&((( misc5_struct1 *)(buf.p))[j])); + for(j = 0; j < MISC5_DBGNELM1; j++) + clear_struct1(&(((misc5_struct1 *)(buf.p))[j])); /* Free the variable-length buffer */ free(buf.p); /* Close dataset */ - ret=H5Dclose(dataset_id); - CHECK(ret,FAIL,"H5Dclose"); + ret = H5Dclose(dataset_id); + CHECK(ret, FAIL, "H5Dclose"); /* Close dataspace */ ret=H5Sclose(space_id); @@ -998,28 +998,28 @@ test_misc6(void) MESSAGE(5, ("Testing object header continuation code \n")); /* Create the file */ - loc_id=H5Fcreate(MISC6_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(loc_id,FAIL,"H5Fcreate"); + loc_id = H5Fcreate(MISC6_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(loc_id, FAIL, "H5Fcreate"); /* Create the dataspace */ - space_id=H5Screate(H5S_SCALAR); - CHECK(space_id,FAIL,"H5Screate"); + space_id = H5Screate(H5S_SCALAR); + CHECK(space_id, FAIL, "H5Screate"); /* Create the first dataset */ - dataset_id=H5Dcreate(loc_id, MISC6_DSETNAME1, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dataset_id,FAIL,"H5Dcreate"); + dataset_id = H5Dcreate2(loc_id, MISC6_DSETNAME1, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Close dataset */ - ret=H5Dclose(dataset_id); - CHECK(ret,FAIL,"H5Dclose"); + ret = H5Dclose(dataset_id); + CHECK(ret, FAIL, "H5Dclose"); /* Create the second dataset */ - dataset_id=H5Dcreate(loc_id, MISC6_DSETNAME2, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dataset_id,FAIL,"H5Dcreate"); + dataset_id = H5Dcreate2(loc_id, MISC6_DSETNAME2, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Close dataset */ - ret=H5Dclose(dataset_id); - CHECK(ret,FAIL,"H5Dclose"); + ret = H5Dclose(dataset_id); + CHECK(ret, FAIL, "H5Dclose"); /* Close file */ ret = H5Fclose(loc_id); @@ -1115,8 +1115,8 @@ test_misc7(void) VERIFY(ret, FAIL, "H5Tcommit2"); /* Attempt to use empty compound datatype to create dataset */ - did = H5Dcreate(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret, FAIL, "H5Dcreate2"); /* Add a field to the compound datatype */ ret = H5Tinsert(tid, "a", (size_t)0, H5T_NATIVE_INT); @@ -1127,8 +1127,8 @@ test_misc7(void) CHECK(ret, FAIL, "H5Tcommit2"); /* Attempt to use compound datatype to create dataset now - should work */ - did = H5Dcreate(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Close dataset */ ret = H5Dclose(did); @@ -1147,20 +1147,20 @@ test_misc7(void) VERIFY(ret, FAIL, "H5Tcommit2"); /* Attempt to use empty enum datatype to create dataset */ - did = H5Dcreate(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT); - VERIFY(did,FAIL,"H5Dcreate"); + did = H5Dcreate2(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(did, FAIL, "H5Dcreate2"); /* Add a member to the enum datatype */ ret = H5Tenum_insert(tid, "a", &enum_value); - CHECK(ret,FAIL,"H5Tenum_insert"); + CHECK(ret, FAIL, "H5Tenum_insert"); /* Attempt to commit the enum datatype now - should work */ ret = H5Tcommit2(fid, MISC7_TYPENAME2, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); /* Attempt to use enum datatype to create dataset now - should work */ - did = H5Dcreate(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Close dataset */ ret = H5Dclose(did); @@ -1252,14 +1252,14 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pclose"); /* Create a simple dataspace */ - sid = H5Screate_simple(rank,dims,NULL); + sid = H5Screate_simple(rank, dims, NULL); CHECK(sid, FAIL, "H5Screate_simple"); /* Select a hyperslab which coincides with chunk boundaries */ /* (For later use) */ - start[0]=1; start[1]=1; - count[0]=(MISC8_CHUNK_DIM0*2)-1; count[1]=(MISC8_CHUNK_DIM1*2)-1; - ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL); + start[0] = 1; start[1] = 1; + count[0] = (MISC8_CHUNK_DIM0 * 2) - 1; count[1] = (MISC8_CHUNK_DIM1 * 2) - 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset creation property list */ @@ -1272,17 +1272,17 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to early */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation early */ - did = H5Dcreate(fid, MISC8_DSETNAME1, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); - VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Close dataset ID */ ret = H5Dclose(did); @@ -1294,11 +1294,11 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ - did = H5Dcreate(fid, MISC8_DSETNAME2, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write data */ @@ -1306,24 +1306,24 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); - VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Close dataset ID */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ - did = H5Dcreate(fid, MISC8_DSETNAME3, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write data */ @@ -1331,9 +1331,9 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); - VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Close dataset ID */ ret = H5Dclose(did); @@ -1345,39 +1345,39 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to late */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ /* Should fail */ - did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl); - VERIFY(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VERIFY(did, FAIL, "H5Dcreate2"); /* Set the space allocation time to incremental */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation incremental */ /* Should fail */ - did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl); - VERIFY(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VERIFY(did, FAIL, "H5Dcreate2"); /* Set the space allocation time to early */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Set the fill time to allocation */ - ret = H5Pset_fill_time(dcpl,H5D_FILL_TIME_ALLOC); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation early */ - did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); - VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Close dataset ID */ ret = H5Dclose(did); @@ -1390,21 +1390,21 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to early */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use chunked storage for this dataset */ - ret = H5Pset_chunk(dcpl,rank,chunk_dims); + ret = H5Pset_chunk(dcpl, rank, chunk_dims); CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a chunked dataset, with space allocation early */ - did = H5Dcreate(fid, MISC8_DSETNAME5, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME5, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size after data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); - VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Close dataset ID */ ret = H5Dclose(did); @@ -1412,19 +1412,19 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use chunked storage for this dataset */ - ret = H5Pset_chunk(dcpl,rank,chunk_dims); + ret = H5Pset_chunk(dcpl, rank, chunk_dims); CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a chunked dataset, with space allocation late */ - did = H5Dcreate(fid, MISC8_DSETNAME6, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME6, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size after dataset is created */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write part of the dataset */ @@ -1432,24 +1432,24 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); - VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Close dataset ID */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ - did = H5Dcreate(fid, MISC8_DSETNAME7, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME7, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write part of the dataset */ @@ -1457,8 +1457,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after only four chunks are written */ - storage_size=H5Dget_storage_size(did); - VERIFY(storage_size, 4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); + storage_size = H5Dget_storage_size(did); + VERIFY(storage_size, 4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); /* Write entire dataset */ ret = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -1479,7 +1479,7 @@ test_misc8(void) #endif /* VERIFY_DATA */ /* Check the storage size after data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size"); @@ -1499,21 +1499,21 @@ test_misc8(void) #endif /* end H5_HAVE_FILTER_DEFLATE */ /* Create a chunked dataset, with space allocation early */ - did = H5Dcreate(fid, MISC8_DSETNAME8, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME8, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Write part of the dataset */ ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); #else /* Compression is not configured */ - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -1523,15 +1523,15 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation late */ - did = H5Dcreate(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write part of the dataset */ @@ -1539,13 +1539,13 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after only four chunks are written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); #else /* Compression is not configured */ - if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -1583,15 +1583,15 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ - did = H5Dcreate(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the storage size before data is written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); VERIFY(storage_size, 0, "H5Dget_storage_size"); /* Write part of the dataset */ @@ -1599,13 +1599,13 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dwrite"); /* Check the storage size after only four chunks are written */ - storage_size=H5Dget_storage_size(did); + storage_size = H5Dget_storage_size(did); CHECK(storage_size, 0, "H5Dget_storage_size"); #ifdef H5_HAVE_FILTER_DEFLATE - if(storage_size>=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size >= (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size); #else /* Compression is not configured */ - if(storage_size!=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT))) + if(storage_size != (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -1716,11 +1716,11 @@ test_misc10(void) MESSAGE(5, ("Testing using old dataset creation property list\n")); /* Generate the correct name for the test file, by prepending the source path */ - if (srcdir && ((strlen(srcdir) + strlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) { - strcpy(testfile, srcdir); - strcat(testfile, "/"); + if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) { + HDstrcpy(testfile, srcdir); + HDstrcat(testfile, "/"); } - strcat(testfile, MISC10_FILE_OLD); + HDstrcat(testfile, MISC10_FILE_OLD); /* * Open the old file and the dataset and get old settings. @@ -1743,29 +1743,29 @@ test_misc10(void) file_new = H5Fcreate(MISC10_FILE_NEW, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT); CHECK(file_new, FAIL, "H5Fcreate"); - dataset_new = H5Dcreate(file_new, MISC10_DSETNAME, type, space, dcpl); - CHECK(dataset_new, FAIL, "H5Dcreate"); + dataset_new = H5Dcreate2(file_new, MISC10_DSETNAME, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset_new, FAIL, "H5Dcreate2"); /* Close new dataset & file */ - ret=H5Dclose(dataset_new); + ret = H5Dclose(dataset_new); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Fclose(file_new); + ret = H5Fclose(file_new); CHECK(ret, FAIL, "H5Fclose"); /* Close old dataset information */ - ret=H5Tclose(type); + ret = H5Tclose(type); CHECK(ret, FAIL, "H5Tclose"); - ret=H5Sclose(space); + ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Pclose(dcpl); + ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); /* Close old file information */ - ret=H5Fclose(file); + ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - ret=H5Pclose(fcpl); + ret = H5Pclose(fcpl); CHECK(ret, FAIL, "H5Pclose"); } /* end test_misc10() */ @@ -1992,8 +1992,8 @@ test_misc12(void) CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a dataset */ - dataset = H5Dcreate(fid1, MISC12_DSET_NAME, tid1, sid1, cparms); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, MISC12_DSET_NAME, tid1, sid1, H5P_DEFAULT, cparms, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -2017,7 +2017,7 @@ test_misc12(void) CHECK(ret, FAIL, "H5Dwrite"); /* Read all data back */ - ret= H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); for(i = 0; i < MISC12_SPACE1_DIM1; i++) @@ -2083,14 +2083,14 @@ create_dataset(hid_t loc_id, const char *name, hid_t dcpl) herr_t ret; /* Generic return value */ /* Create dataspace for use with dataset */ - dims[0]=MISC13_DIM1; - dims[1]=MISC13_DIM2; - sid=H5Screate_simple(MISC13_RANK, dims, NULL); + dims[0] = MISC13_DIM1; + dims[1] = MISC13_DIM2; + sid = H5Screate_simple(MISC13_RANK, dims, NULL); CHECK(sid, FAIL, "H5Screate_simple"); /* Create contiguous dataset in root group */ - dsid = H5Dcreate(loc_id, name, H5T_NATIVE_UINT, sid, dcpl); - CHECK(dsid, FAIL, "H5Dcreate"); + dsid = H5Dcreate2(loc_id, name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Write some data to dataset */ ret = H5Dwrite(dsid, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, m13_data); @@ -2435,10 +2435,10 @@ test_misc14(void) /* Increase the metadata block size */ /* (This makes certain that all the data blocks are allocated together) */ - fapl=H5Pcreate(H5P_FILE_ACCESS); + fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); - ret=H5Pset_meta_block_size(fapl,(hsize_t)MISC14_METADATA_SIZE); + ret = H5Pset_meta_block_size(fapl, (hsize_t)MISC14_METADATA_SIZE); CHECK(ret, FAIL, "H5Pset_meta_block_size"); /* Create dataspace to use */ @@ -2450,15 +2450,15 @@ test_misc14(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create first dataset & write data */ - Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset1, FAIL, "H5Dcreate"); + Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset1, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1); CHECK(ret, FAIL, "H5Dwrite"); /* Create second dataset (to be unlinked). */ - Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2); CHECK(ret, FAIL, "H5Dwrite"); @@ -2466,7 +2466,7 @@ test_misc14(void) /* Check data from first dataset */ ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata); CHECK(ret, FAIL, "H5Dread"); - if(!DBL_ABS_EQUAL(rdata,data1)) + if(!DBL_ABS_EQUAL(rdata, data1)) TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__); /* Unlink second dataset */ @@ -2498,15 +2498,15 @@ test_misc14(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create first dataset & write data */ - Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset1, FAIL, "H5Dcreate"); + Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset1, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1); CHECK(ret, FAIL, "H5Dwrite"); /* Create second dataset */ - Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2); CHECK(ret, FAIL, "H5Dwrite"); @@ -2546,22 +2546,22 @@ test_misc14(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create first dataset & write data */ - Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset1, FAIL, "H5Dcreate"); + Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset1, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1); CHECK(ret, FAIL, "H5Dwrite"); /* Create second dataset */ - Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2); CHECK(ret, FAIL, "H5Dwrite"); /* Create third dataset */ - Dataset3 = H5Dcreate(file_id, MISC14_DSET3_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT); - CHECK(Dataset2, FAIL, "H5Dcreate"); + Dataset3 = H5Dcreate2(file_id, MISC14_DSET3_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(Dataset2, FAIL, "H5Dcreate2"); ret = H5Dwrite(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data3); CHECK(ret, FAIL, "H5Dwrite"); @@ -2709,24 +2709,24 @@ test_misc16(void) CHECK(ret, FAIL, "H5Tset_strpad");*/ /* Create a dataset */ - dataset=H5Dcreate(file,MISC16_DSET_NAME,tid,sid,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, MISC16_DSET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - for(i=0; i<MISC16_SPACE_DIM; i++) { - if(HDstrlen(wdata[i])!=strlen(rdata[i])) { + for(i = 0; i < MISC16_SPACE_DIM; i++) { + if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ - if( HDstrcmp(wdata[i],rdata[i]) != 0 ) { + if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); continue; } /* end if */ @@ -2785,24 +2785,24 @@ test_misc17(void) CHECK(ret, FAIL, "H5Tset_strpad"); /* Create a dataset */ - dataset=H5Dcreate(file,MISC17_DSET_NAME,tid,sid,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, MISC17_DSET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Compare data in the way of strings. */ - for(i=0; i<MISC17_SPACE_DIM1; i++) { - if(HDstrlen(wdata[i])!=strlen(rdata[i])) { + for(i = 0; i < MISC17_SPACE_DIM1; i++) { + if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ - if( HDstrcmp(wdata[i],rdata[i]) != 0 ) { + if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); continue; } /* end if */ @@ -2851,8 +2851,8 @@ test_misc18(void) CHECK(sid, FAIL, "H5Screate"); /* Create first dataset */ - did1 = H5Dcreate(fid, MISC18_DSET1_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT); - CHECK(did1, FAIL, "H5Dcreate"); + did1 = H5Dcreate2(fid, MISC18_DSET1_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did1, FAIL, "H5Dcreate2"); /* Get object information */ ret = H5Oget_info(fid, MISC18_DSET1_NAME, &oinfo, H5P_DEFAULT); @@ -2864,8 +2864,8 @@ test_misc18(void) VERIFY(oinfo.num_attrs, 0, "H5Oget_info"); /* Create second dataset */ - did2 = H5Dcreate(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT); - CHECK(did2, FAIL, "H5Screate_simple"); + did2 = H5Dcreate2(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did2, FAIL, "H5Dcreate2"); /* Get object information */ ret = H5Oget_info(fid, MISC18_DSET2_NAME, &oinfo, H5P_DEFAULT); @@ -2877,9 +2877,9 @@ test_misc18(void) VERIFY(oinfo.num_attrs, 0, "H5Oget_info"); /* Loop creating attributes on each dataset, flushing them to the file each time */ - for(u=0; u<10; u++) { + for(u = 0; u < 10; u++) { /* Set up attribute name */ - sprintf(attr_name,"Attr %u",u); + sprintf(attr_name, "Attr %u", u); /* Create & close attribute on first dataset */ aid = H5Acreate2(did1, ".", attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -3127,8 +3127,8 @@ test_misc19(void) CHECK(sid, FAIL, "H5Screate"); /* Create a dataset */ - did = H5Dcreate(fid,MISC19_DSET_NAME,H5T_NATIVE_INT,sid,H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC19_DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Check the reference count */ rc = H5Iget_ref(did); @@ -3418,8 +3418,8 @@ test_misc20(void) CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create dataset with big dataspace */ - did = H5Dcreate(fid, MISC20_DSET_NAME, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC20_DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Close datasset */ ret = H5Dclose(did); @@ -3434,8 +3434,8 @@ test_misc20(void) CHECK(sid, FAIL, "H5Screate_simple"); /* Create dataset with big dataspace */ - did = H5Dcreate(fid, MISC20_DSET2_NAME, H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, MISC20_DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Close datasset */ ret = H5Dclose(did); @@ -3565,45 +3565,45 @@ test_misc21(void) MESSAGE(5, ("Testing late allocation time w/chunks & filters\n")); /* Allocate space for the buffer */ - buf = (char *)HDcalloc(MISC21_SPACE_DIM0*MISC21_SPACE_DIM1,1); + buf = (char *)HDcalloc(MISC21_SPACE_DIM0 * MISC21_SPACE_DIM1, 1); CHECK(buf, NULL, "HDcalloc"); /* Create the file */ - fid = H5Fcreate (MISC21_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(MISC21_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); /* Create the DCPL */ - dcpl = H5Pcreate (H5P_DATASET_CREATE); + dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); /* Set custom DCPL properties */ - ret = H5Pset_chunk (dcpl, MISC21_SPACE_RANK, chunk_size); + ret = H5Pset_chunk(dcpl, MISC21_SPACE_RANK, chunk_size); CHECK(ret, FAIL, "H5Pset_chunk"); - ret = H5Pset_szip (dcpl, H5_SZIP_NN_OPTION_MASK, 8); + ret = H5Pset_szip(dcpl, H5_SZIP_NN_OPTION_MASK, 8); CHECK(ret, FAIL, "H5Pset_deflate"); - ret = H5Pset_alloc_time (dcpl, H5D_ALLOC_TIME_LATE); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create the dataspace for the dataset */ - sid = H5Screate_simple (MISC21_SPACE_RANK, dims, NULL); + sid = H5Screate_simple(MISC21_SPACE_RANK, dims, NULL); CHECK(ret, FAIL, "H5Screate_simple"); /* Create the dataset */ - dsid = H5Dcreate (fid, MISC21_DSET_NAME, H5T_NATIVE_UINT8, sid, dcpl); - CHECK(dsid, FAIL, "H5Dwrite"); + dsid = H5Dcreate2(fid, MISC21_DSET_NAME, H5T_NATIVE_UINT8, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Write out the whole dataset */ - ret = H5Dwrite (dsid, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + ret = H5Dwrite(dsid, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); CHECK(ret, FAIL, "H5Dwrite"); /* Close everything */ - ret = H5Dclose (dsid); + ret = H5Dclose(dsid); CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose (sid); + ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose (dcpl); + ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Fclose (fid); + ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); HDfree(buf); @@ -3689,19 +3689,20 @@ test_misc22(void) CHECK(ret, FAIL, "H5Tset_precision"); /* compute the correct PPB that should be set by SZIP */ - if (offsets[k] == 0) { - correct=prec[j]; - } else { - correct=H5Tget_size(idts[i])*8; - } - if (correct > 24) { - if (correct <= 32) correct=32; - else if (correct <= 64) correct=64; - } + if(offsets[k] == 0) + correct = prec[j]; + else + correct = H5Tget_size(idts[i]) * 8; + if(correct > 24) { + if(correct <= 32) + correct = 32; + else if(correct <= 64) + correct = 64; + } /* end if */ /* Create the dataset */ - dsid = H5Dcreate(fid, MISC22_DSET_NAME, dtype, sid, dcpl); - CHECK(dsid, FAIL, "H5Dwrite"); + dsid = H5Dcreate2(fid, MISC22_DSET_NAME, dtype, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Write out the whole dataset */ ret = H5Dwrite(dsid, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -3721,7 +3722,7 @@ test_misc22(void) dcpl2 = H5Dget_create_plist(dsid); CHECK(dcpl2, FAIL, "H5Dget_create_plist"); - ret= H5Pget_filter_by_id(dcpl2, H5Z_FILTER_SZIP, &flags, + ret = H5Pget_filter_by_id(dcpl2, H5Z_FILTER_SZIP, &flags, &cd_nelmts, cd_values, 0, NULL , NULL); CHECK(ret, FAIL, "H5Pget_filter_by_id"); @@ -3789,38 +3790,40 @@ test_misc23(void) CHECK(type_id, FAIL, "H5Tcopy"); +#ifndef H5_NO_DEPRECATED_SYMBOLS /********************************************************************** - * test the old APIs - **********************************************************************/ + * test the old APIs + **********************************************************************/ H5E_BEGIN_TRY { - tmp_id = H5Gcreate2(file_id, "/A/B00a/grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + tmp_id = H5Gcreate1(file_id, "/A/B00a/grp", (size_t)0); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gcreate2"); + VERIFY(tmp_id, FAIL, "H5Gcreate1"); - tmp_id = H5Gcreate2(file_id, "/A/grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(tmp_id, FAIL, "H5Gcreate2"); + tmp_id = H5Gcreate1(file_id, "/A/grp", (size_t)0); + CHECK(tmp_id, FAIL, "H5Gcreate1"); status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose"); H5E_BEGIN_TRY { - tmp_id = H5Dcreate(file_id, "/A/B00c/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate1(file_id, "/A/B00c/dset", type_id, space_id, create_id); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Dcreate"); + VERIFY(tmp_id, FAIL, "H5Dcreate1"); - tmp_id = H5Dcreate(file_id, "/A/dset", type_id, space_id, create_id); - CHECK(tmp_id, FAIL, "H5Dcreate"); + tmp_id = H5Dcreate1(file_id, "/A/dset", type_id, space_id, create_id); + CHECK(tmp_id, FAIL, "H5Dcreate1"); status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /********************************************************************** - * test H5Gcreate2() - **********************************************************************/ + * test H5Gcreate2() + **********************************************************************/ /* Create link creation property list */ create_id = H5Pcreate(H5P_LINK_CREATE); @@ -3887,8 +3890,8 @@ test_misc23(void) /********************************************************************** - * test H5Dcreate2() - **********************************************************************/ + * test H5Dcreate2() + **********************************************************************/ /* Create link creation property list */ create_id = H5Pcreate(H5P_LINK_CREATE); @@ -4044,8 +4047,8 @@ test_misc24(void) group_id = H5Gcreate2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group_id, FAIL, "H5Gcreate2"); - dset_id = H5Dcreate(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); type_id = H5Tcopy(H5T_NATIVE_INT); CHECK(type_id, FAIL, "H5Tcopy"); @@ -4624,8 +4627,8 @@ test_misc25c(void) CHECK(sid, FAIL, "H5Screate"); /* Create the dataset */ - did = H5Dcreate(gid, MISC25C_DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(gid, MISC25C_DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Create an extra group */ gid2 = H5Gcreate2(fid, MISC25C_GRPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4763,18 +4766,18 @@ test_misc26(void) sid = H5Screate_simple(1, dims, dims); CHECK(sid, FAIL, "H5Screate_simple"); - did = H5Dcreate(fid, "dataset1", H5T_NATIVE_FLOAT, sid, dcpl1); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "dataset1", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl1, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); ret = H5Dclose(did); CHECK_I(ret, "H5Dclose"); - did = H5Dcreate(fid, "dataset2", H5T_NATIVE_FLOAT, sid, dcpl2); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "dataset2", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl2, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); ret = H5Dclose(did); CHECK_I(ret, "H5Dclose"); - did = H5Dcreate(fid, "dataset3", H5T_NATIVE_FLOAT, sid, dcpl3); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, "dataset3", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl3, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); ret = H5Dclose(did); CHECK_I(ret, "H5Dclose"); diff --git a/test/trefer.c b/test/trefer.c index baa0bcd..6c88a60 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -115,8 +115,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Oset_comment"); /* Create a dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) *tu32++=i*3; @@ -130,8 +130,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Dclose"); /* Create another dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); @@ -164,8 +164,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Gclose"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); @@ -354,8 +354,8 @@ test_reference_region(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset2 = H5Dcreate(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT); - CHECK(dset2, FAIL, "H5Dcreate"); + dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset2, FAIL, "H5Dcreate2"); for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++) *tu8++ = i * 3; @@ -373,8 +373,8 @@ test_reference_region(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset1 = H5Dcreate(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create references */ @@ -626,8 +626,8 @@ test_reference_region_1D(void) CHECK(sid3, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset3 = H5Dcreate(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT); - CHECK(dset3, FAIL, "H5Dcreate"); + dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset3, FAIL, "H5Dcreate2"); for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) *tu8++ = i * 3; @@ -645,8 +645,8 @@ test_reference_region_1D(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dset1 = H5Dcreate(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create references */ @@ -877,16 +877,16 @@ test_reference_obj_deleted(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset to reference (deleted later) */ - dataset = H5Dcreate(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, -1); @@ -1031,7 +1031,7 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Gclose"); /* Create bottom dataset */ - did = H5Dcreate(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT); + did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(did > 0); ret = H5Dclose(did); assert(ret >= 0); @@ -1040,8 +1040,8 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Gclose"); /* Create dataset */ - did = H5Dcreate(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Create reference to group */ ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, -1); @@ -1166,16 +1166,16 @@ test_reference_compat(void) CHECK(group, FAIL, "H5Gcreate2"); /* Create a dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Create another dataset (inside Group1) */ - dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close Dataset */ ret = H5Dclose(dataset); @@ -1209,8 +1209,8 @@ test_reference_compat(void) /* Create a dataset with object reference datatype */ - dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); @@ -1238,8 +1238,8 @@ test_reference_compat(void) /* Create a dataset with region reference datatype */ - dataset = H5Dcreate(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Select 6x6 hyperslab for first reference */ start[0] = 2; start[1] = 2; diff --git a/test/tselect.c b/test/tselect.c index a6b885f..fd577ca 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -283,7 +283,7 @@ test_select_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); @@ -543,7 +543,7 @@ test_select_point(hid_t xfer_plist) HDmemcpy(pi.coord,coord2,sizeof(coord2)); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); @@ -713,7 +713,7 @@ test_select_all(hid_t xfer_plist) VERIFY(ext_type, H5S_SIMPLE, "H5Sget_simple_extent_type"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,xfer_plist,wbuf); @@ -812,7 +812,7 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); @@ -957,7 +957,7 @@ test_select_combo(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -1115,7 +1115,7 @@ test_select_hyper_stride(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1240,7 +1240,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1365,7 +1365,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1489,7 +1489,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf); @@ -1633,7 +1633,7 @@ test_select_hyper_copy(void) CHECK(sid3, FAIL, "H5Scopy"); /* Create a dataset */ - data1=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data1=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data1,H5T_STD_U16LE,sid2,sid1,H5P_DEFAULT,wbuf); @@ -1644,7 +1644,7 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Sclose"); /* Create another dataset */ - data2=H5Dcreate(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data2=H5Dcreate2(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data2,H5T_STD_U16LE,sid3,sid1,H5P_DEFAULT,wbuf); @@ -1802,7 +1802,7 @@ test_select_point_copy(void) CHECK(sid3, FAIL, "H5Scopy"); /* Create a dataset */ - data1=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data1=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data1,H5T_STD_U16LE,sid2,sid1,H5P_DEFAULT,wbuf); @@ -1813,7 +1813,7 @@ test_select_point_copy(void) CHECK(ret, FAIL, "H5Sclose"); /* Create another dataset */ - data2=H5Dcreate(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT); + data2=H5Dcreate2(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(data2,H5T_STD_U16LE,sid3,sid1,H5P_DEFAULT,wbuf); @@ -1990,7 +1990,7 @@ test_select_hyper_offset(void) VERIFY(valid, TRUE, "H5Sselect_valid"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2123,7 +2123,7 @@ test_select_hyper_offset2(void) VERIFY(valid, TRUE, "H5Sselect_valid"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2273,7 +2273,7 @@ test_select_point_offset(void) VERIFY(valid, TRUE, "H5Sselect_valid"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2425,7 +2425,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2518,7 +2518,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset2",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset2",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2603,7 +2603,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset3",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset3",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2692,8 +2692,8 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); xfer = H5Pcreate (H5P_DATASET_XFER); CHECK(xfer, FAIL, "H5Pcreate"); @@ -2789,7 +2789,7 @@ test_select_hyper_union(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset5",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset5",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -2911,8 +2911,8 @@ test_select_hyper_union_stagger(void) CHECK(dataspace, FAIL, "H5Screate_simple"); /* Create File Dataset */ - dset_id=H5Dcreate(file_id,"IntArray",H5T_NATIVE_INT,dataspace,H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id=H5Dcreate2(file_id,"IntArray",H5T_NATIVE_INT,dataspace,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write File Dataset */ error=H5Dwrite(dset_id,H5T_NATIVE_INT,dataspace,dataspace,H5P_DEFAULT,data); @@ -3138,7 +3138,7 @@ test_select_hyper_union_3d(void) VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,tmp2_space,sid1,H5P_DEFAULT,wbuf); @@ -3282,7 +3282,7 @@ test_select_hyper_and_2d(void) VERIFY(npoints, 5*5, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3408,7 +3408,7 @@ test_select_hyper_xor_2d(void) VERIFY(npoints, 150, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3536,7 +3536,7 @@ test_select_hyper_notb_2d(void) VERIFY(npoints, 75, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3663,7 +3663,7 @@ test_select_hyper_nota_2d(void) VERIFY(npoints, 75, "H5Sget_select_npoints"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write selection to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf); @@ -3789,8 +3789,8 @@ test_select_hyper_union_random_5d(hid_t read_plist) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write entire dataset to disk */ ret=H5Dwrite(dataset,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); @@ -3997,8 +3997,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(plist, FAIL, "H5Pcreate"); status = H5Pset_chunk (plist, RANK_F, chunk_dimsf); CHECK(status, FAIL, "H5Pset_chunk"); - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, plist); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, plist, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* * Define hyperslab in the dataset. @@ -4225,8 +4225,8 @@ test_select_point_chunk(void) CHECK(dcpl, FAIL, "H5Pcreate"); ret = H5Pset_chunk (dcpl, SPACE7_RANK, chunk_dimsf); CHECK(ret, FAIL, "H5Pset_chunk"); - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Create 1st point selection */ pnt1_space = H5Scopy (dataspace); @@ -4384,8 +4384,8 @@ test_select_scalar_chunk(void) sid = H5Screate_simple(1, dims, maxdims); CHECK(sid, FAIL, "H5Screate_simple"); - dsid = H5Dcreate(file_id, "dset", H5T_NATIVE_UINT, sid, dcpl); - CHECK(dsid, FAIL, "H5Dcreate"); + dsid = H5Dcreate2(file_id, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Select scalar area (offset 0, count 1) */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL); @@ -5468,8 +5468,8 @@ test_select_none(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Make "none" selection in both disk and memory datasets */ ret = H5Sselect_none(sid1); @@ -5571,8 +5571,8 @@ test_scalar_select(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Select one element in memory with a point selection */ coord1[0]=0; coord1[1]= 2; @@ -7305,8 +7305,8 @@ test_select_hyper_chunk_offset(void) CHECK(sid, FAIL, "H5Screate_simple"); /* Create the dataset */ - did = H5Dcreate (fid, "fooData", H5T_NATIVE_INT, sid, dcpl); - CHECK(did, FAIL, "H5Dcreate"); + did = H5Dcreate2 (fid, "fooData", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); /* Close the dataspace */ ret = H5Sclose(sid); @@ -7500,8 +7500,8 @@ test_select_hyper_chunk_offset2(void) CHECK(status, FAIL, "H5Pset_chunk"); /* Create dataset */ - dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_UINT, dataspace, dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_UINT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close DCPL */ status = H5Pclose(dcpl); diff --git a/test/tsohm.c b/test/tsohm.c index c0b9848..e99a1f1 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -586,7 +586,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos dim1[0] = 1; if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) TEST_ERROR - if((dset_id = H5Dcreate(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Test writing and reading */ if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) TEST_ERROR @@ -606,7 +606,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos } /* Create more datasets with the same datatype */ - if((dset_id = H5Dcreate(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id) < 0) TEST_ERROR /* Close and re-open the file if requested*/ @@ -614,7 +614,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR } - if((dset_id = H5Dcreate(file,DSETNAME[2],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[2],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id) < 0) TEST_ERROR /* Close and re-open the file if requested*/ @@ -622,7 +622,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR } - if((dset_id = H5Dcreate(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Write data to dataset 3 for later */ if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) TEST_ERROR @@ -658,7 +658,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos /* Create several copies of the dataset (this increases the amount of space saved by sharing the datatype message) */ for(x = 0; x < SOHM_HELPER_NUM_EX_DSETS; x++) { - if((dset_id = H5Dcreate(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id) < 0) TEST_ERROR /* Close and re-open the file if requested*/ @@ -1477,8 +1477,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size * and filter pipeline. */ for(x = 0; x < NUM_DATASETS; ++x) { - dset_id = H5Dcreate(file_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); @@ -1526,8 +1526,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size /* Create NUM_DATASETS datasets in the new group */ for(x=0; x<NUM_DATASETS; ++x) { - dset_id = H5Dcreate(group_id, DSETNAME[x], dtype2_id, dspace2_id, dcpl2_id); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); @@ -1567,8 +1567,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size /* Create NUM_DATASETS datasets in the new group */ for(x=0; x<NUM_DATASETS; x+=2) { - dset_id = H5Dcreate(group_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); @@ -1580,8 +1580,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size ret = H5Aclose(attr_id); CHECK_I(ret, "H5Aclose"); - dset_id = H5Dcreate(group_id, DSETNAME[x+1], dtype2_id, dspace2_id, dcpl2_id); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(group_id, DSETNAME[x+1], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(attr_id, "H5Acreate2"); @@ -2559,8 +2559,8 @@ static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, herr_t ret; /* Create dataset */ - dset_id = H5Dcreate(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], dcpl_id[x]); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, dcpl_id[x], H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); /* Write data to dataset */ wdata = x + 'a'; @@ -2910,8 +2910,8 @@ test_sohm_delete_revert_helper(hid_t fcpl_id) file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT); CHECK_I(file_id, "H5Fcreate"); - dset_id = H5Dcreate(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); /* Close the dataset and delete it */ ret = H5Dclose(dset_id); @@ -2932,14 +2932,14 @@ test_sohm_delete_revert_helper(hid_t fcpl_id) CHECK_I(file_id, "H5Fcreate"); /* Create and close the first dataset */ - dset_id = H5Dcreate(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); ret = H5Dclose(dset_id); CHECK_I(ret, "H5Dclose"); /* Create and close the second. These messages should be shared */ - dset_id = H5Dcreate(file_id, "dset2", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, "dset2", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); ret = H5Dclose(dset_id); CHECK_I(ret, "H5Dclose"); @@ -3084,8 +3084,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id) /* Create a dataset through the external link */ space_id = H5Screate_simple(2, dims, dims); CHECK_I(space_id, "H5Screate_simple"); - dset_id = H5Dcreate(src_file_id, "ext_link/dataset", H5T_NATIVE_FLOAT, space_id, H5P_DEFAULT); - CHECK_I(dset_id, "H5Dcreate"); + dset_id = H5Dcreate2(src_file_id, "ext_link/dataset", H5T_NATIVE_FLOAT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK_I(dset_id, "H5Dcreate2"); /* Close the dataset and both files to make sure everything gets flushed * out of memory @@ -3199,8 +3199,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen) /* Create a dataspace and a dataset*/ orig_space_id = H5Screate_simple(EXTEND_NDIMS, dims1, max_dims); CHECK_I(orig_space_id, "H5Screate_simple"); - dset1_id = H5Dcreate(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, dcpl_id); - CHECK_I(dset1_id, "H5Dcreate"); + dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK_I(dset1_id, "H5Dcreate2"); if(close_reopen) { /* If requested, close all open IDs and reopen them */ @@ -3216,8 +3216,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen) } /* Create another dataset starting with the same dataspace */ - dset2_id = H5Dcreate(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, dcpl_id); - CHECK_I(dset2_id, "H5Dcreate"); + dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK_I(dset2_id, "H5Dcreate2"); if(close_reopen) { /* If requested, close all open IDs and reopen them */ @@ -3237,8 +3237,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen) } /* Create a third dataset with the same dataspace */ - dset3_id = H5Dcreate(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, dcpl_id); - CHECK_I(dset3_id, "H5Dcreate"); + dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK_I(dset3_id, "H5Dcreate2"); if(close_reopen) { /* If requested, close all open IDs and reopen them */ @@ -3465,8 +3465,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen) */ file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT); CHECK_I(file_id, "H5Fcreate"); - dset1_id = H5Dcreate(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, dcpl_id); - CHECK_I(dset1_id, "H5Dcreate"); + dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK_I(dset1_id, "H5Dcreate2"); if(close_reopen) { /* If requested, close all open IDs and reopen them */ ret = H5Dclose(dset1_id); @@ -3499,8 +3499,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen) /* Create the second dataset. Its dataspace will be unshared and then * become shared when extended. */ - dset2_id = H5Dcreate(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, dcpl_id); - CHECK_I(dset2_id, "H5Dcreate"); + dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK_I(dset2_id, "H5Dcreate2"); if(close_reopen) { /* If requested, close all open IDs and reopen them */ ret = H5Dclose(dset1_id); @@ -3541,8 +3541,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen) /* Create the third dataset. Its dataspace will be unshared and then * become shared when extended. */ - dset3_id = H5Dcreate(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, dcpl_id); - CHECK_I(dset3_id, "H5Dcreate"); + dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK_I(dset3_id, "H5Dcreate2"); if(close_reopen) { /* If requested, close all open IDs and reopen them */ ret = H5Dclose(dset1_id); diff --git a/test/ttime.c b/test/ttime.c index 87e57dc..4762656 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -150,8 +150,8 @@ test_time_io(void) CHECK(sid, FAIL, "H5Screate"); /* Create a dataset with a time datatype */ - dsid = H5Dcreate(fid, DATASETNAME, H5T_UNIX_D32LE, sid, H5P_DEFAULT); - CHECK(dsid, FAIL, "H5Dcreate"); + dsid = H5Dcreate2(fid, DATASETNAME, H5T_UNIX_D32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dsid, FAIL, "H5Dcreate2"); /* Initialize time data value */ timenow = HDtime(NULL); diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index 6409bb1..c9dd64d 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -100,13 +100,13 @@ void tts_acreate(void) H5Tset_order(datatype, H5T_ORDER_LE); /* create a new dataset within the file */ - dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT); - assert(dataset>=0); + dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dataset >= 0); /* initialize data for dataset and write value to dataset */ data = NUM_THREADS; - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data); - assert(ret>=0); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data); + assert(ret >= 0); /* * Simultaneously create a large number of attributes to be associated diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 92eff41..1cc2e8c 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -30,7 +30,7 @@ * ttsafe_cancel.h5 * * HDF5 APIs exercised in thread: - * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dclose, + * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose, * H5Dwrite, H5Dread, H5Diterate, H5Tclose, H5Sclose. * * Created: May 15 2000 @@ -130,18 +130,18 @@ void *tts_cancel_thread(void UNUSED *arg) /* define dataspace for dataset */ dimsf[0] = 1; - dataspace = H5Screate_simple(1,dimsf,NULL); - assert(dataspace>=0); + dataspace = H5Screate_simple(1, dimsf, NULL); + assert(dataspace >= 0); /* define datatype for the data using native little endian integers */ datatype = H5Tcopy(H5T_NATIVE_INT); - assert(datatype>=0); - ret=H5Tset_order(datatype, H5T_ORDER_LE); - assert(ret>=0); + assert(datatype >= 0); + ret = H5Tset_order(datatype, H5T_ORDER_LE); + assert(ret >= 0); /* create a new dataset within the file */ - dataset = H5Dcreate(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT); - assert(dataset>=0); + dataset = H5Dcreate2(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dataset >= 0); /* If thread is cancelled, make cleanup call */ cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t)); diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index 4faf2bc..35453ad 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -26,7 +26,7 @@ * ttsafe_dcreate.h5 * * HDF5 APIs exercised in thread: - * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dwrite, H5Dclose, + * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dwrite, H5Dclose, * H5Tclose, H5Sclose. * * Created: Apr 28 2000 @@ -163,39 +163,40 @@ void tts_dcreate(void) void *tts_dcreate_creator(void *_thread_data) { - hid_t dataspace, dataset; - herr_t ret; - hsize_t dimsf[1]; /* dataset dimensions */ - struct thread_info thread_data; - - memcpy(&thread_data,_thread_data,sizeof(struct thread_info)); - - /* define dataspace for dataset */ - dimsf[0] = 1; - dataspace = H5Screate_simple(1,dimsf,NULL); - assert(dataspace>=0); - - /* create a new dataset within the file */ - dataset = H5Dcreate(thread_data.file, thread_data.dsetname, - H5T_NATIVE_INT, dataspace, H5P_DEFAULT); - assert(dataset>=0); - - /* initialize data for dataset and write value to dataset */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - H5P_DEFAULT, &thread_data.id); - assert(ret>=0); - - /* close dataset and dataspace resources */ - ret=H5Dclose(dataset); - assert(ret>=0); - ret=H5Sclose(dataspace); - assert(ret>=0); - - return NULL; + hid_t dataspace, dataset; + herr_t ret; + hsize_t dimsf[1]; /* dataset dimensions */ + struct thread_info thread_data; + + memcpy(&thread_data, _thread_data, sizeof(struct thread_info)); + + /* define dataspace for dataset */ + dimsf[0] = 1; + dataspace = H5Screate_simple(1, dimsf, NULL); + assert(dataspace >= 0); + + /* create a new dataset within the file */ + dataset = H5Dcreate2(thread_data.file, thread_data.dsetname, + H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(dataset >= 0); + + /* initialize data for dataset and write value to dataset */ + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, &thread_data.id); + assert(ret >= 0); + + /* close dataset and dataspace resources */ + ret = H5Dclose(dataset); + assert(ret >= 0); + ret = H5Sclose(dataspace); + assert(ret >= 0); + + return NULL; } void cleanup_dcreate(void) { - HDunlink(FILENAME); + HDunlink(FILENAME); } #endif /*H5_HAVE_THREADSAFE*/ + diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 3989e73..7659a3e 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -29,7 +29,7 @@ * * HDF5 APIs exercised in thread: * - * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dclose, + * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose, * H5Tclose, H5Sclose. * * Created: Apr 28 2000 @@ -176,26 +176,26 @@ void *tts_error_thread(void UNUSED *arg) /* define dataspace for dataset */ dimsf[0] = 1; - dataspace = H5Screate_simple(1,dimsf,NULL); - assert(dataspace>=0); + dataspace = H5Screate_simple(1, dimsf, NULL); + assert(dataspace >= 0); /* define datatype for the data using native little endian integers */ datatype = H5Tcopy(H5T_NATIVE_INT); - assert(datatype>=0); + assert(datatype >= 0); H5Tset_order(datatype, H5T_ORDER_LE); /* create a new dataset within the file */ - dataset = H5Dcreate(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT); - if (dataset >= 0) { /* not an error */ + dataset = H5Dcreate2(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dataset >= 0) { /* not an error */ value = WRITE_NUMBER; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value); H5Dclose(dataset); - } + } /* end if */ - ret=H5Tclose(datatype); - assert(ret>=0); - ret=H5Sclose(dataspace); - assert(ret>=0); + ret = H5Tclose(datatype); + assert(ret >= 0); + ret = H5Sclose(dataspace); + assert(ret >= 0); /* turn our error stack handler off */ H5Eset_auto2(H5E_DEFAULT, old_error_cb, old_error_client_data); diff --git a/test/tunicode.c b/test/tunicode.c index f34e19f..873918a 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -68,7 +68,7 @@ void dump_string(const char * string); void test_fl_string(hid_t fid, const char *string) { hid_t dtype_id, space_id, dset_id; - hsize_t dims=1; + hsize_t dims = 1; char read_buf[MAX_STRING_LENGTH]; H5T_cset_t cset; herr_t ret; @@ -80,19 +80,20 @@ void test_fl_string(hid_t fid, const char *string) CHECK(dtype_id, FAIL, "H5Tcopy"); ret = H5Tset_size(dtype_id, (size_t)MAX_STRING_LENGTH); CHECK(ret, FAIL, "H5Tset_size"); - cset=H5Tget_cset(dtype_id); + cset = H5Tget_cset(dtype_id); VERIFY(cset, H5T_CSET_ASCII, "H5Tget_cset"); - ret=H5Tset_cset(dtype_id, H5T_CSET_UTF8); + ret = H5Tset_cset(dtype_id, H5T_CSET_UTF8); CHECK(ret, FAIL, "H5Tset_cset"); - cset=H5Tget_cset(dtype_id); + cset = H5Tget_cset(dtype_id); VERIFY(cset, H5T_CSET_UTF8, "H5Tget_cset"); /* Create dataspace for a dataset */ space_id = H5Screate_simple(RANK, &dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); + /* Create a dataset */ - dset_id=H5Dcreate(fid, DSET1_NAME, dtype_id, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(fid, DSET1_NAME, dtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write UTF-8 string to dataset */ ret = H5Dwrite(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, string); @@ -102,15 +103,15 @@ void test_fl_string(hid_t fid, const char *string) ret = H5Dread(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); CHECK(ret, FAIL, "H5Dread"); - VERIFY(strcmp(string, read_buf), 0, "strcmp"); + VERIFY(HDstrcmp(string, read_buf), 0, "strcmp"); /* Close all */ - ret=H5Dclose(dset_id); + ret = H5Dclose(dset_id); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Tclose(dtype_id); + ret = H5Tclose(dtype_id); CHECK(ret, FAIL, "H5Tclose"); - ret=H5Sclose(space_id); + ret = H5Sclose(space_id); CHECK(ret, FAIL, "H5Sclose"); } @@ -322,7 +323,7 @@ void test_strpad(hid_t UNUSED fid, const char *string) void test_vl_string(hid_t fid, const char *string) { hid_t type_id, space_id, dset_id; - hsize_t dims=1; + hsize_t dims = 1; hsize_t size; /* Number of bytes used */ char *read_buf[1]; herr_t ret; @@ -338,27 +339,27 @@ void test_vl_string(hid_t fid, const char *string) CHECK(ret, FAIL, "H5Tset_size"); /* Create a dataset */ - dset_id=H5Dcreate(fid, VL_DSET1_NAME, type_id, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(fid, VL_DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string); + ret = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string); CHECK(ret, FAIL, "H5Dwrite"); /* Make certain the correct amount of memory will be used */ - ret=H5Dvlen_get_buf_size(dset_id, type_id, space_id, &size); + ret = H5Dvlen_get_buf_size(dset_id, type_id, space_id, &size); CHECK(ret, FAIL, "H5Dvlen_get_buf_size"); - VERIFY(size, (hsize_t)strlen(string) + 1, "H5Dvlen_get_buf_size"); + VERIFY(size, (hsize_t)HDstrlen(string) + 1, "H5Dvlen_get_buf_size"); /* Read dataset from disk */ - ret=H5Dread(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); + ret = H5Dread(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - VERIFY(strcmp(string, read_buf[0]), 0, "strcmp"); + VERIFY(HDstrcmp(string, read_buf[0]), 0, "strcmp"); /* Reclaim the read VL data */ - ret=H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf); + ret = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf); CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* Close all */ @@ -405,7 +406,7 @@ void test_objnames(hid_t fid, const char* string) ret = H5Gclose(grp_id); CHECK(ret, FAIL, "H5Gclose"); - VERIFY(strcmp(string, read_buf), 0, "strcmp"); + VERIFY(HDstrcmp(string, read_buf), 0, "strcmp"); /* Create a new dataset with a UTF-8 name */ grp1_id = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -413,8 +414,8 @@ void test_objnames(hid_t fid, const char* string) space_id = H5Screate_simple(RANK, &dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dset_id = H5Dcreate(grp1_id, string, H5T_NATIVE_INT, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(grp1_id, string, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Make sure that dataset can be opened again */ ret = H5Dclose(dset_id); @@ -450,8 +451,8 @@ void test_objnames(hid_t fid, const char* string) space_id = H5Screate_simple(RANK, &dims, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dset_id=H5Dcreate(grp2_id, DSET3_NAME, H5T_STD_REF_OBJ, space_id, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(grp2_id, DSET3_NAME, H5T_STD_REF_OBJ, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to named datatype */ ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, -1); @@ -599,8 +600,8 @@ void test_compound(hid_t fid, const char * string) CHECK(ret, FAIL, "H5Tinsert"); /* Check that the field name was stored correctly */ - readbuf=H5Tget_member_name(s1_tid, 0); - ret = strcmp(readbuf, string); + readbuf = H5Tget_member_name(s1_tid, 0); + ret = HDstrcmp(readbuf, string); VERIFY(ret, 0, "strcmp"); free(readbuf); @@ -621,8 +622,8 @@ void test_compound(hid_t fid, const char * string) /* Create the dataspace and dataset. */ space_id = H5Screate_simple(1, &dim, NULL); CHECK(space_id, FAIL, "H5Screate_simple"); - dset_id = H5Dcreate(fid, DSET4_NAME, s1_tid, space_id, H5P_DEFAULT); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(fid, DSET4_NAME, s1_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); /* Write data to the dataset. */ ret = H5Dwrite(dset_id, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &s1); diff --git a/test/tvlstr.c b/test/tvlstr.c index b1ba48e..a6d3851 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -152,29 +152,29 @@ test_vlstrings_basic(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid1 = H5Tcopy (H5T_C_S1); + tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); - ret = H5Tset_size (tid1,H5T_VARIABLE); + ret = H5Tset_size(tid1,H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); dataspace = H5Screate(H5S_SCALAR); - dataset2=H5Dcreate(fid1,"Dataset2",tid1,dataspace,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset2 = H5Dcreate2(fid1, "Dataset2", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); wdata2 = (char*)HDcalloc((size_t)65534, sizeof(char)); HDmemset(wdata2, 'A', (size_t)65533); - ret=H5Dwrite(dataset2,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata2); + ret = H5Dwrite(dataset2, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2); CHECK(ret, FAIL, "H5Dwrite"); H5Sclose(dataspace); @@ -182,7 +182,7 @@ test_vlstrings_basic(void) HDfree(wdata2); /* Change to the custom memory allocation routines for reading VL string */ - xfer_pid=H5Pcreate(H5P_DATASET_XFER); + xfer_pid = H5Pcreate(H5P_DATASET_XFER); CHECK(xfer_pid, FAIL, "H5Pcreate"); ret=H5Pset_vlen_mem_manager(xfer_pid,test_vlstr_alloc_custom,&mem_used,test_vlstr_free_custom,&mem_used); @@ -281,51 +281,51 @@ test_vlstrings_special(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid1 = H5Tcopy (H5T_C_S1); + tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); - ret = H5Tset_size (tid1,H5T_VARIABLE); + ret = H5Tset_size(tid1,H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset3",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Read from dataset before writing data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i]!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i] != NULL) TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - for(i=0; i<SPACE1_DIM1; i++) { - if(HDstrlen(wdata[i])!=strlen(rdata[i])) { + for(i = 0; i < SPACE1_DIM1; i++) { + if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ - if((wdata[i]==NULL && rdata[i]!=NULL) || (rdata[i]==NULL && wdata[i]!=NULL)) { + if((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) { TestErrPrintf("VL data values don't match!\n"); continue; } /* end if */ - if( HDstrcmp(wdata[i],rdata[i]) != 0 ) { + if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); continue; } /* end if */ } /* end for */ /* Reclaim the read VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,rdata); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* Close Dataset */ @@ -333,41 +333,41 @@ test_vlstrings_special(void) CHECK(ret, FAIL, "H5Dclose"); /* Create another dataset to test nil strings */ - dcpl=H5Pcreate(H5P_DATASET_CREATE); + dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); /* Set the fill value for the second dataset */ - fill=NULL; - ret=H5Pset_fill_value(dcpl, tid1, &fill); + fill = NULL; + ret = H5Pset_fill_value(dcpl, tid1, &fill); CHECK(ret, FAIL, "H5Pset_fill_value"); - dataset=H5Dcreate(fid1,"Dataset4",tid1,sid1,dcpl); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset4", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataset creation property list */ ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); /* Read from dataset before writing data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i]!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i] != NULL) TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]); /* Try to write nil strings to disk. */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2); CHECK(ret, FAIL, "H5Dwrite"); /* Read nil strings back from disk */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i]!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i] != NULL) TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]); /* Close Dataset */ @@ -518,31 +518,31 @@ test_compact_vlstring(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset5",tid1,sid1,plist); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset5", tid1, sid1, H5P_DEFAULT, plist, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - for(i=0; i<SPACE1_DIM1; i++) { - if(HDstrlen(wdata[i])!=strlen(rdata[i])) { + for(i = 0; i < SPACE1_DIM1; i++) { + if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ - if( HDstrcmp(wdata[i],rdata[i]) != 0 ) { + if(HDstrcmp(wdata[i], rdata[i]) != 0) { TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); continue; } /* end if */ } /* end for */ /* Reclaim the read VL data */ - ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,rdata); + ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* Close Dataset */ @@ -728,8 +728,8 @@ static void write_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, c hid_t dset; herr_t ret; - dset = H5Dcreate(file, name, type, space, H5P_DEFAULT); - CHECK(dset, FAIL, "H5Dcreate"); + dset = H5Dcreate2(file, name, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset, FAIL, "H5Dcreate2"); ret = H5Dwrite(dset, type, space, space, H5P_DEFAULT, &data); CHECK(ret, FAIL, "H5Dwrite"); diff --git a/test/tvltypes.c b/test/tvltypes.c index eeadc45..1ea0eaa 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -130,22 +130,22 @@ test_vltypes_dataset_create(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid1 = H5Tvlen_create (H5T_NATIVE_UINT); + tid1 = H5Tvlen_create(H5T_NATIVE_UINT); CHECK(tid1, FAIL, "H5Tvlen_create"); /* Create dataset property list */ - dcpl=H5Pcreate(H5P_DATASET_CREATE); + dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); /* Set fill value writting time to be NEVER */ - ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); CHECK(ret, FAIL, "H5Pset_fill_time"); /* Create a dataset, supposed to fail */ H5E_BEGIN_TRY { - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,dcpl); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(dataset, FAIL, "H5Dcreate"); + VERIFY(dataset, FAIL, "H5Dcreate2"); /* Close datatype */ ret = H5Tclose(tid1); @@ -277,33 +277,33 @@ test_vltypes_vlen_atomic(void) CHECK(tid1, FAIL, "H5Tvlen_create"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Read from dataset before writing data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i].len!=0 || rdata[i].p!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i].len != 0 || rdata[i].p != NULL) TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p); /* Write "nil" data to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2); CHECK(ret, FAIL, "H5Dwrite"); /* Read from dataset with "nil" data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i].len!=0 || rdata[i].p!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i].len != 0 || rdata[i].p != NULL) TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Close Dataset */ @@ -311,42 +311,42 @@ test_vltypes_vlen_atomic(void) CHECK(ret, FAIL, "H5Dclose"); /* Create second dataset, with fill value */ - dcpl_pid=H5Pcreate(H5P_DATASET_CREATE); + dcpl_pid = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl_pid, FAIL, "H5Pcreate"); /* Set the fill value for the second dataset */ - fill.p=NULL; fill.len=0; - ret=H5Pset_fill_value(dcpl_pid, tid1, &fill); + fill.p = NULL; fill.len = 0; + ret = H5Pset_fill_value(dcpl_pid, tid1, &fill); CHECK(ret, FAIL, "H5Pset_fill_value"); /* Create a second dataset */ - dataset=H5Dcreate(fid1,"Dataset2",tid1,sid1,dcpl_pid); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset2", tid1, sid1, H5P_DEFAULT, dcpl_pid, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataset creation property list */ ret = H5Pclose(dcpl_pid); CHECK(ret, FAIL, "H5Pclose"); /* Read from dataset before writing data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i].len!=0 || rdata[i].p!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i].len != 0 || rdata[i].p != NULL) TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p); /* Write "nil" data to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2); CHECK(ret, FAIL, "H5Dwrite"); /* Read from dataset with "nil" data */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i].len!=0 || rdata[i].p!=NULL) + if(rdata[i].len != 0 || rdata[i].p != NULL) TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p); /* Write data to disk */ @@ -753,39 +753,39 @@ test_vltypes_vlen_compound(void) CHECK(tid2, FAIL, "H5Tcreate"); /* Insert fields */ - ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); + ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); /* Create a datatype to refer to */ - tid1 = H5Tvlen_create (tid2); + tid1 = H5Tvlen_create(tid2); CHECK(tid1, FAIL, "H5Tvlen_create"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Change to the custom memory allocation routines for reading VL data */ - xfer_pid=H5Pcreate(H5P_DATASET_XFER); + xfer_pid = H5Pcreate(H5P_DATASET_XFER); CHECK(xfer_pid, FAIL, "H5Pcreate"); - ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used); + ret = H5Pset_vlen_mem_manager(xfer_pid, test_vltypes_alloc_custom, &mem_used, test_vltypes_free_custom, &mem_used); CHECK(ret, FAIL, "H5Pset_vlen_mem_manager"); /* Make certain the correct amount of memory will be used */ - ret=H5Dvlen_get_buf_size(dataset,tid1,sid1,&size); + ret = H5Dvlen_get_buf_size(dataset, tid1, sid1, &size); CHECK(ret, FAIL, "H5Dvlen_get_buf_size"); /* 10 elements allocated = 1 + 2 + 3 + 4 elements for each array position */ - VERIFY(size,((SPACE1_DIM1*(SPACE1_DIM1+1))/2)*sizeof(s1),"H5Dvlen_get_buf_size"); + VERIFY(size, ((SPACE1_DIM1 * (SPACE1_DIM1 + 1)) / 2) * sizeof(s1), "H5Dvlen_get_buf_size"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,xfer_pid,rdata); + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, xfer_pid, rdata); CHECK(ret, FAIL, "H5Dread"); /* Make certain the correct amount of memory has been used */ @@ -1063,8 +1063,8 @@ test_vltypes_compound_vlen_vlen(void) CHECK(ret, FAIL, "H5Tinsert"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -1268,8 +1268,8 @@ test_vltypes_compound_vlstr(void) CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a dataset */ - dataset = H5Dcreate(fid1, "Dataset1", tid2, sid1, cparms); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, cparms, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Extend the dataset. This call assures that dataset is 4.*/ ret = H5Dset_extent(dataset, size); @@ -1508,37 +1508,37 @@ test_vltypes_compound_vlen_atomic(void) CHECK(tid2, FAIL, "H5Tcreate"); /* Insert fields */ - ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); + ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); + ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); - ret=H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); + ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); CHECK(ret, FAIL, "H5Tinsert"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Change to the custom memory allocation routines for reading VL data */ - xfer_pid=H5Pcreate(H5P_DATASET_XFER); + xfer_pid = H5Pcreate(H5P_DATASET_XFER); CHECK(xfer_pid, FAIL, "H5Pcreate"); - ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used); + ret = H5Pset_vlen_mem_manager(xfer_pid, test_vltypes_alloc_custom, &mem_used, test_vltypes_free_custom, &mem_used); CHECK(ret, FAIL, "H5Pset_vlen_mem_manager"); /* Make certain the correct amount of memory will be used */ - ret=H5Dvlen_get_buf_size(dataset,tid2,sid1,&size); + ret = H5Dvlen_get_buf_size(dataset, tid2, sid1, &size); CHECK(ret, FAIL, "H5Dvlen_get_buf_size"); /* 10 elements allocated = 1 + 2 + 3 + 4 elements for each array position */ - VERIFY(size,((SPACE1_DIM1*(SPACE1_DIM1+1))/2)*sizeof(unsigned int),"H5Dvlen_get_buf_size"); + VERIFY(size, ((SPACE1_DIM1 * (SPACE1_DIM1 + 1)) / 2) * sizeof(unsigned int), "H5Dvlen_get_buf_size"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid2,H5S_ALL,H5S_ALL,xfer_pid,rdata); + ret = H5Dread(dataset, tid2, H5S_ALL, H5S_ALL, xfer_pid, rdata); CHECK(ret, FAIL, "H5Dread"); /* Make certain the correct amount of memory has been used */ @@ -1568,52 +1568,52 @@ test_vltypes_compound_vlen_atomic(void) } /* end for */ /* Reclaim the VL data */ - ret=H5Dvlen_reclaim(tid2,sid1,xfer_pid,rdata); + ret = H5Dvlen_reclaim(tid2, sid1, xfer_pid, rdata); CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* Make certain the VL memory has been freed */ - VERIFY(mem_used,0,"H5Dvlen_reclaim"); + VERIFY(mem_used, 0, "H5Dvlen_reclaim"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Create a second dataset, with a fill value */ - dcpl_pid=H5Pcreate(H5P_DATASET_CREATE); + dcpl_pid = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl_pid, FAIL, "H5Pcreate"); /* Set the fill value for the second dataset */ - HDmemset(&fill,0,sizeof(s1)); - ret=H5Pset_fill_value(dcpl_pid, tid2, &fill); + HDmemset(&fill, 0, sizeof(s1)); + ret = H5Pset_fill_value(dcpl_pid, tid2, &fill); CHECK(ret, FAIL, "H5Pset_fill_value"); - dataset=H5Dcreate(fid1,"Dataset2",tid2,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset2", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Close dataset creation property list */ ret = H5Pclose(dcpl_pid); CHECK(ret, FAIL, "H5Pclose"); /* Read from dataset before writing data */ - ret=H5Dread(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Check data read in */ - for(i=0; i<SPACE1_DIM1; i++) - if(rdata[i].i!=0 || !FLT_ABS_EQUAL(rdata[i].f,0.0) || rdata[i].v.len!=0 || rdata[i].v.p!=NULL) + for(i = 0; i < SPACE1_DIM1; i++) + if(rdata[i].i != 0 || !FLT_ABS_EQUAL(rdata[i].f, 0.0) || rdata[i].v.len != 0 || rdata[i].v.p != NULL) TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Read dataset from disk */ - ret=H5Dread(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata); + ret = H5Dread(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); CHECK(ret, FAIL, "H5Dread"); /* Compare data read in */ - for(i=0; i<SPACE1_DIM1; i++) { - if(wdata[i].i!=rdata[i].i) { + for(i = 0; i < SPACE1_DIM1; i++) { + if(wdata[i].i != rdata[i].i) { TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i); continue; } /* end if */ @@ -1905,11 +1905,11 @@ test_vltypes_vlen_vlen_atomic(void) CHECK(tid2, FAIL, "H5Tvlen_create"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate"); + dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); /* Write dataset to disk */ - ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata); + ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); /* Close Dataset */ @@ -2608,8 +2608,8 @@ test_vltypes_fill_value(void) } /* end switch */ /* Create first data set with default setting - no space is allocated */ - dset_id = H5Dcreate(file_id, dset_name1, dtype1_id, dset_dspace_id, tmp_dcpl_id); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, dset_name1, dtype1_id, dset_dspace_id, H5P_DEFAULT, tmp_dcpl_id, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); ret = H5Dclose(dset_id); CHECK(ret, FAIL, "H5Dclose"); @@ -2622,8 +2622,8 @@ test_vltypes_fill_value(void) ret = H5Pset_alloc_time(tmp_dcpl_id, H5D_ALLOC_TIME_EARLY); CHECK(ret, FAIL, "H5Pset_alloc_time"); - dset_id = H5Dcreate(file_id, dset_name2, dtype1_id, dset_dspace_id, tmp_dcpl_id); - CHECK(dset_id, FAIL, "H5Dcreate"); + dset_id = H5Dcreate2(file_id, dset_name2, dtype1_id, dset_dspace_id, H5P_DEFAULT, tmp_dcpl_id, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate2"); ret = H5Dclose(dset_id); CHECK(ret, FAIL, "H5Dclose"); diff --git a/test/unlink.c b/test/unlink.c index 1248063..e1fc7f4 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -612,7 +612,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Remove the dataset */ @@ -637,7 +637,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Remove the dataset */ @@ -662,7 +662,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, late_chunk_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, late_chunk_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Remove the dataset */ @@ -687,7 +687,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, early_chunk_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, early_chunk_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Remove the dataset */ @@ -712,7 +712,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, comp_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, comp_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Remove the dataset */ @@ -740,7 +740,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_nocache)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, comp_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, comp_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Alternate re-writing dataset with compressible & random data */ for(u = 0; u < FILESPACE_REWRITE; u++) { @@ -784,7 +784,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, compact_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, compact_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Remove the dataset */ @@ -812,8 +812,8 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create datasets to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR - if((dataset2 = H5Dcreate(file, DATASET2NAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2 = H5Dcreate2(file, DATASET2NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a dataspace for the attributes */ if((attr_space = H5Screate_simple(FILESPACE_ATTR_NDIMS, attr_dims, NULL)) < 0) FAIL_STACK_ERROR @@ -1011,7 +1011,7 @@ test_filespace(hid_t fapl) for(w = 0; w < FILESPACE_NDATASETS; w++) { /* Create & close a dataset */ sprintf(objname, "%s %u", DATASETNAME, w); - if((dataset = H5Dcreate(group2, objname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(group2, objname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1079,12 +1079,12 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a single dataset to remove */ - if((dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR /* Create another dataset with same name */ H5E_BEGIN_TRY { - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT); + dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(dataset >= 0) { H5Dclose(dataset); @@ -1185,7 +1185,7 @@ test_filespace(hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create datasets to remove */ - if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR + if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a dataspace for the attributes */ if((attr_space = H5Screate_simple(FILESPACE_ATTR_NDIMS, attr_dims, NULL)) < 0) FAIL_STACK_ERROR @@ -1853,7 +1853,7 @@ test_resurrect_dataset(hid_t fapl) /* Create a dataset in the file */ if((s = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR - if((d = H5Dcreate(f, DATASETNAME, H5T_NATIVE_INT, s, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((d = H5Dcreate2(f, DATASETNAME, H5T_NATIVE_INT, s, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Sclose(s) < 0) FAIL_STACK_ERROR /* Unlink the dataset while it's open (will mark it for deletion when closed) */ @@ -2065,19 +2065,19 @@ test_unlink_chunked_dataset(hid_t fapl) if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create the dataspace */ - if((space_id = H5Screate_simple(FILESPACE_NDIMS,dims,max_dims)) < 0) FAIL_STACK_ERROR + if((space_id = H5Screate_simple(FILESPACE_NDIMS, dims, max_dims)) < 0) FAIL_STACK_ERROR /* Create the dataset creation filter */ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR /* Set to chunked storage */ - if(H5Pset_chunk(dcpl_id,FILESPACE_NDIMS,chunk_dims) < 0) FAIL_STACK_ERROR + if(H5Pset_chunk(dcpl_id, FILESPACE_NDIMS, chunk_dims) < 0) FAIL_STACK_ERROR /* Set to early space allocation */ - if(H5Pset_alloc_time(dcpl_id,H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR + if(H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR /* Create the dataset */ - if((dset_id = H5Dcreate(file_id,DATASETNAME,H5T_NATIVE_INT,space_id,dcpl_id)) < 0) FAIL_STACK_ERROR + if((dset_id = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close the dataspace */ if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR @@ -243,7 +243,7 @@ test_direct(void) TEST_ERROR; /* Create the dset1 */ - if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -278,7 +278,7 @@ test_direct(void) TEST_ERROR; /* Create the dset2 */ - if((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0) + if((dset2 = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -438,7 +438,7 @@ test_core(void) TEST_ERROR; /* Create the dset1 */ - if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -482,7 +482,7 @@ test_core(void) TEST_ERROR; /* Create the dset1 */ - if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0) + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ @@ -706,7 +706,7 @@ test_family(void) if (H5Pclose(access_fapl) < 0) TEST_ERROR; - if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) + if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i=0; i<FAMILY_NUMBER; i++) @@ -1013,7 +1013,7 @@ test_multi(void) if(file_size < HADDR_MAX/4 || file_size > HADDR_MAX/2) TEST_ERROR; - if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) + if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i=0; i<MULTI_SIZE; i++) |