diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-08-11 19:13:45 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-08-11 19:13:45 (GMT) |
commit | 88fb6b1374e748b06826e17ca65c15087ae5b5ac (patch) | |
tree | 7c550af01bb506aa5d5bb9208abad6687f7b0f3a /test | |
parent | 2a5454616a653b9830c103be7381af28ba397a3d (diff) | |
download | hdf5-88fb6b1374e748b06826e17ca65c15087ae5b5ac.zip hdf5-88fb6b1374e748b06826e17ca65c15087ae5b5ac.tar.gz hdf5-88fb6b1374e748b06826e17ca65c15087ae5b5ac.tar.bz2 |
[svn-r25531] remove use of C99 PRI that failed on windows in dtypes.c
fix bugs where hid_t were assumed to be 32 bit ints or herr_t.
Diffstat (limited to 'test')
-rw-r--r-- | test/dtypes.c | 16 | ||||
-rw-r--r-- | test/links.c | 4 | ||||
-rw-r--r-- | test/tattr.c | 82 | ||||
-rw-r--r-- | test/th5s.c | 5 | ||||
-rw-r--r-- | test/trefer.c | 13 |
5 files changed, 65 insertions, 55 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 65f5f8c..b2783c3 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -65,8 +65,8 @@ FAIL_STACK_ERROR \ if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \ H5_FAILED(); \ - printf(" #dtype ids expected: %lld; found: %"PRId64"\n", (long long)NMEMBS, \ - H5I_nmembers(H5I_DATATYPE)); \ + printf(" #dtype ids expected: %lld; found: %lld\n", \ + (long long)NMEMBS, (long long)H5I_nmembers(H5I_DATATYPE)); \ goto error; \ } @@ -3008,7 +3008,7 @@ test_compound_16(void) if(H5Fget_obj_ids(file, H5F_OBJ_DATATYPE, (size_t)2, open_dtypes) < 0) TEST_ERROR if(open_dtypes[1]) { H5_FAILED(); AT(); - printf(" H5Fget_obj_ids returned as second id: %"PRId64"; expected: 0\n", open_dtypes[1]); + printf(" H5Fget_obj_ids returned as second id: %lld; expected: 0\n", (long long)open_dtypes[1]); goto error; } @@ -3549,6 +3549,7 @@ test_transient (hid_t fapl) static hsize_t ds_size[2] = {10, 20}; hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1; char filename[1024]; + hid_t ret_id; /* Generic hid_t return value */ herr_t status; TESTING("transient datatypes"); @@ -3583,9 +3584,9 @@ test_transient (hid_t fapl) /* It should not be possible to create an attribute for a transient type */ H5E_BEGIN_TRY { - status = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); + ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if (ret_id>=0) { H5_FAILED(); HDputs (" Attributes should not be allowed for transient types!"); goto error; @@ -5147,6 +5148,7 @@ test_encode(void) size_t enum_buf_size = 0; size_t vlstr_buf_size = 0; unsigned char *cmpd_buf=NULL, *enum_buf=NULL, *vlstr_buf=NULL; + hid_t ret_id; herr_t ret; TESTING("functions of encoding and decoding datatypes"); @@ -5247,9 +5249,9 @@ test_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret = H5Tdecode(cmpd_buf); + ret_id = H5Tdecode(cmpd_buf); } H5E_END_TRY; - if(ret!=FAIL) { + if(ret_id!=FAIL) { H5_FAILED(); printf("Decoded bogus buffer!\n"); goto error; diff --git a/test/links.c b/test/links.c index 09c2d4d..00d8d04 100644 --- a/test/links.c +++ b/test/links.c @@ -12878,7 +12878,7 @@ open_by_idx(hid_t fapl) char valname[NAME_BUF_SIZE]; /* Link value */ haddr_t *objno = NULL; /* Addresses of the objects created */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t ret; /* Generic return value */ /* Create group creation property list */ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR @@ -13103,7 +13103,7 @@ open_by_idx_old(hid_t fapl) char valname[NAME_BUF_SIZE]; /* Link value */ haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t ret; /* Generic return value */ /* Create file to mount */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); diff --git a/test/tattr.c b/test/tattr.c index 57b3263..2885124 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -178,6 +178,7 @@ test_attr_basic_write(hid_t fapl) hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ int i; + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -228,8 +229,8 @@ test_attr_basic_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write attribute information */ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data1); @@ -366,8 +367,8 @@ test_attr_basic_write(hid_t fapl) VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5Aget_storage_size"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write attribute information */ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data2); @@ -682,6 +683,7 @@ test_attr_compound_write(hid_t fapl) hid_t attr; /* Attribute ID */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -725,8 +727,8 @@ test_attr_compound_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(dataset, ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write complex attribute data */ ret = H5Awrite(attr, tid1, attr_data4); @@ -917,6 +919,7 @@ test_attr_scalar_write(hid_t fapl) hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -943,8 +946,8 @@ test_attr_scalar_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(dataset, ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write attribute information */ ret = H5Awrite(attr, H5T_NATIVE_FLOAT, &attr_data5); @@ -1057,6 +1060,7 @@ test_attr_mult_write(hid_t fapl) hsize_t dims2[] = {ATTR1_DIM1}; hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1087,8 +1091,8 @@ test_attr_mult_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write 1st attribute data */ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data1); @@ -1111,8 +1115,8 @@ test_attr_mult_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write 2nd attribute information */ ret = H5Awrite(attr, H5T_NATIVE_INT, attr_data2); @@ -1135,8 +1139,8 @@ test_attr_mult_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret = H5Acreate2(dataset, ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Acreate2"); + ret_id = H5Acreate2(dataset, ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write 3rd attribute information */ ret = H5Awrite(attr, H5T_NATIVE_DOUBLE, attr_data3); @@ -7203,6 +7207,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ @@ -7297,8 +7302,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Check for opening an attribute on an object with no attributes */ - ret = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_idx"); + ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_idx"); /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { @@ -7330,8 +7335,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Check for out of bound opening an attribute on an object */ - ret = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_idx"); + ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_idx"); /* Test opening attributes by index stored compactly */ ret = attr_open_by_idx_check(my_dataset, idx_type, order, u); @@ -7403,8 +7408,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Check for out of bound opening an attribute on an object */ - ret = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_idx"); + ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_idx"); /* Test opening attributes by index stored compactly */ ret = attr_open_by_idx_check(my_dataset, idx_type, order, u); @@ -7549,6 +7554,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ @@ -7618,14 +7624,14 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Check for opening a non-existant attribute on an object with no attributes */ - ret = H5Aopen(my_dataset, "foo", H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen"); + ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen"); - ret = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_name"); + ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_name"); - ret = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_name"); + ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_name"); /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { @@ -7657,14 +7663,14 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Check for opening a non-existant attribute on an object with compact attribute storage */ - ret = H5Aopen(my_dataset, "foo", H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen"); + ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen"); - ret = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_name"); + ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_name"); - ret = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_name"); + ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_name"); /* Test opening attributes stored compactly */ ret = attr_open_check(fid, dsetname, my_dataset, u); @@ -7739,14 +7745,14 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Check for opening a non-existant attribute on an object with dense attribute storage */ - ret = H5Aopen(my_dataset, "foo", H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen"); + ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen"); - ret = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_name"); + ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_name"); - ret = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Aopen_by_name"); + ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret_id, FAIL, "H5Aopen_by_name"); /* Test opening attributes stored compactly */ ret = attr_open_check(fid, dsetname, my_dataset, u); diff --git a/test/th5s.c b/test/th5s.c index ebbaa37..43ad1bb 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1171,6 +1171,7 @@ test_h5s_encode(void) H5S_sel_type sel_type; H5S_class_t space_type; hssize_t nblocks; + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1195,9 +1196,9 @@ test_h5s_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret = H5Sdecode(sbuf); + ret_id = H5Sdecode(sbuf); } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Sdecode"); + VERIFY(ret_id, FAIL, "H5Sdecode"); ret = H5Sencode(sid1, sbuf, &sbuf_size); CHECK(ret, FAIL, "H5Sencode"); diff --git a/test/trefer.c b/test/trefer.c index 7e08018..9cb7f26 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -83,6 +83,7 @@ test_reference_params(void) unsigned *tu32; /* Temporary pointer to uint32 data */ int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ + hid_t ret_id; /* Generic hid_t return value */ herr_t ret; /* Generic return value */ size_t name_size; /* Size of reference name */ @@ -210,12 +211,12 @@ test_reference_params(void) VERIFY(name_size, FAIL, "H5Rget_name type"); /* Test parameters to H5Rget_region */ - ret = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); - VERIFY(ret, FAIL, "H5Rget_region loc_id"); - ret = H5Rget_region(fid1, H5R_OBJECT, NULL); - VERIFY(ret, FAIL, "H5Rget_region ref"); - ret = H5Rget_region(fid1, H5R_OBJECT, &rbuf[0]); - VERIFY(ret, FAIL, "H5Rget_region type"); + ret_id = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); + VERIFY(ret_id, FAIL, "H5Rget_region loc_id"); + ret_id = H5Rget_region(fid1, H5R_OBJECT, NULL); + VERIFY(ret_id, FAIL, "H5Rget_region ref"); + ret_id = H5Rget_region(fid1, H5R_OBJECT, &rbuf[0]); + VERIFY(ret_id, FAIL, "H5Rget_region type"); /* Close disk dataspace */ ret = H5Sclose(sid1); |