summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKimmy Mu <kmu@hdfgroup.org>2020-01-24 01:42:50 (GMT)
committerKimmy Mu <kmu@hdfgroup.org>2020-01-24 01:42:50 (GMT)
commitd038d8510032696e4defd86f1906e7d4fa133ba9 (patch)
treea77fdb4be46d9c9c8d4d592088583e490abc561c /test
parent037a883bd4d58061e11183b1d67d7f0cc17ddd99 (diff)
parent48cc850199901c5b67a40183262f4ead975b884f (diff)
downloadhdf5-d038d8510032696e4defd86f1906e7d4fa133ba9.zip
hdf5-d038d8510032696e4defd86f1906e7d4fa133ba9.tar.gz
hdf5-d038d8510032696e4defd86f1906e7d4fa133ba9.tar.bz2
Merge pull request #2238 in HDFFV/hdf5 from ~KMU/hdf5:hdf5_1_12 to hdf5_1_12
* commit '48cc850199901c5b67a40183262f4ead975b884f': fix test assert fail error Merge pull request #2071 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/intel_warnings to develop Merge pull request #2234 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/intel_warnings to develop
Diffstat (limited to 'test')
-rw-r--r--test/dsets.c8
-rw-r--r--test/dtypes.c4
-rw-r--r--test/h5test.c3
-rw-r--r--test/ntypes.c2
-rw-r--r--test/th5s.c13
-rw-r--r--test/tsohm.c8
6 files changed, 19 insertions, 19 deletions
diff --git a/test/dsets.c b/test/dsets.c
index ddb813e..82766bf 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -5297,7 +5297,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
(dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
@@ -5311,7 +5311,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
(dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
if(H5Sclose(space) < 0) goto error;
@@ -5326,7 +5326,7 @@ test_types(hid_t file)
(dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
@@ -5340,7 +5340,7 @@ test_types(hid_t file)
(dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
diff --git a/test/dtypes.c b/test/dtypes.c
index 46921d4..b88e5b7 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1216,8 +1216,8 @@ test_compound_6(void)
orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
s_ptr = ((struct st*)((void *)orig)) + i;
- s_ptr->b = (i*8+1) & 0x7fff;
- s_ptr->d = (i*8+6) & 0x7fff;
+ s_ptr->b = (int16_t)((i*8+1) & 0x7fff);
+ s_ptr->d = (int16_t)((i*8+6) & 0x7fff);
}
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
diff --git a/test/h5test.c b/test/h5test.c
index 76339ed..bfc44b5 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1320,8 +1320,7 @@ h5_dump_info_object(MPI_Info info)
int flag;
int i, nkeys;
- HDprintf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
- MPI_MAX_INFO_VAL);
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
if (info==MPI_INFO_NULL){
HDprintf("object is MPI_INFO_NULL\n");
}
diff --git a/test/ntypes.c b/test/ntypes.c
index 34558f5..f1d2449 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -2484,7 +2484,7 @@ test_opaque_dtype(hid_t file)
TEST_ERROR;
for(i = 0; i < sizeof(wbuf); i++)
- wbuf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ wbuf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
if(H5Sclose(space) < 0) TEST_ERROR;
diff --git a/test/th5s.c b/test/th5s.c
index 747e741..7e1e547 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -1739,12 +1739,12 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high)
case CONFIG_16:
stride = POWER16 - 1;
block = 4;
- expected_enc_size = expected_version == 3 ? 2 : 4;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 2 : 4);
break;
case CONFIG_32:
stride = POWER32 - 1;
block = 4;
- expected_enc_size = expected_version == 3 ? 4 : 8;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8);
break;
default:
@@ -1765,12 +1765,12 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high)
case CONFIG_16:
stride = POWER16 - 1;
block = POWER16 - 2;
- expected_enc_size = expected_version == 3 ? 2 : 4;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 2 : 4);
break;
case CONFIG_32:
stride = POWER32 - 1;
block = POWER32 - 2;
- expected_enc_size = expected_version == 3 ? 4 : 8;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8);
break;
default:
HDassert(0);
@@ -1912,7 +1912,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high)
for(config = CONFIG_8; config <= CONFIG_32; config++) {
hbool_t expected_to_fail = FALSE; /* Whether H5Sencode2 is expected to fail */
uint32_t expected_version = 0; /* Expected version for selection info */
- uint8_t expected_enc_size = 0; /* Expected encoded size for selection info */
+ uint32_t expected_enc_size = 0; /* Expected encoded size for selection info */
start = 0;
count = 2;
@@ -1984,7 +1984,8 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high)
VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab");
/* Verify the version and encoded size expected for the configuration */
- ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ HDassert(expected_enc_size <= 255);
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, (uint8_t)expected_enc_size, expected_to_fail);
CHECK(ret, FAIL, "test_h5s_check_encoding");
} /* for config */
diff --git a/test/tsohm.c b/test/tsohm.c
index e97f667..f39b5e5 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -3342,11 +3342,11 @@ test_sohm_extlink(void)
static int
verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
{
- hid_t file_id = -1;
- hid_t orig_space_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t orig_space_id = H5I_INVALID_HID;
hid_t space1_id, space2_id, space3_id;
- hid_t dcpl_id = -1;
- hid_t dset1_id, dset2_id, dset3_id;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t dset1_id, dset2_id = H5I_INVALID_HID, dset3_id = H5I_INVALID_HID;
hsize_t dims1[] = {1, 2};
hsize_t max_dims[] = {H5S_UNLIMITED, 2};
hsize_t dims2[] = {5, 2};