mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[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
This commit is contained in:
parent
053807fa81
commit
d9e5ca72f3
@ -164,13 +164,13 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
|
||||
hid_t space_id = data_space.getId();
|
||||
hid_t create_plist_id = create_plist.getId();
|
||||
|
||||
// Call C routine H5Dcreate to create the named dataset
|
||||
hid_t dataset_id = H5Dcreate( getLocId(), name, type_id, space_id, create_plist_id );
|
||||
// Call C routine H5Dcreate2 to create the named dataset
|
||||
hid_t dataset_id = H5Dcreate2( getLocId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT );
|
||||
|
||||
// If the creation of the dataset failed, throw an exception
|
||||
if( dataset_id < 0 )
|
||||
{
|
||||
throwException("createDataSet", "H5Dcreate failed");
|
||||
throwException("createDataSet", "H5Dcreate2 failed");
|
||||
}
|
||||
|
||||
// No failure, create and return the DataSet object
|
||||
|
@ -22,7 +22,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group
|
||||
dataspace = H5Screate_simple(rank, dimsf, NULL);
|
||||
|
||||
/* Create a dataset */
|
||||
dataset = H5Dcreate(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
<Write data to first dataset>
|
||||
|
||||
|
@ -95,7 +95,7 @@ main (void)
|
||||
/*
|
||||
* Create the dataset in the file.
|
||||
*/
|
||||
dataset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, fid, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, fid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write data to the dataset.
|
||||
|
@ -87,7 +87,7 @@ main(void)
|
||||
/*
|
||||
* Create the dataset.
|
||||
*/
|
||||
dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(file, DATASETNAME, s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Wtite data to the dataset;
|
||||
|
@ -99,7 +99,7 @@ main (void)
|
||||
* Create a new dataset within the file using defined dataspace and
|
||||
* datatype and default dataset creation properties.
|
||||
*/
|
||||
dataset = H5Dcreate(file, "data_no_trans", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(file, "data_no_trans", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
printf("\nOriginal Data: \n");
|
||||
|
||||
PRINT(windchillF);
|
||||
|
@ -81,8 +81,8 @@ main (void)
|
||||
* Create a new dataset within the file using cparms
|
||||
* creation properties.
|
||||
*/
|
||||
dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, dataspace,
|
||||
cparms);
|
||||
dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
|
||||
cparms, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Extend the dataset. This call assures that dataset is at least 3 x 3.
|
||||
|
@ -71,8 +71,8 @@ main(void)
|
||||
plist = H5Pcreate(H5P_DATASET_CREATE);
|
||||
H5Pset_chunk(plist, 2, cdims);
|
||||
H5Pset_deflate( plist, 6);
|
||||
dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT,
|
||||
dataspace, plist);
|
||||
dataset = H5Dcreate2(file, "/Data/Compressed_Data", H5T_NATIVE_INT,
|
||||
dataspace, H5P_DEFAULT, plist, H5P_DEFAULT);
|
||||
/*
|
||||
* Close the first dataset .
|
||||
*/
|
||||
@ -85,8 +85,8 @@ main(void)
|
||||
dims[0] = 500;
|
||||
dims[1] = 20;
|
||||
dataspace = H5Screate_simple(RANK, dims, NULL);
|
||||
dataset = H5Dcreate(file, "/Data/Float_Data", H5T_NATIVE_FLOAT,
|
||||
dataspace, H5P_DEFAULT);
|
||||
dataset = H5Dcreate2(file, "/Data/Float_Data", H5T_NATIVE_FLOAT,
|
||||
dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
*Close the second dataset and file.
|
||||
|
@ -45,10 +45,9 @@ int main(void)
|
||||
/*
|
||||
* Initialization of buffer matrix "bm"
|
||||
*/
|
||||
for(i =0; i<NX; i++) {
|
||||
for(j = 0; j<NY; j++)
|
||||
for(i =0; i < NX; i++)
|
||||
for(j = 0; j < NY; j++)
|
||||
bm[i][j] = i + j;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create first file and a group in it.
|
||||
@ -69,7 +68,7 @@ int main(void)
|
||||
dims[0] = NX;
|
||||
dims[1] = NY;
|
||||
sid = H5Screate_simple(RANK, dims, NULL);
|
||||
did = H5Dcreate(fid2, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT);
|
||||
did = H5Dcreate2(fid2, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write data to the dataset.
|
||||
|
@ -70,7 +70,7 @@ int main(void)
|
||||
/*
|
||||
* Create integer dataset.
|
||||
*/
|
||||
dsetv_id = H5Dcreate(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
|
||||
dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write data to the dataset.
|
||||
@ -81,7 +81,7 @@ int main(void)
|
||||
/*
|
||||
* Dataset with references.
|
||||
*/
|
||||
dsetr_id = H5Dcreate(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT);
|
||||
dsetr_id = H5Dcreate2(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Create a reference to the hyperslab.
|
||||
@ -90,7 +90,7 @@ int main(void)
|
||||
start[1] = 3;
|
||||
count[0] = 2;
|
||||
count[1] = 3;
|
||||
status = H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL);
|
||||
status = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL);
|
||||
status = H5Rcreate(&ref[0], file_id, dsetnamev, H5R_DATASET_REGION, space_id);
|
||||
|
||||
/*
|
||||
@ -136,14 +136,14 @@ int main(void)
|
||||
* Get name of the dataset the first region reference points to
|
||||
* using H5Rget_name
|
||||
*/
|
||||
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, 10);
|
||||
printf (" Dataset's name (returned by H5Rget_name) the reference points to is %s, name length is %d\n", buf1, (int)name_size1);
|
||||
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, 10);
|
||||
printf(" Dataset's name (returned by H5Rget_name) the reference points to is %s, name length is %d\n", buf1, (int)name_size1);
|
||||
/*
|
||||
* Get name of the dataset the first region reference points to
|
||||
* using H5Iget_name
|
||||
*/
|
||||
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, 10);
|
||||
printf (" Dataset's name (returned by H5Iget_name) the reference points to is %s, name length is %d\n", buf2, (int)name_size2);
|
||||
printf(" Dataset's name (returned by H5Iget_name) the reference points to is %s, name length is %d\n", buf2, (int)name_size2);
|
||||
|
||||
space_id = H5Rget_region(dsetr_id, H5R_DATASET_REGION,&ref_out[0]);
|
||||
|
||||
|
@ -61,7 +61,7 @@ main(void) {
|
||||
dim_b[0] = 2;
|
||||
dim_b[1] = 6;
|
||||
sid_b = H5Screate_simple(2, dim_b, NULL);
|
||||
did_b = H5Dcreate(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT);
|
||||
did_b = H5Dcreate2(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Create dataset "R" to store references to the objects "A" and "B".
|
||||
@ -69,13 +69,13 @@ main(void) {
|
||||
dim_r[0] = 2;
|
||||
sid_r = H5Screate_simple(1, dim_r, NULL);
|
||||
tid_r = H5Tcopy(H5T_STD_REF_OBJ);
|
||||
did_r = H5Dcreate(fid, "R", tid_r, sid_r, H5P_DEFAULT );
|
||||
did_r = H5Dcreate2(fid, "R", tid_r, sid_r, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Allocate write and read buffers.
|
||||
*/
|
||||
wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2);
|
||||
rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2);
|
||||
wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * 2);
|
||||
rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * 2);
|
||||
|
||||
/*
|
||||
* Create references to the group "A" and dataset "B"
|
||||
@ -87,8 +87,7 @@ main(void) {
|
||||
/*
|
||||
* Write dataset R using default transfer properties.
|
||||
*/
|
||||
status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL,
|
||||
H5P_DEFAULT, wbuf);
|
||||
status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
|
||||
|
||||
/*
|
||||
* Close all objects.
|
||||
@ -113,18 +112,17 @@ main(void) {
|
||||
* Open and read dataset "R".
|
||||
*/
|
||||
did_r = H5Dopen2(fid, "R", H5P_DEFAULT);
|
||||
status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL,
|
||||
H5P_DEFAULT, rbuf);
|
||||
status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
|
||||
|
||||
/*
|
||||
* Find the type of referenced objects.
|
||||
*/
|
||||
status = H5Rget_obj_type2(did_r, H5R_OBJECT, &rbuf[0], &obj_type);
|
||||
if ( obj_type == H5O_TYPE_GROUP )
|
||||
if(obj_type == H5O_TYPE_GROUP)
|
||||
printf("First dereferenced object is a group. \n");
|
||||
|
||||
status = H5Rget_obj_type2(did_r, H5R_OBJECT, &rbuf[1], &obj_type);
|
||||
if ( obj_type == H5O_TYPE_DATASET )
|
||||
if(obj_type == H5O_TYPE_DATASET)
|
||||
printf("Second dereferenced object is a dataset. \n");
|
||||
|
||||
/*
|
||||
@ -145,9 +143,7 @@ main(void) {
|
||||
H5Fclose(fid);
|
||||
free(rbuf);
|
||||
free(wbuf);
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -87,7 +87,8 @@ main (void)
|
||||
* Buffers' initialization.
|
||||
*/
|
||||
vector[0] = vector[MSPACE1_DIM - 1] = -1;
|
||||
for (i = 1; i < MSPACE1_DIM - 1; i++) vector[i] = i;
|
||||
for(i = 1; i < MSPACE1_DIM - 1; i++)
|
||||
vector[i] = i;
|
||||
|
||||
/*
|
||||
* Create a file.
|
||||
@ -109,7 +110,7 @@ main (void)
|
||||
* Create dataset in the file. Notice that creation
|
||||
* property list plist is used.
|
||||
*/
|
||||
dataset = H5Dcreate(file, "Matrix in file", H5T_NATIVE_INT, fid, plist);
|
||||
dataset = H5Dcreate2(file, "Matrix in file", H5T_NATIVE_INT, fid, H5P_DEFAULT, plist, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Select hyperslab for the dataset in the file, using 3x2 blocks,
|
||||
@ -302,8 +303,9 @@ main (void)
|
||||
* 0 0 0 0 0 0 0 0 0
|
||||
* 0 0 0 0 0 0 0 0 0
|
||||
*/
|
||||
for (i=0; i < MSPACE_DIM1; i++) {
|
||||
for(j=0; j < MSPACE_DIM2; j++) printf("%3d ", matrix_out[i][j]);
|
||||
for(i = 0; i < MSPACE_DIM1; i++) {
|
||||
for(j = 0; j < MSPACE_DIM2; j++)
|
||||
printf("%3d ", matrix_out[i][j]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@ -330,3 +332,4 @@ main (void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ create_standard_file(const char *filename, hid_t fcpl_id)
|
||||
*/
|
||||
for(x = 0; x < NUM_DATASETS; ++x) {
|
||||
/* Create a dataset */
|
||||
dset_id = H5Dcreate(file_id, DSETNAME[x], type_id, space_id, H5P_DEFAULT);
|
||||
dset_id = H5Dcreate2(file_id, DSETNAME[x], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_id < 0) goto error;
|
||||
|
||||
/* Create an attribute on the dataset */
|
||||
|
@ -39,10 +39,9 @@ main (void)
|
||||
/*
|
||||
* Data and output buffer initialization.
|
||||
*/
|
||||
for (j = 0; j < NX; j++) {
|
||||
for (i = 0; i < NY; i++)
|
||||
for(j = 0; j < NX; j++)
|
||||
for(i = 0; i < NY; i++)
|
||||
data[j][i] = i + j;
|
||||
}
|
||||
/*
|
||||
* 0 1 2 3 4 5
|
||||
* 1 2 3 4 5 6
|
||||
@ -77,14 +76,13 @@ 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.
|
||||
*/
|
||||
status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
|
||||
H5P_DEFAULT, data);
|
||||
status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
|
||||
|
||||
/*
|
||||
* Close/release resources.
|
||||
@ -96,3 +94,4 @@ main (void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -271,12 +271,12 @@ phdf5writeInd(char *filename)
|
||||
MESG("H5Pset_fapl_mpio succeed");
|
||||
|
||||
/* create the file collectively */
|
||||
fid1=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl1);
|
||||
fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl1);
|
||||
assert(fid1 != FAIL);
|
||||
MESG("H5Fcreate succeed");
|
||||
|
||||
/* Release file-access template */
|
||||
ret=H5Pclose(acc_tpl1);
|
||||
ret = H5Pclose(acc_tpl1);
|
||||
assert(ret != FAIL);
|
||||
|
||||
|
||||
@ -285,22 +285,22 @@ phdf5writeInd(char *filename)
|
||||
* and the slabs local to the MPI process.
|
||||
* ------------------------- */
|
||||
/* setup dimensionality object */
|
||||
sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL);
|
||||
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
|
||||
assert (sid1 != FAIL);
|
||||
MESG("H5Screate_simple succeed");
|
||||
|
||||
|
||||
/* create a dataset collectively */
|
||||
dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
|
||||
H5P_DEFAULT);
|
||||
dataset1 = H5Dcreate2(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
assert(dataset1 != FAIL);
|
||||
MESG("H5Dcreate succeed");
|
||||
MESG("H5Dcreate2 succeed");
|
||||
|
||||
/* create another dataset collectively */
|
||||
dataset2 = H5Dcreate(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1,
|
||||
H5P_DEFAULT);
|
||||
dataset2 = H5Dcreate2(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
assert(dataset2 != FAIL);
|
||||
MESG("H5Dcreate succeed");
|
||||
MESG("H5Dcreate2 succeed");
|
||||
|
||||
|
||||
|
||||
@ -538,14 +538,14 @@ phdf5writeAll(char *filename)
|
||||
|
||||
|
||||
/* create a dataset collectively */
|
||||
dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
|
||||
dataset1 = H5Dcreate2(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
assert(dataset1 != FAIL);
|
||||
MESG("H5Dcreate succeed");
|
||||
MESG("H5Dcreate2 succeed");
|
||||
|
||||
/* create another dataset collectively */
|
||||
dataset2 = H5Dcreate(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
|
||||
dataset2 = H5Dcreate2(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
assert(dataset2 != FAIL);
|
||||
MESG("H5Dcreate 2 succeed");
|
||||
MESG("H5Dcreate2 2 succeed");
|
||||
|
||||
/*
|
||||
* Set up dimensions of the slab this process accesses.
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Name: h5dcreate_c
|
||||
* Purpose: Call H5Dcreate to create a dataset
|
||||
* Purpose: Call H5Dcreate2 to create a dataset
|
||||
* Inputs: loc_id - file or group identifier
|
||||
* name - name of the dataset
|
||||
* namelen - name length
|
||||
@ -35,41 +35,29 @@
|
||||
int_f
|
||||
nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id)
|
||||
{
|
||||
int ret_value = -1;
|
||||
char *c_name;
|
||||
size_t c_namelen;
|
||||
hid_t c_loc_id;
|
||||
hid_t c_type_id;
|
||||
hid_t c_space_id;
|
||||
char *c_name = NULL;
|
||||
hid_t c_dset_id;
|
||||
hid_t c_crt_prp;
|
||||
|
||||
/*
|
||||
* Define creation property
|
||||
*/
|
||||
c_crt_prp = (hid_t)*crt_prp;
|
||||
int ret_value = -1;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
c_namelen = *namelen;
|
||||
c_name = (char *)HD5f2cstring(name, c_namelen);
|
||||
if (c_name == NULL) return ret_value;
|
||||
if(NULL == ( c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
|
||||
goto DONE;
|
||||
|
||||
/*
|
||||
* Call H5Dcreate function.
|
||||
* Call H5Dcreate2 function.
|
||||
*/
|
||||
c_loc_id = (hid_t)*loc_id;
|
||||
c_type_id = (hid_t)*type_id;
|
||||
c_space_id = (hid_t)*space_id;
|
||||
c_dset_id = H5Dcreate(c_loc_id, c_name, c_type_id, c_space_id, c_crt_prp);
|
||||
if (c_dset_id < 0) goto DONE;
|
||||
if((c_dset_id = H5Dcreate2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*space_id, H5P_DEFAULT, (hid_t)*crt_prp, H5P_DEFAULT)) < 0)
|
||||
goto DONE;
|
||||
*dset_id = (hid_t_f)c_dset_id;
|
||||
|
||||
ret_value = 0;
|
||||
|
||||
DONE:
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
if(c_name)
|
||||
HDfree(c_name);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
|
@ -156,8 +156,9 @@ About the Fortran APIs
|
||||
For example, the C function to create a dataset has the following
|
||||
prototype:
|
||||
|
||||
hid_t H5Dcreate(hid_it loc_id, char *name, hid_t type_id,
|
||||
hid_t space_id, hid_t creation_prp);
|
||||
hid_t H5Dcreate2(hid_it loc_id, char *name, hid_t type_id,
|
||||
hid_t space_id, hid_t link_creation_prp, hid_t dset_creation_prp,
|
||||
hid_t dset_access_prop);
|
||||
|
||||
The corresponding Fortran subroutine has the following form:
|
||||
|
||||
@ -172,6 +173,7 @@ About the Fortran APIs
|
||||
in the Reference Manual.) The seventh input parameter creation_prp
|
||||
is optional, and may be omitted when the default creation property
|
||||
list is used.
|
||||
(XXX: Update this! - QAK)
|
||||
|
||||
* Parameters to the Fortran subroutines have one of the following
|
||||
predefined datatypes (see the file H5fortran_types.f90 for KIND
|
||||
|
@ -30,13 +30,13 @@ int main( void )
|
||||
int i;
|
||||
|
||||
/* create a file */
|
||||
file_id = H5Fcreate ("ex_lite3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||
file_id = H5Fcreate("ex_lite3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/* create a data space */
|
||||
space_id = H5Screate_simple(1,dims,NULL);
|
||||
space_id = H5Screate_simple(1, dims, NULL);
|
||||
|
||||
/* create a dataset named "dset" */
|
||||
dset_id = H5Dcreate(file_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
|
||||
dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/* close */
|
||||
status = H5Dclose(dset_id);
|
||||
@ -48,7 +48,7 @@ int main( void )
|
||||
*/
|
||||
|
||||
/* create and write the attribute "attr1" on the dataset "dset" */
|
||||
status = H5LTset_attribute_int(file_id,"dset","attr1",data,ATTR_SIZE);
|
||||
status = H5LTset_attribute_int(file_id, "dset", "attr1", data, ATTR_SIZE);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* example of H5LTget_attribute_int
|
||||
@ -56,18 +56,15 @@ int main( void )
|
||||
*/
|
||||
|
||||
/* get the attribute "attr1" from the dataset "dset" */
|
||||
status = H5LTget_attribute_int(file_id,"dset","attr1",data);
|
||||
status = H5LTget_attribute_int(file_id, "dset", "attr1", data);
|
||||
|
||||
for (i=0; i< ATTR_SIZE; i++ )
|
||||
{
|
||||
printf (" %d", data[i]);
|
||||
}
|
||||
printf ("\n");
|
||||
for(i = 0; i < ATTR_SIZE; i++ )
|
||||
printf(" %d", data[i]);
|
||||
printf("\n");
|
||||
|
||||
/* close file */
|
||||
status = H5Fclose(file_id);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* private functions
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t H5IM_get_palette( hid_t loc_id,
|
||||
herr_t H5IM_get_palette(hid_t loc_id,
|
||||
const char *image_name,
|
||||
int pal_number,
|
||||
hid_t tid,
|
||||
@ -50,11 +50,11 @@ herr_t H5IM_get_palette( hid_t loc_id,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5IMmake_image_8bitf( hid_t loc_id,
|
||||
herr_t H5IMmake_image_8bitf(hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t width,
|
||||
hsize_t height,
|
||||
int_f *buf )
|
||||
int_f *buf)
|
||||
{
|
||||
hid_t did; /* dataset ID */
|
||||
hid_t sid; /* space ID */
|
||||
@ -71,35 +71,34 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* create the data space for the dataset. */
|
||||
if ((sid=H5Screate_simple(IMAGE8_RANK,dims,NULL))<0)
|
||||
if((sid = H5Screate_simple(IMAGE8_RANK, dims, NULL)) < 0)
|
||||
return -1;
|
||||
|
||||
/* create the dataset as H5T_NATIVE_UCHAR */
|
||||
if ((did=H5Dcreate(loc_id,dset_name,H5T_NATIVE_UINT8,sid,H5P_DEFAULT))<0)
|
||||
if((did = H5Dcreate2(loc_id, dset_name, H5T_NATIVE_UINT8, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* write with memory type H5T_NATIVE_INT */
|
||||
/* Use long type if Fortran integer is 8 bytes and C long long is also 8 bytes*/
|
||||
/* Fail if otherwise */
|
||||
if (buf)
|
||||
{
|
||||
if (sizeof(int_f) == sizeof(int)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
|
||||
return -1;}
|
||||
else if (sizeof(int_f) == sizeof(long)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
|
||||
return -1;}
|
||||
else if (sizeof(int_f) == sizeof(long_long)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
|
||||
return -1;}
|
||||
else
|
||||
return -1;
|
||||
if(buf) {
|
||||
if(sizeof(int_f) == sizeof(int)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
return -1;
|
||||
} else if(sizeof(int_f) == sizeof(long)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
return -1;
|
||||
} else if(sizeof(int_f) == sizeof(long_long)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
return -1;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* close */
|
||||
if (H5Dclose(did)<0)
|
||||
if(H5Dclose(did) < 0)
|
||||
return -1;
|
||||
if (H5Sclose(sid)<0)
|
||||
if(H5Sclose(sid) < 0)
|
||||
return -1;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -108,15 +107,15 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* attach the CLASS attribute */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "CLASS", IMAGE_CLASS) < 0)
|
||||
return -1;
|
||||
|
||||
/* attach the VERSION attribute */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION) < 0)
|
||||
return -1;
|
||||
|
||||
/* attach the IMAGE_SUBCLASS attribute */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED" ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED") < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -150,7 +149,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5IMmake_image_24bitf( hid_t loc_id,
|
||||
herr_t H5IMmake_image_24bitf(hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t width,
|
||||
hsize_t height,
|
||||
@ -165,22 +164,21 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
|
||||
* attach the image dimensions according to the interlace mode
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 )
|
||||
{
|
||||
if(strcmp(interlace, "INTERLACE_PIXEL") == 0) {
|
||||
/* Number of color planes is defined as the third dimension */
|
||||
dims[0] = height;
|
||||
dims[1] = width;
|
||||
dims[2] = IMAGE24_RANK;
|
||||
}
|
||||
else
|
||||
if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 )
|
||||
{
|
||||
if(strcmp(interlace, "INTERLACE_PLANE") == 0) {
|
||||
/* Number of color planes is defined as the first dimension */
|
||||
dims[0] = IMAGE24_RANK;
|
||||
dims[1] = height;
|
||||
dims[2] = width;
|
||||
}
|
||||
else return -1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* create and write the dataset
|
||||
@ -188,33 +186,32 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* create the data space for the dataset. */
|
||||
if ((sid=H5Screate_simple(IMAGE24_RANK,dims,NULL))<0)
|
||||
if((sid = H5Screate_simple(IMAGE24_RANK, dims, NULL)) < 0)
|
||||
return -1;
|
||||
|
||||
/* create the dataset as H5T_NATIVE_UCHAR */
|
||||
if ((did=H5Dcreate(loc_id,dset_name,H5T_NATIVE_UCHAR,sid,H5P_DEFAULT))<0)
|
||||
if((did = H5Dcreate2(loc_id, dset_name, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* write with memory type H5T_NATIVE_INT */
|
||||
if (buf)
|
||||
{
|
||||
if (sizeof(int_f) == sizeof(int)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
|
||||
return -1;}
|
||||
else if (sizeof(int_f) == sizeof(long)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
|
||||
return -1;}
|
||||
else if (sizeof(int_f) == sizeof(long_long)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
|
||||
return -1;}
|
||||
else
|
||||
if(buf) {
|
||||
if(sizeof(int_f) == sizeof(int)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
return -1;
|
||||
} else if(sizeof(int_f) == sizeof(long)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
return -1;
|
||||
} else if(sizeof(int_f) == sizeof(long_long)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
return -1;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* close */
|
||||
if (H5Dclose(did)<0)
|
||||
if(H5Dclose(did) < 0)
|
||||
return -1;
|
||||
if (H5Sclose(sid)<0)
|
||||
if(H5Sclose(sid) < 0)
|
||||
return -1;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -223,19 +220,19 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* Attach the CLASS attribute */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "CLASS", IMAGE_CLASS) < 0)
|
||||
return -1;
|
||||
|
||||
/* Attach the VERSION attribute */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION) < 0)
|
||||
return -1;
|
||||
|
||||
/* Attach the IMAGE_SUBCLASS attribute */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR" ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR") < 0)
|
||||
return -1;
|
||||
|
||||
/* Attach the INTERLACE_MODE attribute. This attributes is only for true color images */
|
||||
if ( H5LTset_attribute_string( loc_id, dset_name, "INTERLACE_MODE", interlace ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, dset_name, "INTERLACE_MODE", interlace) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -264,9 +261,9 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5IMread_imagef( hid_t loc_id,
|
||||
herr_t H5IMread_imagef(hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int_f *buf )
|
||||
int_f *buf)
|
||||
{
|
||||
hid_t did;
|
||||
hid_t tid;
|
||||
@ -325,10 +322,10 @@ out:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5IMmake_palettef( hid_t loc_id,
|
||||
herr_t H5IMmake_palettef(hid_t loc_id,
|
||||
const char *pal_name,
|
||||
const hsize_t *pal_dims,
|
||||
int_f *pal_data )
|
||||
int_f *pal_data)
|
||||
|
||||
{
|
||||
|
||||
@ -337,10 +334,10 @@ herr_t H5IMmake_palettef( hid_t loc_id,
|
||||
int has_pal;
|
||||
|
||||
/* Check if the dataset already exists */
|
||||
has_pal = H5LTfind_dataset( loc_id, pal_name );
|
||||
has_pal = H5LTfind_dataset(loc_id, pal_name);
|
||||
|
||||
/* It exists. Return */
|
||||
if ( has_pal == 1 )
|
||||
if(has_pal == 1)
|
||||
return 0;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -349,33 +346,32 @@ herr_t H5IMmake_palettef( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* create the data space for the dataset. */
|
||||
if ((sid=H5Screate_simple(2,pal_dims,NULL))<0)
|
||||
if((sid = H5Screate_simple(2, pal_dims, NULL)) < 0)
|
||||
return -1;
|
||||
|
||||
/* create the dataset as H5T_NATIVE_UCHAR */
|
||||
if ((did=H5Dcreate(loc_id,pal_name,H5T_NATIVE_UCHAR,sid,H5P_DEFAULT))<0)
|
||||
if((did = H5Dcreate2(loc_id, pal_name, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* write with memory type H5T_NATIVE_INT */
|
||||
if (pal_data)
|
||||
{
|
||||
if (sizeof(int_f) == sizeof(int)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
|
||||
return -1;}
|
||||
else if (sizeof(int_f) == sizeof(long)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
|
||||
return -1;}
|
||||
else if (sizeof(int_f) == sizeof(long_long)) {
|
||||
if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
|
||||
return -1;}
|
||||
else
|
||||
return -1;
|
||||
if(pal_data) {
|
||||
if(sizeof(int_f) == sizeof(int)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
|
||||
return -1;
|
||||
} else if(sizeof(int_f) == sizeof(long)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
|
||||
return -1;
|
||||
} else if(sizeof(int_f) == sizeof(long_long)) {
|
||||
if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
|
||||
return -1;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* close */
|
||||
if (H5Dclose(did)<0)
|
||||
if(H5Dclose(did) < 0)
|
||||
return -1;
|
||||
if (H5Sclose(sid)<0)
|
||||
if(H5Sclose(sid) < 0)
|
||||
return -1;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -384,11 +380,11 @@ herr_t H5IMmake_palettef( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* Attach the attribute "CLASS" to the >>palette<< dataset*/
|
||||
if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, pal_name, "CLASS", PALETTE_CLASS) < 0)
|
||||
return -1;
|
||||
|
||||
/* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/
|
||||
if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 )
|
||||
if(H5LTset_attribute_string(loc_id, pal_name, "PAL_VERSION", "1.2") < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -420,16 +416,16 @@ herr_t H5IMmake_palettef( hid_t loc_id,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5IMget_palettef( hid_t loc_id,
|
||||
herr_t H5IMget_palettef(hid_t loc_id,
|
||||
const char *image_name,
|
||||
int pal_number,
|
||||
int_f *pal_data )
|
||||
int_f *pal_data)
|
||||
{
|
||||
if(sizeof(int_f) == sizeof(int))
|
||||
return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_INT,pal_data);
|
||||
else if (sizeof(int_f) == sizeof(long))
|
||||
else if(sizeof(int_f) == sizeof(long))
|
||||
return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LONG,pal_data);
|
||||
else if (sizeof(int_f) == sizeof(long_long))
|
||||
else if(sizeof(int_f) == sizeof(long_long))
|
||||
return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LLONG,pal_data);
|
||||
else
|
||||
return -1;
|
||||
@ -462,7 +458,7 @@ herr_t H5IMget_palettef( hid_t loc_id,
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t H5IM_get_palette( hid_t loc_id,
|
||||
herr_t H5IM_get_palette(hid_t loc_id,
|
||||
const char *image_name,
|
||||
int pal_number,
|
||||
hid_t tid,
|
||||
@ -486,7 +482,7 @@ herr_t H5IM_get_palette( hid_t loc_id,
|
||||
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
|
||||
has_pal = H5IM_find_palette(image_id);
|
||||
|
||||
if(has_pal == 1 )
|
||||
if(has_pal == 1)
|
||||
{
|
||||
|
||||
if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
@ -495,62 +491,62 @@ herr_t H5IM_get_palette( hid_t loc_id,
|
||||
if((attr_type = H5Aget_type(attr_id)) < 0)
|
||||
goto out;
|
||||
|
||||
if ( (attr_class = H5Tget_class( attr_type )) < 0 )
|
||||
if((attr_class = H5Tget_class(attr_type)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Check if it is really a reference */
|
||||
if ( attr_class == H5T_REFERENCE )
|
||||
if(attr_class == H5T_REFERENCE)
|
||||
{
|
||||
|
||||
/* Get the reference(s) */
|
||||
if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
|
||||
if((attr_space_id = H5Aget_space(attr_id)) < 0)
|
||||
goto out;
|
||||
|
||||
n_refs = H5Sget_simple_extent_npoints( attr_space_id );
|
||||
n_refs = H5Sget_simple_extent_npoints(attr_space_id);
|
||||
|
||||
dim_ref = n_refs;
|
||||
|
||||
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
|
||||
refbuf = malloc(sizeof(hobj_ref_t) * (int)dim_ref);
|
||||
|
||||
if ( H5Aread( attr_id, attr_type, refbuf ) < 0 )
|
||||
if(H5Aread(attr_id, attr_type, refbuf) < 0)
|
||||
goto out;
|
||||
|
||||
/* Get the palette id */
|
||||
if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0 )
|
||||
if((pal_id = H5Rdereference(image_id, H5R_OBJECT, &refbuf[pal_number])) < 0)
|
||||
goto out;
|
||||
|
||||
/* Read the palette dataset using the memory type TID */
|
||||
if ( H5Dread( pal_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0 )
|
||||
if(H5Dread(pal_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
|
||||
goto out;
|
||||
|
||||
if ( H5Sclose( attr_space_id ) < 0 )
|
||||
if(H5Sclose(attr_space_id) < 0)
|
||||
goto out;
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if (H5Dclose(pal_id)<0)
|
||||
if(H5Dclose(pal_id) < 0)
|
||||
goto out;
|
||||
|
||||
free( refbuf );
|
||||
free(refbuf);
|
||||
|
||||
} /* H5T_REFERENCE */
|
||||
|
||||
if ( H5Tclose( attr_type ) < 0 )
|
||||
if(H5Tclose(attr_type) < 0)
|
||||
goto out;
|
||||
|
||||
/* Close the attribute. */
|
||||
if ( H5Aclose( attr_id ) < 0 )
|
||||
if(H5Aclose(attr_id) < 0)
|
||||
goto out;
|
||||
|
||||
}
|
||||
|
||||
/* Close the image dataset. */
|
||||
if ( H5Dclose( image_id ) < 0 )
|
||||
if(H5Dclose(image_id) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( image_id );
|
||||
H5Dclose(image_id);
|
||||
return -1;
|
||||
|
||||
|
||||
|
383
hl/src/H5LT.c
383
hl/src/H5LT.c
@ -44,6 +44,61 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id,
|
||||
hid_t mem_type_id,
|
||||
void *data);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5LT_make_dataset
|
||||
*
|
||||
* Purpose: Creates and writes a dataset of a type tid
|
||||
*
|
||||
* Return: Success: 0, Failure: -1
|
||||
*
|
||||
* Programmer: Quincey Koziol, koziol@hdfgroup.org
|
||||
*
|
||||
* Date: October 10, 2007
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static herr_t
|
||||
H5LT_make_dataset_numerical( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
hid_t tid,
|
||||
const void *data )
|
||||
{
|
||||
hid_t did = -1, sid = -1;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
if(data)
|
||||
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
|
||||
goto out;
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if(H5Dclose(did) < 0)
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if(H5Sclose(sid) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(did);
|
||||
H5Sclose(sid);
|
||||
} H5E_END_TRY;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Public functions
|
||||
@ -77,39 +132,7 @@ herr_t H5LTmake_dataset( hid_t loc_id,
|
||||
hid_t tid,
|
||||
const void *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, tid, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, tid, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -137,39 +160,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id,
|
||||
const hsize_t *dims,
|
||||
const char *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_CHAR, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_CHAR, data));
|
||||
}
|
||||
|
||||
|
||||
@ -199,39 +190,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id,
|
||||
const hsize_t *dims,
|
||||
const short *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_SHORT, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_SHORT, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -260,39 +219,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id,
|
||||
const hsize_t *dims,
|
||||
const int *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_INT, data));
|
||||
}
|
||||
|
||||
|
||||
@ -323,39 +250,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id,
|
||||
const hsize_t *dims,
|
||||
const long *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_LONG, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_LONG, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -384,39 +279,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id,
|
||||
const hsize_t *dims,
|
||||
const float *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_FLOAT, data));
|
||||
}
|
||||
|
||||
|
||||
@ -447,39 +310,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id,
|
||||
const hsize_t *dims,
|
||||
const double *data )
|
||||
{
|
||||
|
||||
hid_t did, sid;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT )) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
|
||||
if ( data )
|
||||
{
|
||||
if ( H5Dwrite( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* End access to the dataset and release resources used by it. */
|
||||
if ( H5Dclose( did ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( sid ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose( did );
|
||||
H5Sclose( sid );
|
||||
return -1;
|
||||
return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_DOUBLE, data));
|
||||
}
|
||||
|
||||
|
||||
@ -507,55 +338,53 @@ herr_t H5LTmake_dataset_string(hid_t loc_id,
|
||||
const char *dset_name,
|
||||
const char *buf )
|
||||
{
|
||||
hid_t did = -1;
|
||||
hid_t sid = -1;
|
||||
hid_t tid = -1;
|
||||
size_t size;
|
||||
|
||||
hid_t did=-1;
|
||||
hid_t sid=-1;
|
||||
hid_t tid;
|
||||
size_t size;
|
||||
/* create a string data type */
|
||||
if((tid = H5Tcopy(H5T_C_S1)) < 0 )
|
||||
goto out;
|
||||
|
||||
/* create a string data type */
|
||||
if ( (tid = H5Tcopy( H5T_C_S1 )) < 0 )
|
||||
goto out;
|
||||
size = strlen(buf) + 1; /* extra null term */
|
||||
|
||||
size = strlen(buf) + 1; /* extra null term */
|
||||
if(H5Tset_size(tid, size) < 0)
|
||||
goto out;
|
||||
|
||||
if ( H5Tset_size(tid,size) < 0 )
|
||||
goto out;
|
||||
if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0)
|
||||
goto out;
|
||||
|
||||
if ( H5Tset_strpad(tid,H5T_STR_NULLTERM ) < 0 )
|
||||
goto out;
|
||||
/* Create the data space for the dataset. */
|
||||
if((sid = H5Screate(H5S_SCALAR)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Create the data space for the dataset. */
|
||||
if ( (sid = H5Screate( H5S_SCALAR )) < 0 )
|
||||
goto out;
|
||||
/* Create the dataset. */
|
||||
if((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (did = H5Dcreate(loc_id,dset_name,tid,sid,H5P_DEFAULT)) < 0 )
|
||||
goto out;
|
||||
/* Write the dataset only if there is data to write */
|
||||
if(buf)
|
||||
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
goto out;
|
||||
|
||||
/* Write the dataset only if there is data to write */
|
||||
/* close*/
|
||||
if(H5Dclose(did) < 0)
|
||||
return -1;
|
||||
if(H5Sclose(sid) < 0)
|
||||
return -1;
|
||||
if(H5Tclose(tid) < 0)
|
||||
goto out;
|
||||
|
||||
if (buf)
|
||||
{
|
||||
if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 )
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* close*/
|
||||
if ( H5Dclose(did) < 0 )
|
||||
return -1;
|
||||
if ( H5Sclose(sid) < 0 )
|
||||
return -1;
|
||||
if ( H5Tclose(tid) < 0 )
|
||||
goto out;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Dclose(did);
|
||||
H5Tclose(tid);
|
||||
H5Sclose(sid);
|
||||
return -1;
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(did);
|
||||
H5Tclose(tid);
|
||||
H5Sclose(sid);
|
||||
} H5E_END_TRY;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -574,7 +403,7 @@ out:
|
||||
*/
|
||||
|
||||
static herr_t
|
||||
H5LT_read_dataset(hid_t loc_id, const char *dset_name, hid_t tid, void *data)
|
||||
H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void *data)
|
||||
{
|
||||
hid_t did;
|
||||
|
||||
@ -616,7 +445,7 @@ herr_t H5LTread_dataset(hid_t loc_id,
|
||||
hid_t tid,
|
||||
void *data)
|
||||
{
|
||||
return(H5LT_read_dataset(loc_id, dset_name, tid, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, tid, data));
|
||||
}
|
||||
|
||||
|
||||
@ -638,7 +467,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
char *data )
|
||||
{
|
||||
return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_CHAR, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_CHAR, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -659,7 +488,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
short *data )
|
||||
{
|
||||
return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_SHORT, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_SHORT, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -680,7 +509,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int *data )
|
||||
{
|
||||
return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_INT, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_INT, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -701,7 +530,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
long *data )
|
||||
{
|
||||
return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_LONG, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_LONG, data));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -722,7 +551,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
float *data )
|
||||
{
|
||||
return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_FLOAT, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_FLOAT, data));
|
||||
}
|
||||
|
||||
|
||||
@ -744,7 +573,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
double *data )
|
||||
{
|
||||
return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_DOUBLE, data));
|
||||
return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_DOUBLE, data));
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,8 +83,8 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
|
||||
hid_t ret_value;
|
||||
|
||||
/* Register the packet table ID type if this is the first table created */
|
||||
if( H5PT_ptable_id_type < 0)
|
||||
if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) <0)
|
||||
if(H5PT_ptable_id_type < 0)
|
||||
if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Get memory for the table identifier */
|
||||
@ -94,35 +94,33 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
|
||||
dims[0] = 0;
|
||||
dims_chunk[0] = chunk_size;
|
||||
maxdims[0] = H5S_UNLIMITED;
|
||||
if ( (space_id = H5Screate_simple( 1, dims, maxdims )) < 0 )
|
||||
if((space_id = H5Screate_simple(1, dims, maxdims)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Modify dataset creation properties to enable chunking */
|
||||
plist_id = H5Pcreate (H5P_DATASET_CREATE);
|
||||
if ( H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0 )
|
||||
plist_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk(plist_id, 1, dims_chunk) < 0)
|
||||
goto out;
|
||||
if(compression >= 0 && compression <= 9)
|
||||
{
|
||||
if( H5Pset_deflate(plist_id, (unsigned)compression) < 0)
|
||||
if(H5Pset_deflate(plist_id, (unsigned)compression) < 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Create the dataset. */
|
||||
if ( (dset_id=H5Dcreate( loc_id, dset_name, dtype_id, space_id, plist_id))<0 )
|
||||
if((dset_id = H5Dcreate2(loc_id, dset_name, dtype_id, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if ( H5Sclose( space_id ) < 0 )
|
||||
if(H5Sclose(space_id) < 0)
|
||||
goto out;
|
||||
|
||||
/* End access to the property list */
|
||||
if ( H5Pclose( plist_id ) < 0 )
|
||||
if(H5Pclose(plist_id) < 0)
|
||||
goto out;
|
||||
|
||||
/* Create the table identifier */
|
||||
table->dset_id = dset_id;
|
||||
|
||||
if((table->type_id = H5Tcopy(dtype_id)) <0)
|
||||
if((table->type_id = H5Tcopy(dtype_id)) < 0)
|
||||
goto out;
|
||||
|
||||
H5PT_create_index(table);
|
||||
@ -131,7 +129,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
|
||||
/* Get an ID for this table */
|
||||
ret_value = H5Iregister(H5PT_ptable_id_type, table);
|
||||
|
||||
if (ret_value != H5I_INVALID_HID)
|
||||
if(ret_value != H5I_INVALID_HID)
|
||||
H5PT_ptable_count++;
|
||||
else
|
||||
H5PT_close(table);
|
||||
@ -180,14 +178,14 @@ hid_t H5PTcreate_vl ( hid_t loc_id,
|
||||
|
||||
/* Create a variable length type that uses single bytes as its base type */
|
||||
vltype = H5Tvlen_create(H5T_NATIVE_UCHAR);
|
||||
if (vltype < 0)
|
||||
if(vltype < 0)
|
||||
goto out;
|
||||
|
||||
if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) <0)
|
||||
if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) < 0)
|
||||
goto out;
|
||||
|
||||
/* close the vltype */
|
||||
if (H5Tclose(vltype) < 0)
|
||||
if(H5Tclose(vltype) < 0)
|
||||
goto out;
|
||||
|
||||
return ret_value;
|
||||
@ -229,7 +227,7 @@ hid_t H5PTopen( hid_t loc_id,
|
||||
|
||||
/* Register the packet table ID type if this is the first table created */
|
||||
if( H5PT_ptable_id_type < 0)
|
||||
if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free))<0)
|
||||
if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0)
|
||||
goto out;
|
||||
|
||||
table = (htbl_t *)malloc(sizeof(htbl_t));
|
||||
@ -237,35 +235,35 @@ hid_t H5PTopen( hid_t loc_id,
|
||||
/* Open the dataset */
|
||||
if((table->dset_id = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
if (table->dset_id < 0)
|
||||
if(table->dset_id < 0)
|
||||
goto out;
|
||||
|
||||
/* Get the dataset's disk datatype */
|
||||
if ((type_id = H5Dget_type(table->dset_id)) < 0)
|
||||
if((type_id = H5Dget_type(table->dset_id)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Get the table's native datatype */
|
||||
if ((table->type_id = H5Tget_native_type(type_id, H5T_DIR_ASCEND)) < 0)
|
||||
if((table->type_id = H5Tget_native_type(type_id, H5T_DIR_ASCEND)) < 0)
|
||||
goto out;
|
||||
|
||||
if (H5Tclose(type_id) < 0)
|
||||
if(H5Tclose(type_id) < 0)
|
||||
goto out;
|
||||
|
||||
/* Initialize the current record pointer */
|
||||
if((H5PT_create_index(table)) <0)
|
||||
if((H5PT_create_index(table)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Get number of records in table */
|
||||
if((space_id=H5Dget_space(table->dset_id)) <0)
|
||||
if((space_id=H5Dget_space(table->dset_id)) < 0)
|
||||
goto out;
|
||||
if ( H5Sget_simple_extent_dims( space_id, dims, NULL) < 0 )
|
||||
if( H5Sget_simple_extent_dims( space_id, dims, NULL) < 0)
|
||||
goto out;
|
||||
table->size = dims[0];
|
||||
|
||||
/* Get an ID for this table */
|
||||
ret_value = H5Iregister(H5PT_ptable_id_type, table);
|
||||
|
||||
if (ret_value != H5I_INVALID_HID)
|
||||
if(ret_value != H5I_INVALID_HID)
|
||||
H5PT_ptable_count++;
|
||||
else
|
||||
H5PT_close(table);
|
||||
@ -311,11 +309,11 @@ herr_t H5PT_close( htbl_t* table)
|
||||
goto out;
|
||||
|
||||
/* Close the dataset */
|
||||
if (H5Dclose(table->dset_id) < 0)
|
||||
if(H5Dclose(table->dset_id) < 0)
|
||||
goto out;
|
||||
|
||||
/* Close the memory datatype */
|
||||
if (H5Tclose(table->type_id) < 0)
|
||||
if(H5Tclose(table->type_id) < 0)
|
||||
goto out;
|
||||
|
||||
free(table);
|
||||
@ -370,7 +368,7 @@ herr_t H5PTclose( hid_t table_id )
|
||||
|
||||
/* Remove the packet table type ID if no more packet */
|
||||
/* tables are open */
|
||||
if (H5PT_ptable_count == 0)
|
||||
if(H5PT_ptable_count == 0)
|
||||
{
|
||||
H5Idestroy_type(H5PT_ptable_id_type);
|
||||
H5PT_ptable_id_type = H5I_UNINIT;
|
||||
@ -419,11 +417,11 @@ herr_t H5PTappend( hid_t table_id,
|
||||
goto out;
|
||||
|
||||
/* If we are asked to write 0 records, just do nothing */
|
||||
if (nrecords == 0)
|
||||
if(nrecords == 0)
|
||||
return 0;
|
||||
|
||||
if((H5TB_common_append_records(table->dset_id, table->type_id,
|
||||
nrecords, table->size, data)) <0)
|
||||
nrecords, table->size, data)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Update table size */
|
||||
@ -473,7 +471,7 @@ herr_t H5PTget_next( hid_t table_id,
|
||||
goto out;
|
||||
|
||||
/* If nrecords == 0, do nothing */
|
||||
if (nrecords == 0)
|
||||
if(nrecords == 0)
|
||||
return 0;
|
||||
|
||||
if((H5TB_common_read_records(table->dset_id, table->type_id,
|
||||
@ -516,11 +514,11 @@ herr_t H5PTread_packets( hid_t table_id,
|
||||
|
||||
/* find the table struct from its ID */
|
||||
table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type);
|
||||
if (table == NULL)
|
||||
if(table == NULL)
|
||||
goto out;
|
||||
|
||||
/* If nrecords == 0, do nothing */
|
||||
if (nrecords == 0)
|
||||
if(nrecords == 0)
|
||||
return 0;
|
||||
|
||||
if( H5TB_common_read_records(table->dset_id, table->type_id,
|
||||
@ -799,7 +797,7 @@ herr_t H5PTfree_vlen_readbuff( hid_t table_id,
|
||||
if((table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type)) == NULL)
|
||||
goto out;
|
||||
|
||||
if ((space_id = H5Screate_simple(1, &bufflen, NULL)) < 0)
|
||||
if((space_id = H5Screate_simple(1, &bufflen, NULL)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Free the memory. If this succeeds, ret_value should be 0. */
|
||||
|
102
hl/src/H5TB.c
102
hl/src/H5TB.c
@ -117,50 +117,44 @@ herr_t H5TBmake_table( const char *table_title,
|
||||
return -1;
|
||||
|
||||
/* Modify dataset creation properties, i.e. enable chunking */
|
||||
plist_id = H5Pcreate (H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0)
|
||||
plist_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk(plist_id, 1, dims_chunk) < 0)
|
||||
return -1;
|
||||
|
||||
/* Set the fill value using a struct as the data type. */
|
||||
if(fill_data )
|
||||
{
|
||||
if(H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0)
|
||||
if(fill_data)
|
||||
if(H5Pset_fill_value(plist_id, mem_type_id, fill_data) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
Dataset creation property list is modified to use
|
||||
GZIP compression with the compression effort set to 6.
|
||||
Note that compression can be used only when dataset is chunked.
|
||||
*/
|
||||
if(compress )
|
||||
{
|
||||
if(H5Pset_deflate( plist_id, 6) < 0)
|
||||
if(compress)
|
||||
if(H5Pset_deflate(plist_id, 6) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create the dataset. */
|
||||
if((did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0)
|
||||
if((did = H5Dcreate2(loc_id, dset_name, mem_type_id, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Only write if there is something to write */
|
||||
if(data )
|
||||
{
|
||||
if(data)
|
||||
/* Write data to the dataset. */
|
||||
if(H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Terminate access to the data space. */
|
||||
if(H5Sclose( sid ) < 0)
|
||||
if(H5Sclose(sid) < 0)
|
||||
goto out;
|
||||
|
||||
/* End access to the dataset */
|
||||
if(H5Dclose( did ) < 0)
|
||||
if(H5Dclose(did) < 0)
|
||||
goto out;
|
||||
|
||||
/* End access to the property list */
|
||||
if(H5Pclose( plist_id ) < 0)
|
||||
if(H5Pclose(plist_id) < 0)
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -1915,11 +1909,11 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
|
||||
*/
|
||||
|
||||
/* Clone the property list */
|
||||
if(( plist_id3 = H5Pcopy( plist_id1 )) < 0)
|
||||
if((plist_id3 = H5Pcopy(plist_id1)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Clone the type id */
|
||||
if(( type_id3 = H5Tcopy( type_id1 )) < 0)
|
||||
if((type_id3 = H5Tcopy(type_id1)) < 0)
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -1930,18 +1924,18 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
|
||||
dims[0] = 0;
|
||||
|
||||
/* Create a simple data space with unlimited size */
|
||||
if((space_id3 = H5Screate_simple( 1, dims, maxdims )) < 0)
|
||||
if((space_id3 = H5Screate_simple(1, dims, maxdims)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Create the dataset */
|
||||
if((dataset_id3 = H5Dcreate( loc_id1, dset_name3, type_id3, space_id3, plist_id3 )) < 0)
|
||||
if((dataset_id3 = H5Dcreate2(loc_id1, dset_name3, type_id3, space_id3, H5P_DEFAULT, plist_id3, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Attach the conforming table attributes
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(H5TB_attach_attributes( "Merge table", loc_id1, dset_name3, nfields, type_id3 ) < 0)
|
||||
if(H5TB_attach_attributes("Merge table", loc_id1, dset_name3, nfields, type_id3) < 0)
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -1949,13 +1943,13 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
type_size = H5Tget_size( type_id3 );
|
||||
type_size = H5Tget_size(type_id3);
|
||||
|
||||
/* alloc fill value attribute buffer */
|
||||
tmp_fill_buf = (unsigned char *)malloc((size_t) type_size );
|
||||
tmp_fill_buf = (unsigned char *)malloc(type_size);
|
||||
|
||||
/* Get the fill value attributes */
|
||||
has_fill=H5TBAget_fill( loc_id1, dset_name1, dataset_id1, tmp_fill_buf );
|
||||
has_fill = H5TBAget_fill(loc_id1, dset_name1, dataset_id1, tmp_fill_buf);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Attach the fill attributes from previous table
|
||||
@ -2312,14 +2306,11 @@ herr_t H5TBinsert_field( hid_t loc_id,
|
||||
/* Insert the old fields, counting with the new one */
|
||||
for ( i = 0; i < nfields + 1; i++)
|
||||
{
|
||||
|
||||
idx = i;
|
||||
if(inserted )
|
||||
idx = i - 1;
|
||||
|
||||
if(i == position )
|
||||
{
|
||||
|
||||
if(i == position ) {
|
||||
/* Get the new member size */
|
||||
new_member_size = H5Tget_size( field_type );
|
||||
|
||||
@ -2332,7 +2323,6 @@ herr_t H5TBinsert_field( hid_t loc_id,
|
||||
inserted = 1;
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
/* Get the member name */
|
||||
@ -2356,8 +2346,6 @@ herr_t H5TBinsert_field( hid_t loc_id,
|
||||
/* Close the member type */
|
||||
if(H5Tclose( member_type_id ) < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
} /* i */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2366,20 +2354,20 @@ herr_t H5TBinsert_field( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* Retrieve the size of chunk */
|
||||
if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0)
|
||||
if(H5Pget_chunk(plist_id1, 1, dims_chunk) < 0)
|
||||
goto out;
|
||||
|
||||
/* Create a new simple data space with unlimited size, using the dimension */
|
||||
if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0)
|
||||
if((space_id2 = H5Screate_simple( 1, dims, maxdims)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Modify dataset creation properties, i.e. enable chunking */
|
||||
plist_id2 = H5Pcreate (H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0)
|
||||
plist_id2 = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk(plist_id2, 1, dims_chunk) < 0)
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0)
|
||||
if((dataset_id2 = H5Dcreate2(loc_id, "new", type_id2, space_id2, H5P_DEFAULT, plist_id2, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
@ -2388,20 +2376,20 @@ herr_t H5TBinsert_field( hid_t loc_id,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
tmp_buf = (unsigned char *)calloc((size_t) nrecords, (size_t)total_size );
|
||||
tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size);
|
||||
|
||||
/* Define a hyperslab in the dataset of the size of the records */
|
||||
offset[0] = 0;
|
||||
count[0] = nrecords;
|
||||
if(H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
|
||||
if(H5Sselect_hyperslab(space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
|
||||
goto out;
|
||||
|
||||
/* Create a memory dataspace handle */
|
||||
mem_size[0] = count[0];
|
||||
if((mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0)
|
||||
if((mem_space_id1 = H5Screate_simple(1, mem_size, NULL)) < 0)
|
||||
goto out;
|
||||
|
||||
if(H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0)
|
||||
if(H5Dread(dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf) < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
@ -2837,12 +2825,11 @@ herr_t H5TBdelete_field( hid_t loc_id,
|
||||
|
||||
curr_offset += member_size;
|
||||
|
||||
free( member_name );
|
||||
free(member_name);
|
||||
|
||||
/* Close the member type */
|
||||
if(H5Tclose( member_type_id ) < 0)
|
||||
if(H5Tclose(member_type_id) < 0)
|
||||
goto out;
|
||||
|
||||
} /* i */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2851,48 +2838,45 @@ herr_t H5TBdelete_field( hid_t loc_id,
|
||||
*/
|
||||
|
||||
/* Retrieve the size of chunk */
|
||||
if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0)
|
||||
if(H5Pget_chunk(plist_id1, 1, dims_chunk) < 0)
|
||||
goto out;
|
||||
|
||||
/* Create a new simple data space with unlimited size, using the dimension */
|
||||
if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0)
|
||||
if((space_id2 = H5Screate_simple(1, dims, maxdims)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Modify dataset creation properties, i.e. enable chunking */
|
||||
plist_id2 = H5Pcreate (H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0)
|
||||
plist_id2 = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if(H5Pset_chunk(plist_id2, 1, dims_chunk) < 0)
|
||||
return -1;
|
||||
|
||||
/* Create the dataset. */
|
||||
if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0)
|
||||
if((dataset_id2 = H5Dcreate2(loc_id, "new", type_id2, space_id2, H5P_DEFAULT, plist_id2, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* We have to read field by field of the old dataset and save it into the new one
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
for ( i = 0; i < nfields; i++)
|
||||
{
|
||||
|
||||
for ( i = 0; i < nfields; i++) {
|
||||
/* Get the member name */
|
||||
member_name = H5Tget_member_name( type_id1,(unsigned) i );
|
||||
member_name = H5Tget_member_name(type_id1, (unsigned)i);
|
||||
|
||||
/* Skip the field to delete */
|
||||
if(H5TB_find_field( member_name, field_name ) > 0 )
|
||||
{
|
||||
free( member_name );
|
||||
if(H5TB_find_field(member_name, field_name) > 0) {
|
||||
free(member_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get the member type */
|
||||
if(( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0)
|
||||
if((member_type_id = H5Tget_member_type(type_id1, (unsigned)i)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Get the member size */
|
||||
member_size = H5Tget_size( member_type_id );
|
||||
member_size = H5Tget_size(member_type_id);
|
||||
|
||||
/* Create a read id */
|
||||
if(( read_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0)
|
||||
if((read_type_id = H5Tcreate(H5T_COMPOUND, member_size)) < 0)
|
||||
goto out;
|
||||
|
||||
/* Insert it into the new type */
|
||||
|
1029
hl/test/test_ds.c
1029
hl/test/test_ds.c
File diff suppressed because it is too large
Load Diff
@ -418,7 +418,7 @@ static int test_attr(void)
|
||||
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) goto out;
|
||||
|
||||
/* Create the dataset */
|
||||
if((dataset_id = H5Dcreate(file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) goto out;
|
||||
if((dataset_id = H5Dcreate2(file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out;
|
||||
|
||||
/* Close */
|
||||
H5Dclose(dataset_id);
|
||||
|
@ -386,8 +386,8 @@ int main(int argc, char *argv[])
|
||||
assert(dcpl>0);
|
||||
|
||||
/* Create dataset */
|
||||
dsid=H5Dcreate(fid,DEFAULT_DATASET_NAME,DEFAULT_HDF5_DATATYPE,file_sid,dcpl);
|
||||
assert(dsid>0);
|
||||
dsid = H5Dcreate2(fid, DEFAULT_DATASET_NAME, DEFAULT_HDF5_DATATYPE, file_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
assert(dsid > 0);
|
||||
|
||||
/* Close dataset creation property list */
|
||||
ret=H5Pclose(dcpl);
|
||||
|
@ -149,29 +149,29 @@ create_dataset (void)
|
||||
|
||||
/* The data space */
|
||||
size[0] = size[1] = DS_SIZE * CH_SIZE;
|
||||
space = H5Screate_simple (2, size, size);
|
||||
space = H5Screate_simple(2, size, size);
|
||||
|
||||
/* The storage layout and compression */
|
||||
dcpl = H5Pcreate (H5P_DATASET_CREATE);
|
||||
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
||||
size[0] = size[1] = CH_SIZE;
|
||||
H5Pset_chunk (dcpl, 2, size);
|
||||
H5Zregister (H5Z_COUNTER);
|
||||
H5Pset_filter (dcpl, FILTER_COUNTER, 0, 0, NULL);
|
||||
H5Pset_chunk(dcpl, 2, size);
|
||||
H5Zregister(H5Z_COUNTER);
|
||||
H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL);
|
||||
|
||||
/* The dataset */
|
||||
dset = H5Dcreate (file, "dset", H5T_NATIVE_SCHAR, space, dcpl);
|
||||
assert (dset>=0);
|
||||
dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
assert(dset>=0);
|
||||
|
||||
/* The data */
|
||||
buf = calloc (1, SQUARE (DS_SIZE*CH_SIZE));
|
||||
H5Dwrite (dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
free (buf);
|
||||
buf = calloc(1, SQUARE (DS_SIZE*CH_SIZE));
|
||||
H5Dwrite(dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
free(buf);
|
||||
|
||||
/* Close */
|
||||
H5Dclose (dset);
|
||||
H5Sclose (space);
|
||||
H5Pclose (dcpl);
|
||||
H5Fclose (file);
|
||||
H5Dclose(dset);
|
||||
H5Sclose(space);
|
||||
H5Pclose(dcpl);
|
||||
H5Fclose(file);
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,12 +224,13 @@ main (void)
|
||||
|
||||
/* Create the dataset */
|
||||
file_space = H5Screate_simple (2, size, size);
|
||||
assert (file_space>=0);
|
||||
dset = H5Dcreate (file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT);
|
||||
assert (dset>=0);
|
||||
the_data = malloc ((size_t)(size[0]*size[1]));
|
||||
/*initial fill for lazy malloc*/
|
||||
memset (the_data, 0xAA, (size_t)(size[0]*size[1]));
|
||||
assert(file_space >= 0);
|
||||
dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
assert(dset >= 0);
|
||||
the_data = malloc((size_t)(size[0] * size[1]));
|
||||
|
||||
/* initial fill for lazy malloc */
|
||||
memset(the_data, 0xAA, (size_t)(size[0] * size[1]));
|
||||
|
||||
/* Fill raw */
|
||||
synchronize ();
|
||||
|
@ -206,32 +206,28 @@ test(fill_t fill_style, const double splits[],
|
||||
int j;
|
||||
h5_stat_t sb;
|
||||
|
||||
if (!had) had = calloc((size_t)cur_size[0], sizeof(int));
|
||||
if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) goto error;
|
||||
if (!use_rdcc) {
|
||||
if (H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL)<0) goto error;
|
||||
if (H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0)<0) goto error;
|
||||
if(!had) had = calloc((size_t)cur_size[0], sizeof(int));
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error;
|
||||
if(!use_rdcc) {
|
||||
if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error;
|
||||
if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error;
|
||||
}
|
||||
if ((file=H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
|
||||
goto error;
|
||||
}
|
||||
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
|
||||
if (H5Pset_chunk(dcpl, 1, ch_size)<0) goto error;
|
||||
if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
|
||||
if (H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2])<0) {
|
||||
goto error;
|
||||
}
|
||||
if ((fspace=H5Screate_simple(1, cur_size, max_size))<0) goto error;
|
||||
if ((mspace=H5Screate_simple(1, ch_size, ch_size))<0) goto error;
|
||||
if ((dset=H5Dcreate(file, "chunked", H5T_NATIVE_INT,
|
||||
fspace, dcpl))<0) goto error;
|
||||
if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
|
||||
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
|
||||
if(H5Pset_chunk(dcpl, 1, ch_size) < 0) goto error;
|
||||
if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
|
||||
if(H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2]) < 0) goto error;
|
||||
if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
|
||||
if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error;
|
||||
if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT,
|
||||
fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
|
||||
|
||||
#if !defined( __MWERKS__)
|
||||
|
||||
/*
|
||||
workaround for a bug in the Metrowerks version 6.0 open function
|
||||
*/
|
||||
if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666))<0) goto error;
|
||||
if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error;
|
||||
#endif
|
||||
|
||||
for (i=1; i<=cur_size[0]; i++) {
|
||||
@ -262,8 +258,8 @@ test(fill_t fill_style, const double splits[],
|
||||
|
||||
/* Write the chunk */
|
||||
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_start, NULL,
|
||||
hs_count, NULL)<0) goto error;
|
||||
if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i)<0) {
|
||||
hs_count, NULL) < 0) goto error;
|
||||
if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -272,8 +268,8 @@ test(fill_t fill_style, const double splits[],
|
||||
|
||||
/* Determine overhead */
|
||||
if (verbose) {
|
||||
if (H5Fflush(file, H5F_SCOPE_LOCAL)<0) goto error;
|
||||
if (HDfstat(fd, &sb)<0) goto error;
|
||||
if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
|
||||
if (HDfstat(fd, &sb) < 0) goto error;
|
||||
/*
|
||||
* The extra cast in the following statement is a bug workaround
|
||||
* for the Win32 version 5.0 compiler.
|
||||
@ -318,7 +314,7 @@ test(fill_t fill_style, const double splits[],
|
||||
|
||||
#if !defined( __MWERKS__)
|
||||
|
||||
if (HDfstat(fd, &sb)<0) goto error;
|
||||
if (HDfstat(fd, &sb) < 0) goto error;
|
||||
printf("%-7s %8.3f\n", sname,
|
||||
(double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/
|
||||
(hssize_t)cur_size[0]);
|
||||
@ -374,14 +370,12 @@ main(int argc, char *argv[])
|
||||
/* Default split ratios */
|
||||
H5Eset_auto2(H5E_DEFAULT, display_error_cb, NULL);
|
||||
|
||||
if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
|
||||
if (H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2)<0) {
|
||||
goto error;
|
||||
}
|
||||
if (H5Pclose(xfer)<0) goto error;
|
||||
if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
|
||||
if(H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2) < 0) goto error;
|
||||
if(H5Pclose(xfer) < 0) goto error;
|
||||
|
||||
/* Parse command-line options */
|
||||
for (i=1, j=0; i<argc; i++) {
|
||||
for(i = 1, j = 0; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "forward")) {
|
||||
fill_style = FILL_FORWARD;
|
||||
} else if (!strcmp(argv[i], "reverse")) {
|
||||
|
@ -191,22 +191,22 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* create the parallel file */
|
||||
fid=H5Fcreate(opt_file,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
|
||||
fid = H5Fcreate(opt_file, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
|
||||
VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL);
|
||||
|
||||
/* define a contiquous dataset of opt_iter*nprocs*opt_block chars */
|
||||
dims[0] = opt_iter*nprocs*opt_block;
|
||||
sid = H5Screate_simple (RANK, dims, NULL);
|
||||
dims[0] = opt_iter * nprocs * opt_block;
|
||||
sid = H5Screate_simple(RANK, dims, NULL);
|
||||
VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL);
|
||||
dataset = H5Dcreate(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
|
||||
H5P_DEFAULT);
|
||||
VRFY((dataset >= 0), "H5Dcreate succeeded", H5FATAL);
|
||||
dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL);
|
||||
|
||||
/* create the memory dataspace and the file dataspace */
|
||||
dims[0] = opt_block;
|
||||
mem_dataspace = H5Screate_simple (RANK, dims, NULL);
|
||||
mem_dataspace = H5Screate_simple(RANK, dims, NULL);
|
||||
VRFY((mem_dataspace >= 0), "", H5FATAL);
|
||||
file_dataspace = H5Dget_space (dataset);
|
||||
file_dataspace = H5Dget_space(dataset);
|
||||
VRFY((file_dataspace >= 0), "H5Dget_space succeeded", H5FATAL);
|
||||
|
||||
/* now each process writes a block of opt_block chars in round robbin
|
||||
|
@ -324,14 +324,15 @@ create_dsets(hid_t file)
|
||||
/*
|
||||
* Create a dataset using the default dataset creation properties.
|
||||
*/
|
||||
for(i=0; i<NUM_DSETS; i++) {
|
||||
for(i = 0; i < NUM_DSETS; i++) {
|
||||
sprintf(dset_name, "dataset %d", i);
|
||||
if((dataset = H5Dcreate(file, dset_name, H5T_NATIVE_DOUBLE,
|
||||
space, H5P_DEFAULT)) < 0)
|
||||
goto error;
|
||||
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
goto error;
|
||||
|
||||
if (H5Dclose(dataset) < 0) goto error;
|
||||
}
|
||||
if(H5Dclose(dataset) < 0)
|
||||
goto error;
|
||||
} /* end for */
|
||||
|
||||
return 0;
|
||||
|
||||
@ -472,7 +473,7 @@ create_attrs_2(void)
|
||||
char attr_name[128];
|
||||
int i, j;
|
||||
p_time attr_t = {0, 0, 0, 1000000, 0, ""};
|
||||
p_time create_t = {0, 0, 0, 1000000, 0, "H5Dcreate"};
|
||||
p_time create_t = {0, 0, 0, 1000000, 0, "H5Dcreate2"};
|
||||
p_time close_t = {0, 0, 0, 1000000, 0, ""};
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
@ -493,8 +494,8 @@ create_attrs_2(void)
|
||||
for(i = 0; i < NUM_DSETS; i++) {
|
||||
sprintf(dset_name, "dataset %d", i);
|
||||
create_t.start = retrieve_time();
|
||||
if((dataset = H5Dcreate(file, dset_name, H5T_NATIVE_DOUBLE,
|
||||
space, H5P_DEFAULT)) < 0)
|
||||
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE,
|
||||
space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
goto error;
|
||||
perf(&create_t, create_t.start, retrieve_time());
|
||||
|
||||
|
@ -848,17 +848,17 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
|
||||
}/* end else */
|
||||
|
||||
sprintf(dname, "Dataset_%ld", ndset);
|
||||
h5ds_id = H5Dcreate(fd->h5fd, dname, ELMT_H5_TYPE,
|
||||
h5dset_space_id, h5dcpl);
|
||||
h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE,
|
||||
h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT);
|
||||
|
||||
if (h5ds_id < 0) {
|
||||
if(h5ds_id < 0) {
|
||||
fprintf(stderr, "HDF5 Dataset Create failed\n");
|
||||
GOTOERROR(FAIL);
|
||||
}
|
||||
|
||||
hrc = H5Pclose(h5dcpl);
|
||||
/* verifying the close of the dcpl */
|
||||
if (hrc < 0) {
|
||||
if(hrc < 0) {
|
||||
fprintf(stderr, "HDF5 Property List Close failed\n");
|
||||
GOTOERROR(FAIL);
|
||||
}
|
||||
|
@ -106,9 +106,10 @@ H5D_init_deprec_interface(void)
|
||||
FUNC_LEAVE_NOAPI(H5D_init())
|
||||
} /* H5D_init_deprec_interface() */
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Dcreate
|
||||
* Function: H5Dcreate1
|
||||
*
|
||||
* Purpose: Creates a new dataset named NAME at LOC_ID, opens the
|
||||
* dataset for access, and associates with that dataset constant
|
||||
@ -137,7 +138,7 @@ H5D_init_deprec_interface(void)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hid_t
|
||||
H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
|
||||
H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
|
||||
hid_t dcpl_id)
|
||||
{
|
||||
H5G_loc_t loc; /* Object location to insert dataset into */
|
||||
@ -145,7 +146,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
|
||||
const H5S_t *space; /* Dataspace for dataset */
|
||||
hid_t ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(H5Dcreate, FAIL)
|
||||
FUNC_ENTER_API(H5Dcreate1, FAIL)
|
||||
H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, dcpl_id);
|
||||
|
||||
/* Check arguments */
|
||||
@ -178,9 +179,8 @@ done:
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")
|
||||
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Dcreate() */
|
||||
} /* end H5Dcreate1() */
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Dopen1
|
||||
|
@ -116,14 +116,6 @@ H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
|
||||
H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t *size);
|
||||
H5_DLL herr_t H5Ddebug(hid_t dset_id);
|
||||
|
||||
/* Functions and variables defined for compatibility with previous versions
|
||||
* of the HDF5 API.
|
||||
*
|
||||
* Use of these functions and variables is deprecated.
|
||||
*/
|
||||
H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id,
|
||||
hid_t space_id, hid_t plist_id);
|
||||
|
||||
/* Symbols defined for compatibility with previous versions of the HDF5 API.
|
||||
*
|
||||
* Use of these symbols is deprecated.
|
||||
@ -137,6 +129,8 @@ H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id,
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
|
||||
hid_t space_id, hid_t dcpl_id);
|
||||
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
|
||||
H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t *size);
|
||||
|
||||
|
@ -321,8 +321,13 @@ H5E_get_stack(void)
|
||||
|
||||
/* Set the thread-specific info */
|
||||
estack->nused = 0;
|
||||
#ifdef H5_USE_16_API
|
||||
estack->auto_op.vers = 1;
|
||||
estack->auto_op.u.func1 = (H5E_auto1_t)H5Eprint1;
|
||||
#else /* H5_USE_16_API */
|
||||
estack->auto_op.vers = 2;
|
||||
estack->auto_op.u.func2 = (H5E_auto2_t)H5Eprint2;
|
||||
#endif /* H5_USE_16_API */
|
||||
estack->auto_data = NULL;
|
||||
|
||||
/* (It's not necessary to release this in this API, it is
|
||||
|
@ -49,6 +49,7 @@ FUNCTION: H5Acreate; ; v10, v18
|
||||
FUNCTION: H5Adelete; ; v10, v18
|
||||
FUNCTION: H5Aiterate; H5A_operator; v10, v18
|
||||
FUNCTION: H5Arename; ; v16, v18
|
||||
FUNCTION: H5Dcreate; ; v10, v18
|
||||
FUNCTION: H5Dopen; ; v10, v18
|
||||
FUNCTION: H5Eclear; ; v10, v18
|
||||
FUNCTION: H5Eget_auto; ; v10, v18
|
||||
|
@ -54,6 +54,10 @@
|
||||
#define H5Arename_vers 1
|
||||
#endif /* !defined(H5Arename_vers) */
|
||||
|
||||
#if !defined(H5Dcreate_vers)
|
||||
#define H5Dcreate_vers 1
|
||||
#endif /* !defined(H5Dcreate_vers) */
|
||||
|
||||
#if !defined(H5Dopen_vers)
|
||||
#define H5Dopen_vers 1
|
||||
#endif /* !defined(H5Dopen_vers) */
|
||||
@ -169,6 +173,17 @@
|
||||
#error "H5Arename_vers set to invalid value"
|
||||
#endif /* H5Arename_vers */
|
||||
|
||||
#if !defined(H5Dcreate_vers) || H5Dcreate_vers == 2
|
||||
#ifndef H5Dcreate_vers
|
||||
#define H5Dcreate_vers 2
|
||||
#endif /* H5Dcreate_vers */
|
||||
#define H5Dcreate H5Dcreate2
|
||||
#elif H5Dcreate_vers == 1
|
||||
#define H5Dcreate H5Dcreate1
|
||||
#else /* H5Dcreate_vers */
|
||||
#error "H5Dcreate_vers set to invalid value"
|
||||
#endif /* H5Dcreate_vers */
|
||||
|
||||
#if !defined(H5Dopen_vers) || H5Dopen_vers == 2
|
||||
#ifndef H5Dopen_vers
|
||||
#define H5Dopen_vers 2
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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.";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
1058
test/dsets.c
1058
test/dsets.c
File diff suppressed because it is too large
Load Diff
@ -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((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_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);
|
||||
|
@ -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) {
|
||||
|
11
test/enum.c
11
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");
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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++)
|
||||
|
112
test/external.c
112
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 */
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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.
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
|
12
test/links.c
12
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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
192
test/ntypes.c
192
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;
|
||||
}
|
||||
|
102
test/objcopy.c
102
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 */
|
||||
|
@ -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!).
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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 */
|
||||
/* ------------------------- */
|
||||
|
225
test/tattr.c
225
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) {
|
||||
|
@ -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);
|
||||
|
62
test/tfile.c
62
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");
|
||||
|
||||
|
@ -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");
|
||||
|
||||
|
16
test/th5o.c
16
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");
|
||||
|
||||
|
42
test/th5s.c
42
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 */
|
||||
|
@ -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);
|
||||
|
469
test/tmisc.c
469
test/tmisc.c
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
|
@ -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);
|
||||
|
70
test/tsohm.c
70
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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
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));
|
||||
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);
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* close dataset and dataspace resources */
|
||||
ret = H5Dclose(dataset);
|
||||
assert(ret >= 0);
|
||||
ret = H5Sclose(dataspace);
|
||||
assert(ret >= 0);
|
||||
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void cleanup_dcreate(void)
|
||||
{
|
||||
HDunlink(FILENAME);
|
||||
HDunlink(FILENAME);
|
||||
}
|
||||
#endif /*H5_HAVE_THREADSAFE*/
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
146
test/tvltypes.c
146
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");
|
||||
|
@ -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
|
||||
|
12
test/vfd.c
12
test/vfd.c
@ -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++)
|
||||
|
@ -126,46 +126,34 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
|
||||
VRFY((file_id >= 0), "H5Fcreate");
|
||||
|
||||
/* Modify dataset creation properties, i.e. enable chunking */
|
||||
cparms = H5Pcreate (H5P_DATASET_CREATE);
|
||||
cparms = H5Pcreate(H5P_DATASET_CREATE);
|
||||
VRFY((cparms >= 0), "");
|
||||
|
||||
hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY);
|
||||
VRFY((hrc >= 0), "");
|
||||
|
||||
hrc = H5Pset_chunk ( cparms, 1, chunk_dims);
|
||||
hrc = H5Pset_chunk(cparms, 1, chunk_dims);
|
||||
VRFY((hrc >= 0), "");
|
||||
|
||||
/* Create a new dataset within the file using cparms creation properties. */
|
||||
dataset = H5Dcreate (file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, cparms);
|
||||
dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
|
||||
VRFY((dataset >= 0), "");
|
||||
|
||||
switch (write_pattern) {
|
||||
if(write_pattern == sec_last) {
|
||||
HDmemset(buffer, 100, CHUNKSIZE);
|
||||
|
||||
/* writes only the second to last chunk */
|
||||
case sec_last:
|
||||
count[0] = 1;
|
||||
stride[0] = 1;
|
||||
block[0] = chunk_dims[0];
|
||||
offset[0] = (nchunks-2)*chunk_dims[0];
|
||||
|
||||
memset(buffer, 100, CHUNKSIZE);
|
||||
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
|
||||
VRFY((hrc >= 0), "");
|
||||
|
||||
count[0] = 1;
|
||||
stride[0] = 1;
|
||||
block[0] = chunk_dims[0];
|
||||
offset[0] = (nchunks-2)*chunk_dims[0];
|
||||
|
||||
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
|
||||
VRFY((hrc >= 0), "");
|
||||
|
||||
/* Write sec_last chunk */
|
||||
hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
|
||||
VRFY((hrc >= 0), "H5Dwrite");
|
||||
|
||||
break;
|
||||
|
||||
|
||||
/* doesn't write anything */
|
||||
case none:
|
||||
|
||||
break;
|
||||
}
|
||||
/* Write sec_last chunk */
|
||||
hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
|
||||
VRFY((hrc >= 0), "H5Dwrite");
|
||||
} /* end if */
|
||||
|
||||
/* Close resources */
|
||||
hrc = H5Dclose (dataset);
|
||||
@ -187,7 +175,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
|
||||
|
||||
/* verify file size */
|
||||
filesize = get_filesize(filename);
|
||||
est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char);
|
||||
est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char);
|
||||
VRFY((filesize >= est_filesize), "file size check");
|
||||
|
||||
}
|
||||
|
@ -598,14 +598,14 @@ coll_chunktest(const char* filename,
|
||||
|
||||
|
||||
/* allocate memory for data buffer */
|
||||
data_array1 = (int *)malloc(dims[0]*dims[1]*sizeof(int));
|
||||
data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int));
|
||||
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
|
||||
|
||||
/* set up dimensions of the slab this process accesses */
|
||||
ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor);
|
||||
|
||||
file_dataspace = H5Screate_simple(2, dims, NULL);
|
||||
VRFY((file_dataspace >= 0),"file dataspace created succeeded");
|
||||
VRFY((file_dataspace >= 0), "file dataspace created succeeded");
|
||||
|
||||
crp_plist = H5Pcreate(H5P_DATASET_CREATE);
|
||||
VRFY((crp_plist >= 0),"");
|
||||
@ -619,29 +619,29 @@ coll_chunktest(const char* filename,
|
||||
status = H5Pset_chunk(crp_plist, 2, chunk_dims);
|
||||
VRFY((status >= 0),"chunk creation property list succeeded");
|
||||
|
||||
dataset = H5Dcreate(file,DSET_COLLECTIVE_CHUNK_NAME,H5T_NATIVE_INT,
|
||||
file_dataspace,crp_plist);
|
||||
dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT,
|
||||
file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT);
|
||||
VRFY((dataset >= 0),"dataset created succeeded");
|
||||
|
||||
status = H5Pclose(crp_plist);
|
||||
VRFY((status >= 0),"");
|
||||
VRFY((status >= 0), "");
|
||||
|
||||
/*put some trivial data in the data array */
|
||||
ccdataset_fill(start, stride,count,block, data_array1);
|
||||
ccdataset_fill(start, stride, count,block, data_array1);
|
||||
MESG("data_array initialized");
|
||||
|
||||
status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
|
||||
status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
|
||||
count, block);
|
||||
VRFY((status >= 0),"hyperslab selection succeeded");
|
||||
|
||||
/* set up the collective transfer property list */
|
||||
xfer_plist = H5Pcreate(H5P_DATASET_XFER);
|
||||
VRFY((xfer_plist >= 0),"");
|
||||
VRFY((xfer_plist >= 0), "");
|
||||
|
||||
status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
|
||||
VRFY((status>= 0),"MPIO collective transfer property succeeded");
|
||||
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
|
||||
status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
|
||||
status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO);
|
||||
VRFY((status>= 0),"set independent IO collectively succeeded");
|
||||
}
|
||||
|
||||
|
480
testpar/t_dset.c
480
testpar/t_dset.c
File diff suppressed because it is too large
Load Diff
@ -86,35 +86,33 @@ filter_read_internal(const char *filename, hid_t dcpl,
|
||||
VRFY(sid>=0, "H5Screate_simple");
|
||||
|
||||
/* Create buffers */
|
||||
points = (int *)HDmalloc(size[0]*size[1]*sizeof(int));
|
||||
points = (int *)HDmalloc(size[0] * size[1] * sizeof(int));
|
||||
VRFY(points!=NULL, "HDmalloc");
|
||||
|
||||
check = (int *)HDmalloc(hs_size[0]*hs_size[1]*sizeof(int));
|
||||
check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int));
|
||||
VRFY(check!=NULL, "HDmalloc");
|
||||
|
||||
/* Initialize writing buffer with random data */
|
||||
for (i=0; i<size[0]; i++) {
|
||||
for (j=0; j<size[1]; j++) {
|
||||
points[i*size[1]+j] = (int)(i+j+7);
|
||||
}
|
||||
}
|
||||
for(i = 0; i < size[0]; i++)
|
||||
for(j = 0; j < size[1]; j++)
|
||||
points[i * size[1]+j] = (int)(i+j+7);
|
||||
|
||||
VRFY(H5Pall_filters_avail(dcpl), "Incorrect filter availability");
|
||||
|
||||
/* Serial write phase */
|
||||
if (MAINPROCESS){
|
||||
if(MAINPROCESS) {
|
||||
|
||||
file = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||
VRFY(file>=0, "H5Fcreate");
|
||||
|
||||
/* Create the dataset */
|
||||
dataset = H5Dcreate(file, name, H5T_NATIVE_INT, sid, dcpl);
|
||||
VRFY(dataset>=0, "H5Dcreate");
|
||||
dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
VRFY(dataset>=0, "H5Dcreate2");
|
||||
|
||||
hrc = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points);
|
||||
VRFY(hrc>=0, "H5Dwrite");
|
||||
|
||||
*dset_size=H5Dget_storage_size(dataset);
|
||||
*dset_size = H5Dget_storage_size(dataset);
|
||||
VRFY(*dset_size>0, "H5Dget_storage_size");
|
||||
|
||||
hrc = H5Dclose (dataset);
|
||||
@ -153,7 +151,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
|
||||
/* Check that the values read are the same as the values written */
|
||||
for (i=0; i<hs_size[0]; i++) {
|
||||
for (j=0; j<hs_size[1]; j++) {
|
||||
if (points[i*size[1]+(size_t)hs_offset[1]+j] !=
|
||||
if(points[i*size[1]+(size_t)hs_offset[1]+j] !=
|
||||
check[i*hs_size[1]+j]) {
|
||||
fprintf(stderr," Read different values than written.\n");
|
||||
fprintf(stderr," At index %lu,%lu\n",
|
||||
@ -235,13 +233,13 @@ test_filter_read(void)
|
||||
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 */
|
||||
|
||||
filename = GetTestParameters();
|
||||
|
||||
if (VERBOSE_MED)
|
||||
if(VERBOSE_MED)
|
||||
printf("Parallel reading of dataset written with filters %s\n", filename);
|
||||
|
||||
/*----------------------------------------------------------
|
||||
@ -312,7 +310,7 @@ test_filter_read(void)
|
||||
*----------------------------------------------------------
|
||||
*/
|
||||
#ifdef H5_HAVE_FILTER_SZIP
|
||||
if ( h5_szip_can_encode() == 1) {
|
||||
if(h5_szip_can_encode() == 1) {
|
||||
dc = H5Pcreate(H5P_DATASET_CREATE);
|
||||
VRFY(dc>=0, "H5Pcreate");
|
||||
|
||||
@ -424,7 +422,7 @@ test_filter_read(void)
|
||||
VRFY(hrc>=0, "H5Pset_shuffle");
|
||||
|
||||
/* Make sure encoding is enabled */
|
||||
if ( h5_szip_can_encode() == 1) {
|
||||
if(h5_szip_can_encode() == 1) {
|
||||
hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
|
||||
VRFY(hrc>=0, "H5Pset_szip");
|
||||
|
||||
@ -437,7 +435,7 @@ test_filter_read(void)
|
||||
|
||||
/* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */
|
||||
/* Make sure encoding is enabled */
|
||||
if ( h5_szip_can_encode() == 1) {
|
||||
if(h5_szip_can_encode() == 1) {
|
||||
dc = H5Pcreate(H5P_DATASET_CREATE);
|
||||
VRFY(dc>=0, "H5Pcreate");
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user