summaryrefslogtreecommitdiffstats
path: root/tools/test
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2020-01-21 03:11:32 (GMT)
committerkmu <kmu@hdfgroup.org>2020-01-21 03:11:32 (GMT)
commit9be5b2842e307f5f5b67c7e42217ddff67b0bf61 (patch)
treeb23156eec2d83f8755971dd5cc746c28ea7c338a /tools/test
parent628d267162895adef5a73e1cd5810030cc98335a (diff)
parenta95b5b1e056e171702ad41b69cb796da0cbb91eb (diff)
downloadhdf5-9be5b2842e307f5f5b67c7e42217ddff67b0bf61.zip
hdf5-9be5b2842e307f5f5b67c7e42217ddff67b0bf61.tar.gz
hdf5-9be5b2842e307f5f5b67c7e42217ddff67b0bf61.tar.bz2
merge and fix
Diffstat (limited to 'tools/test')
-rw-r--r--tools/test/h5dump/errfiles/tdset-2.err2
-rw-r--r--tools/test/h5dump/errfiles/tperror.err2
-rw-r--r--tools/test/h5dump/errfiles/tqmarkfile.err2
-rw-r--r--tools/test/h5dump/h5dumpgentest.c58
-rw-r--r--tools/test/misc/h5repart_gentest.c71
-rw-r--r--tools/test/perform/pio_standalone.h4
-rw-r--r--tools/test/perform/sio_standalone.h4
7 files changed, 101 insertions, 42 deletions
diff --git a/tools/test/h5dump/errfiles/tdset-2.err b/tools/test/h5dump/errfiles/tdset-2.err
index 2d70b35..39bbb0e 100644
--- a/tools/test/h5dump/errfiles/tdset-2.err
+++ b/tools/test/h5dump/errfiles/tdset-2.err
@@ -27,7 +27,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ #000: (file name) line (number) in H5Lget_info2(): unable to get link info
major: Links
minor: Can't get value
#001: (file name) line (number) in H5VL_link_get(): link get failed
diff --git a/tools/test/h5dump/errfiles/tperror.err b/tools/test/h5dump/errfiles/tperror.err
index b0b908b..e2f24c1 100644
--- a/tools/test/h5dump/errfiles/tperror.err
+++ b/tools/test/h5dump/errfiles/tperror.err
@@ -27,7 +27,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ #000: (file name) line (number) in H5Lget_info2(): unable to get link info
major: Links
minor: Can't get value
#001: (file name) line (number) in H5VL_link_get(): link get failed
diff --git a/tools/test/h5dump/errfiles/tqmarkfile.err b/tools/test/h5dump/errfiles/tqmarkfile.err
index 2c4f1ff..4c3b2ef 100644
--- a/tools/test/h5dump/errfiles/tqmarkfile.err
+++ b/tools/test/h5dump/errfiles/tqmarkfile.err
@@ -15,7 +15,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ #000: (file name) line (number) in H5Lget_info2(): unable to get link info
major: Symbol table
minor: Object not found
#001: (file name) line (number) in H5L_get_info(): name doesn't exist
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 026ab20..e68e622 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -463,10 +463,23 @@ gent_dataset(void)
{
hid_t fid, dataset, space;
hsize_t dims[2];
- int dset1[10][20];
- double dset2[30][20];
+ int **dset1 = NULL;
+ int *dset1_data = NULL;
+ double **dset2 = NULL;
+ double *dset2_data = NULL;
int i, j;
+ /* Set up data arrays */
+ dset1_data = (int *)HDcalloc(10 * 20, sizeof(int));
+ dset1 = (int **)HDcalloc(10, sizeof(dset1_data));
+ for (i = 0; i < 10; i++)
+ dset1[i] = dset1_data + (i * 20);
+
+ dset2_data = (double *)HDcalloc(30 * 20, sizeof(double));
+ dset2 = (double **)HDcalloc(30, sizeof(dset2_data));
+ for (i = 0; i < 30; i++)
+ dset2[i] = dset2_data + (i * 20);
+
fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* dset1 */
@@ -478,7 +491,7 @@ gent_dataset(void)
for(j = 0; j < 20; j++)
dset1[i][j] = j + i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1_data);
H5Sclose(space);
H5Dclose(dataset);
@@ -491,11 +504,16 @@ gent_dataset(void)
for(j = 0; j < 20; j++)
dset2[i][j] = 0.0001F * (float)j + (float)i;
- H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
+ H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_data);
H5Sclose(space);
H5Dclose(dataset);
H5Fclose(fid);
+
+ HDfree(dset1);
+ HDfree(dset1_data);
+ HDfree(dset2);
+ HDfree(dset2_data);
}
static void
@@ -1773,9 +1791,17 @@ static void gent_str(void) {
int a[8][10];
char s[12][33];
} compound_t;
- compound_t comp1[3][6];
+
+ compound_t **comp1 = NULL;
+ compound_t *comp1_data = NULL;
hsize_t mdims[2];
+ /* Set up data array */
+ comp1_data = (compound_t *)HDcalloc(3 * 6, sizeof(compound_t));
+ comp1 = (compound_t **)HDcalloc(3, sizeof(comp1_data));
+ for (i = 0; i < 3; i++)
+ comp1[i] = comp1_data + (i * 6);
+
fid = H5Fcreate(FILE13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* string 1 : nullterm string */
@@ -1861,7 +1887,7 @@ static void gent_str(void) {
}
dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1);
+ H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1_data);
H5Tclose(f_type);
H5Tclose(f_type2);
@@ -1869,6 +1895,9 @@ static void gent_str(void) {
H5Dclose(dataset);
H5Fclose(fid);
+
+ HDfree(comp1);
+ HDfree(comp1_data);
}
/*
@@ -3747,9 +3776,15 @@ void gent_multi(void)
H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl[H5FD_MEM_NTYPES];
const char *memb_name[H5FD_MEM_NTYPES];
- char sv[H5FD_MEM_NTYPES][1024];
+ char **sv = NULL;
+ char *sv_data = NULL;
haddr_t memb_addr[H5FD_MEM_NTYPES];
+ sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char));
+ sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data));
+ for (i = 0; i < H5FD_MEM_NTYPES; i++)
+ sv[i] = sv_data + (i * 1024);
+
fapl = H5Pcreate(H5P_FILE_ACCESS);
HDmemset(memb_map, 0, sizeof memb_map);
@@ -3790,6 +3825,9 @@ void gent_multi(void)
H5Dclose(dataset);
H5Fclose(fid);
H5Pclose(fapl);
+
+ HDfree(sv);
+ HDfree(sv_data);
}
static void gent_large_objname(void)
@@ -7961,7 +7999,7 @@ static void gent_compound_attr_intsizes(void) {
int64_t dset64[F70_XDIM][F70_YDIM64];
double dsetdbl[F70_XDIM][F70_YDIM8];
} Array1Struct;
- Array1Struct Array1[F70_LENGTH];
+ Array1Struct *Array1 = NULL;
hid_t Array1Structid; /* File datatype identifier */
herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */
@@ -7969,6 +8007,8 @@ static void gent_compound_attr_intsizes(void) {
int m, n, o; /* Array init loop vars */
+ Array1 = (Array1Struct *)HDcalloc(F70_LENGTH, sizeof(Array1Struct));
+
/* Initialize the data in the arrays/datastructure */
for (m = 0; m < F70_LENGTH; m++) {
@@ -8200,6 +8240,8 @@ static void gent_compound_attr_intsizes(void) {
status = H5Fclose(fid);
HDassert(status >= 0);
+
+ HDfree(Array1);
}
static void gent_nested_compound_dt(void) { /* test nested data type */
diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c
index 5c1ff87..bd94104 100644
--- a/tools/test/misc/h5repart_gentest.c
+++ b/tools/test/misc/h5repart_gentest.c
@@ -25,7 +25,8 @@
#define FAMILY_SIZE 1024
#define FILENAME "family_file%05d.h5"
-static int buf[FAMILY_NUMBER][FAMILY_SIZE];
+int **buf = NULL;
+int *buf_data = NULL;
int main(void)
{
@@ -34,66 +35,82 @@ int main(void)
int i, j;
hsize_t dims[2]={FAMILY_NUMBER, FAMILY_SIZE};
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) {
+ HDperror("HDcalloc");
+ HDexit(EXIT_FAILURE);
+ }
+ if(NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) {
+ HDperror("HDcalloc");
+ HDexit(EXIT_FAILURE);
+ }
+ for (i = 0; i < FAMILY_NUMBER; i++)
+ buf[i] = buf_data + (i * FAMILY_SIZE);
+
/* Set property list and file name for FAMILY driver */
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- perror ("H5Pcreate");
- exit (EXIT_FAILURE);
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ HDperror("H5Pcreate");
+ HDexit(EXIT_FAILURE);
}
if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) {
- perror ("H5Pset_fapl_family");
- exit (EXIT_FAILURE);
+ HDperror("H5Pset_fapl_family");
+ HDexit(EXIT_FAILURE);
}
if((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
- perror("H5Fcreate");
- exit(EXIT_FAILURE);
+ HDperror("H5Fcreate");
+ HDexit(EXIT_FAILURE);
}
/* Create and write dataset */
if((space = H5Screate_simple(2, dims, NULL)) < 0) {
- perror("H5Screate_simple");
- exit(EXIT_FAILURE);
+ HDperror("H5Screate_simple");
+ HDexit(EXIT_FAILURE);
}
if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- perror("H5Dcreate2");
- exit(EXIT_FAILURE);
+ HDperror("H5Dcreate2");
+ HDexit(EXIT_FAILURE);
}
- for(i = 0; i<FAMILY_NUMBER; i++)
- for(j = 0; j<FAMILY_SIZE; j++)
+ for(i = 0; i < FAMILY_NUMBER; i++)
+ for(j = 0; j < FAMILY_SIZE; j++)
buf[i][j] = i * 10000 + j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
- perror("H5Dwrite");
- exit(EXIT_FAILURE);
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0) {
+ HDperror("H5Dwrite");
+ HDexit(EXIT_FAILURE);
}
if(H5Sclose(space) < 0) {
- perror ("H5Sclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Sclose");
+ HDexit(EXIT_FAILURE);
}
if(H5Dclose(dset) < 0) {
- perror ("H5Dclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Dclose");
+ HDexit(EXIT_FAILURE);
}
if(H5Pclose(fapl) < 0) {
- perror ("H5Pclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Pclose");
+ HDexit(EXIT_FAILURE);
}
if(H5Fclose(file) < 0) {
- perror ("H5Fclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Fclose");
+ HDexit(EXIT_FAILURE);
}
- puts(" PASSED"); fflush(stdout);
+ HDfree(buf);
+ HDfree(buf_data);
+
+ HDputs(" PASSED");
+ HDfflush(stdout);
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index e6db2e8..cf6d980 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -483,8 +483,8 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#endif
#ifdef H5_HAVE_PARALLEL
-H5TEST_DLL int h5_set_info_object(void);
-H5TEST_DLL void h5_dump_info_object(MPI_Info info);
+int h5_set_info_object(void);
+void h5_dump_info_object(MPI_Info info);
#endif
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index faa8317..45f6d25 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -498,8 +498,8 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#endif
#ifdef H5_HAVE_PARALLEL
-H5TEST_DLL int h5_set_info_object(void);
-H5TEST_DLL void h5_dump_info_object(MPI_Info info);
+int h5_set_info_object(void);
+void h5_dump_info_object(MPI_Info info);
#endif