mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
Merge pull request #1427 in HDFFV/hdf5 from ~JAKE.SMITH/hdf5:dset_ohdr_minimize to develop
* commit '763db8178e673fdcae4a370fe2e6d345f905d5f1': Change FAIL_PUTS_ERROR to TEST_ERROR. Update calls: H5Dcreate to H5Dcreate2, H5Acreate to H5Acreate2.
This commit is contained in:
commit
9ac12ce299
34
test/dsets.c
34
test/dsets.c
@ -13072,15 +13072,15 @@ test_object_header_minimization_dcpl(void)
|
||||
/*********/
|
||||
|
||||
if(NULL == h5_fixname(OHMIN_FILENAME_A, H5P_DEFAULT, filename, sizeof(filename)))
|
||||
FAIL_PUTS_ERROR("unable to prepare filename")
|
||||
TEST_ERROR("unable to prepare filename")
|
||||
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if (0 > file_id)
|
||||
FAIL_PUTS_ERROR("unable to create test file\n");
|
||||
TEST_ERROR("unable to create test file\n");
|
||||
|
||||
dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
|
||||
if (0 > dcpl_id)
|
||||
FAIL_PUTS_ERROR("unable to create DCPL\n");
|
||||
TEST_ERROR("unable to create DCPL\n");
|
||||
|
||||
/*********/
|
||||
/* TESTS */
|
||||
@ -13089,27 +13089,27 @@ test_object_header_minimization_dcpl(void)
|
||||
/* default value (not set explicitly)
|
||||
*/
|
||||
if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL)
|
||||
FAIL_PUTS_ERROR("unable to get minimize value\n");
|
||||
TEST_ERROR("unable to get minimize value\n");
|
||||
if (FALSE != minimize)
|
||||
FAIL_PUTS_ERROR("Expected FALSE default but was not!\n");
|
||||
TEST_ERROR("Expected FALSE default but was not!\n");
|
||||
|
||||
/* FALSE-set value
|
||||
*/
|
||||
if (H5Pset_dset_no_attrs_hint(dcpl_id, FALSE) == FAIL)
|
||||
FAIL_PUTS_ERROR("unable to set minimize value to FALSE\n");
|
||||
TEST_ERROR("unable to set minimize value to FALSE\n");
|
||||
if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL)
|
||||
FAIL_PUTS_ERROR("unable to get minimize value\n");
|
||||
TEST_ERROR("unable to get minimize value\n");
|
||||
if (FALSE != minimize)
|
||||
FAIL_PUTS_ERROR("Expected FALSE default but was not!\n");
|
||||
TEST_ERROR("Expected FALSE default but was not!\n");
|
||||
|
||||
/* TRUE-set value
|
||||
*/
|
||||
if (H5Pset_dset_no_attrs_hint(dcpl_id, TRUE) == FAIL)
|
||||
FAIL_PUTS_ERROR("unable to set minimize value to TRUE\n");
|
||||
TEST_ERROR("unable to set minimize value to TRUE\n");
|
||||
if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL)
|
||||
FAIL_PUTS_ERROR("unable to get minimize value\n");
|
||||
TEST_ERROR("unable to get minimize value\n");
|
||||
if (TRUE != minimize)
|
||||
FAIL_PUTS_ERROR("Expected TRUE default but was not!\n");
|
||||
TEST_ERROR("Expected TRUE default but was not!\n");
|
||||
|
||||
/* error cases
|
||||
*/
|
||||
@ -13117,35 +13117,35 @@ test_object_header_minimization_dcpl(void)
|
||||
ret = H5Pget_dset_no_attrs_hint(-1, &minimize);
|
||||
} H5E_END_TRY;
|
||||
if (ret == SUCCEED)
|
||||
FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
|
||||
TEST_ERROR("Invalid DCPL ID should fail\n");
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Pset_dset_no_attrs_hint(-1, FALSE);
|
||||
} H5E_END_TRY;
|
||||
if (ret == SUCCEED)
|
||||
FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
|
||||
TEST_ERROR("Invalid DCPL ID should fail\n");
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Pset_dset_no_attrs_hint(-1, TRUE);
|
||||
} H5E_END_TRY;
|
||||
if (ret == SUCCEED)
|
||||
FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
|
||||
TEST_ERROR("Invalid DCPL ID should fail\n");
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Pget_dset_no_attrs_hint(dcpl_id, NULL);
|
||||
} H5E_END_TRY;
|
||||
if (ret == SUCCEED)
|
||||
FAIL_PUTS_ERROR("NULL out pointer should fail\n");
|
||||
TEST_ERROR("NULL out pointer should fail\n");
|
||||
|
||||
/************/
|
||||
/* TEARDOWN */
|
||||
/************/
|
||||
|
||||
if (H5Fclose(file_id) == FAIL)
|
||||
FAIL_PUTS_ERROR("can't close FILE");
|
||||
TEST_ERROR("can't close FILE");
|
||||
|
||||
if (H5Pclose(dcpl_id) == FAIL)
|
||||
FAIL_PUTS_ERROR("unable to close DCPL\n");
|
||||
TEST_ERROR("unable to close DCPL\n");
|
||||
|
||||
PASSED();
|
||||
return SUCCEED;
|
||||
|
40
test/ohdr.c
40
test/ohdr.c
@ -753,7 +753,7 @@ put_attribute(hid_t loc_id, const char *attrname, const void *attrvalue, hid_t d
|
||||
{
|
||||
if((*attribute_id) < 0) {
|
||||
hid_t id = -1;
|
||||
id = H5Acreate(loc_id, attrname, datatype_id, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);
|
||||
id = H5Acreate2(loc_id, attrname, datatype_id, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(id < 0)
|
||||
return FAIL;
|
||||
*attribute_id = id;
|
||||
@ -879,10 +879,10 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id)
|
||||
} H5E_END_TRY;
|
||||
if(count != -1) TEST_ERROR
|
||||
|
||||
dset_id = H5Dcreate(file_id, "dataset", int_type_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dset_id = H5Dcreate2(file_id, "dataset", int_type_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_id < 0) TEST_ERROR
|
||||
|
||||
mindset_id = H5Dcreate(file_id, "mindataset", int_type_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
mindset_id = H5Dcreate2(file_id, "mindataset", int_type_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
if(mindset_id < 0) TEST_ERROR
|
||||
|
||||
/********************
|
||||
@ -1121,13 +1121,13 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id)
|
||||
file_f_id = H5Fcreate(filename_a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_f_id < 0) TEST_ERROR
|
||||
|
||||
dset_f_x_id = H5Dcreate(file_f_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
|
||||
dset_f_x_id = H5Dcreate2(file_f_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
|
||||
if(dset_f_x_id < 0) TEST_ERROR
|
||||
|
||||
dset_f_N_id = H5Dcreate(file_f_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
|
||||
dset_f_N_id = H5Dcreate2(file_f_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
|
||||
if(dset_f_N_id < 0) TEST_ERROR
|
||||
|
||||
dset_f_Y_id = H5Dcreate(file_f_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
|
||||
dset_f_Y_id = H5Dcreate2(file_f_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
|
||||
if(dset_f_x_id < 0) TEST_ERROR
|
||||
|
||||
file_F_id = H5Fcreate(filename_b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
@ -1135,13 +1135,13 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id)
|
||||
ret = H5Fset_dset_no_attrs_hint(file_F_id, TRUE);
|
||||
if(ret < 0) TEST_ERROR
|
||||
|
||||
dset_F_x_id = H5Dcreate(file_F_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
|
||||
dset_F_x_id = H5Dcreate2(file_F_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
|
||||
if(dset_F_x_id < 0) TEST_ERROR
|
||||
|
||||
dset_F_N_id = H5Dcreate(file_F_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
|
||||
dset_F_N_id = H5Dcreate2(file_F_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
|
||||
if(dset_F_N_id < 0) TEST_ERROR
|
||||
|
||||
dset_F_Y_id = H5Dcreate(file_F_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
|
||||
dset_F_Y_id = H5Dcreate2(file_F_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
|
||||
if(dset_F_Y_id < 0) TEST_ERROR
|
||||
|
||||
/*********
|
||||
@ -1276,16 +1276,16 @@ test_minimized_dset_ohdr_with_filter(hid_t fapl_id)
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_xx_id = H5Dcreate(file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dset_xx_id = H5Dcreate2(file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_xx_id < 0) TEST_ERROR
|
||||
|
||||
dset_mx_id = H5Dcreate(file_id, "Mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
|
||||
dset_mx_id = H5Dcreate2(file_id, "Mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
|
||||
if(dset_mx_id < 0) TEST_ERROR
|
||||
|
||||
dset_xZ_id = H5Dcreate(file_id, "xZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xZ_id, H5P_DEFAULT);
|
||||
dset_xZ_id = H5Dcreate2(file_id, "xZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xZ_id, H5P_DEFAULT);
|
||||
if(dset_xZ_id < 0) TEST_ERROR
|
||||
|
||||
dset_mZ_id = H5Dcreate(file_id, "MZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mZ_id, H5P_DEFAULT);
|
||||
dset_mZ_id = H5Dcreate2(file_id, "MZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mZ_id, H5P_DEFAULT);
|
||||
if(dset_mZ_id < 0) TEST_ERROR
|
||||
|
||||
/*********
|
||||
@ -1435,18 +1435,18 @@ test_minimized_dset_ohdr_modification_times(hid_t _fapl_id)
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_xx_id = H5Dcreate( file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
dset_xx_id = H5Dcreate2( file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if(dset_xx_id < 0) TEST_ERROR
|
||||
|
||||
dset_mx_id = H5Dcreate(file_id, "mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
|
||||
dset_mx_id = H5Dcreate2(file_id, "mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
|
||||
if(dset_mx_id < 0) TEST_ERROR
|
||||
|
||||
dset_xT_id = H5Dcreate(file_id, "xT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xT_id, H5P_DEFAULT);
|
||||
dset_xT_id = H5Dcreate2(file_id, "xT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xT_id, H5P_DEFAULT);
|
||||
if(dset_xT_id < 0) TEST_ERROR
|
||||
dset_mT_id = H5Dcreate(file_id, "mT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mT_id, H5P_DEFAULT);
|
||||
dset_mT_id = H5Dcreate2(file_id, "mT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mT_id, H5P_DEFAULT);
|
||||
if(dset_mT_id < 0) TEST_ERROR
|
||||
|
||||
dset_mN_id = H5Dcreate(file_id, "mN", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mN_id, H5P_DEFAULT);
|
||||
dset_mN_id = H5Dcreate2(file_id, "mN", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mN_id, H5P_DEFAULT);
|
||||
if(dset_mN_id < 0) TEST_ERROR
|
||||
|
||||
/* ----- *
|
||||
@ -1561,7 +1561,7 @@ test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id)
|
||||
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_0_id = H5Dcreate(file_id, "fullrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
dset_0_id = H5Dcreate2(file_id, "fullrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
if(dset_0_id < 0) TEST_ERROR
|
||||
|
||||
/* Close file and re-open with different libver bounds.
|
||||
@ -1576,7 +1576,7 @@ test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id)
|
||||
file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
|
||||
if(file_id < 0) TEST_ERROR
|
||||
|
||||
dset_1_id = H5Dcreate(file_id, "upperrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
dset_1_id = H5Dcreate2(file_id, "upperrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
|
||||
if(dset_1_id < 0) TEST_ERROR
|
||||
|
||||
/* re-open "fullrange" dataset
|
||||
|
Loading…
Reference in New Issue
Block a user