summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-27 19:26:17 (GMT)
committerGitHub <noreply@github.com>2023-07-27 19:26:17 (GMT)
commit95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (patch)
treef2bd0c1f37cf3b15b4ce199984fbe164a276f88e /test
parentdf5dcb2a735dd5bb3ee2cc700119109605976e41 (diff)
downloadhdf5-95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82.zip
hdf5-95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82.tar.gz
hdf5-95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82.tar.bz2
Misc warnings and cross-compile improvements (#3281)
Diffstat (limited to 'test')
-rw-r--r--test/big.c20
-rw-r--r--test/ntypes.c15
-rw-r--r--test/vol.c11
3 files changed, 10 insertions, 36 deletions
diff --git a/test/big.c b/test/big.c
index a008cef..503570d 100644
--- a/test/big.c
+++ b/test/big.c
@@ -11,12 +11,6 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke
- * Wednesday, April 8, 1998
- * Modified: Albert Cheng
- * September 11, 2010
- */
-/*
* The purpose of this test is to verify if a virtual file driver can handle:
* a. Large file (2GB)
* This should exceed 32bits I/O system since offset is a signed
@@ -62,12 +56,6 @@
#define MAX_TRIES 100
-#if H5_SIZEOF_LONG_LONG >= 8
-#define GB8LL ((unsigned long long)8 * 1024 * 1024 * 1024)
-#else
-#define GB8LL 0 /*cannot do the test*/
-#endif
-
/* Define Small, Large, Extra Large, Huge File which
* correspond to less than 2GB, 2GB, 4GB, and tens of GB file size.
* NO_FILE stands for "no file" to be tested.
@@ -330,7 +318,7 @@ static int
writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n)
{
hsize_t size1[4] = {8, 1024, 1024, 1024};
- hsize_t size2[1] = {GB8LL};
+ hsize_t size2[1] = {8LL * 1024LL * 1024LL * 1024LL};
hsize_t hs_start[1];
hsize_t hs_size[1];
hid_t file = -1, space1 = -1, space2 = -1, mem_space = -1, d1 = -1, d2 = -1;
@@ -689,12 +677,6 @@ test_family(hid_t fapl)
* because we would generate multi-gigabyte files.
*/
HDputs("Checking if file system is adequate for this test...");
- if (sizeof(long long) < 8 || 0 == GB8LL) {
- HDputs("Test skipped because sizeof(long long) is too small. This");
- HDputs("hardware apparently doesn't support 64-bit integer types.");
- usage();
- goto quit;
- }
if (!sparse_support) {
HDputs("Test skipped because file system does not support holes.");
usage();
diff --git a/test/ntypes.c b/test/ntypes.c
index 92b2896..707c71d 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -381,10 +381,7 @@ test_compound_dtype2(hid_t file)
#else
#error "Unknown 'long' size"
#endif
-#if H5_SIZEOF_LONG_LONG == 4
- if (H5Tinsert(tid2, "ll2", HOFFSET(s2, ll2), H5T_STD_I32BE) < 0)
- TEST_ERROR;
-#elif H5_SIZEOF_LONG_LONG == 8
+#if H5_SIZEOF_LONG_LONG == 8
if (H5Tinsert(tid2, "ll2", HOFFSET(s2, ll2), H5T_STD_I64BE) < 0)
TEST_ERROR;
#else
@@ -397,10 +394,7 @@ test_compound_dtype2(hid_t file)
TEST_ERROR;
if (H5Tinsert(tid, "st", HOFFSET(s1, st), tid2) < 0)
TEST_ERROR;
-#if H5_SIZEOF_LONG_LONG == 4
- if (H5Tinsert(tid, "l", HOFFSET(s1, l), H5T_STD_U32BE) < 0)
- TEST_ERROR;
-#elif H5_SIZEOF_LONG_LONG == 8
+#if H5_SIZEOF_LONG_LONG == 8
if (H5Tinsert(tid, "l", HOFFSET(s1, l), H5T_STD_U64BE) < 0)
TEST_ERROR;
#else
@@ -532,10 +526,7 @@ test_compound_dtype2(hid_t file)
TEST_ERROR;
if (H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
TEST_ERROR;
-#if H5_SIZEOF_LONG_LONG == 4
- if (H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I32LE))
- TEST_ERROR;
-#elif H5_SIZEOF_LONG_LONG == 8
+#if H5_SIZEOF_LONG_LONG == 8
if (H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64LE))
TEST_ERROR;
#else
diff --git a/test/vol.c b/test/vol.c
index 6bcae6b..1c4f9ca 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -573,9 +573,9 @@ reg_opt_datatype_get(void H5_ATTR_UNUSED *obj, H5VL_datatype_get_args_t *args, h
static herr_t
fake_vol_info_to_str(const void *info, char **str)
{
- herr_t ret_value = SUCCEED; /* Return value */
- const int val = *(const int *)info;
- const int str_size = 16; /* The size of the string */
+ const int val = *(const int *)info;
+ const size_t str_size = 16; /* The size of the string */
+ herr_t ret_value = SUCCEED;
/* Verify the info is correct before continuing */
if (val != INT_MAX) {
@@ -584,9 +584,10 @@ fake_vol_info_to_str(const void *info, char **str)
}
/* Allocate the string long enough for the info */
- *str = (char *)malloc(str_size);
+ if (NULL == (*str = (char *)HDcalloc(1, str_size)))
+ return FAIL;
- HDsnprintf(*str, str_size, "%d", *((const int *)info));
+ HDsnprintf(*str, str_size, "%d", val);
return ret_value;
} /* end fake_vol_info_to_str() */