summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-07-26 21:45:46 (GMT)
committerGitHub <noreply@github.com>2022-07-26 21:45:46 (GMT)
commitae414872f50187e64cbd6cc8f076c22cf5df2d53 (patch)
treeb616f33f5daa89f213e7c64e04c63afde906e939 /hl/test
parent213eac2588369f75a11df6bb1788dde33c4b82e2 (diff)
downloadhdf5-ae414872f50187e64cbd6cc8f076c22cf5df2d53.zip
hdf5-ae414872f50187e64cbd6cc8f076c22cf5df2d53.tar.gz
hdf5-ae414872f50187e64cbd6cc8f076c22cf5df2d53.tar.bz2
Develop clang 13 format (#1933)
* Update format source to clang 13 * More format changes
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/gen_test_ds.c2
-rw-r--r--hl/test/test_ds.c26
-rw-r--r--hl/test/test_file_image.c12
-rw-r--r--hl/test/test_image.c14
-rw-r--r--hl/test/test_ld.c12
-rw-r--r--hl/test/test_lite.c92
-rw-r--r--hl/test/test_packet.c2
-rw-r--r--hl/test/test_packet_vlen.c8
-rw-r--r--hl/test/test_table.c2
9 files changed, 85 insertions, 85 deletions
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index d7a9f44..d6c6a3d 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -256,7 +256,7 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename
herr_t ret_value = FAIL;
hid_t dsid = -1;
ssize_t name_len;
- char * name_out = NULL;
+ char *name_out = NULL;
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if (H5DSis_attached(did, dsid, idx) == 1) {
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index cc716aa..bdbd4d4 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -1171,7 +1171,7 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename
herr_t ret_value = FAIL;
hid_t dsid = -1;
ssize_t name_len;
- char * name_out = NULL;
+ char *name_out = NULL;
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if (H5DSis_attached(did, dsid, idx) == 1) {
@@ -1204,7 +1204,7 @@ test_detachscales(void)
int rank1 = 1;
int rank3 = 3;
hsize_t dims[] = {1, 2, 3}; /*some bogus numbers, not important for the test*/
- int * buf = NULL;
+ int *buf = NULL;
char dname[16];
int i;
@@ -2358,8 +2358,8 @@ test_simple(void)
int s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300};
char dim0_label[16];
char dim1_label[16];
- char * dim0_labeld;
- char * dim1_labeld;
+ char *dim0_labeld;
+ char *dim1_labeld;
char dim0_labels[3];
char dim1_labels[3];
ssize_t dim0_label_size;
@@ -2368,7 +2368,7 @@ test_simple(void)
int scale_idx;
int nscales;
ssize_t name_len;
- char * name_out = NULL;
+ char *name_out = NULL;
char snames[3];
int i, j;
@@ -3602,10 +3602,10 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
hid_t tid = -1; /* file type ID */
hid_t mtid = -1; /* memory type ID */
hssize_t nelmts; /* number of data elements */
- char * buf = NULL; /* data buffer */
+ char *buf = NULL; /* data buffer */
size_t size;
int i;
- char * data = (char *)visitor_data;
+ char *data = (char *)visitor_data;
/* unused */
(void)dset;
@@ -4608,8 +4608,8 @@ test_types(void)
hsize_t s2_dim[1] = {DIM2_SIZE}; /* size of DS 2 dataset */
float s1_float[DIM1_SIZE] = {10, 20, 30}; /* data of DS 1 dataset */
unsigned short s2_ushort[DIM2_SIZE] = {10, 20, 30, 40}; /* data of DS 2 dataset */
- const char * s1_str = "ABC";
- const char * s2_str = "ABCD";
+ const char *s1_str = "ABC";
+ const char *s2_str = "ABCD";
HDprintf("Testing scales with several datatypes\n");
@@ -4781,9 +4781,9 @@ test_data(void)
hid_t dsid = -1; /* DS dataset ID */
hid_t dcpl; /* dataset creation property list */
hid_t sid; /* dataspace ID */
- float * vals = NULL; /* array to hold data values */
- float * latbuf = NULL; /* array to hold the latitude values */
- float * lonbuf = NULL; /* array to hold the longitude values */
+ float *vals = NULL; /* array to hold data values */
+ float *latbuf = NULL; /* array to hold the latitude values */
+ float *lonbuf = NULL; /* array to hold the longitude values */
hsize_t dims[2]; /* array to hold dimensions */
hsize_t latdims[1]; /* array to hold dimensions */
hsize_t londims[1]; /* array to hold dimensions */
@@ -4953,7 +4953,7 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
unsigned j;
char str[20];
size_t nelms;
- FILE * f;
+ FILE *f;
float val;
const char *data_file = H5_get_srcdir_filename(fname);
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 4448e41..318e13d 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -53,7 +53,7 @@
static int
test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
{
- hid_t * file_id = NULL, *dset_id = NULL, file_space, plist; /* HDF5 ids */
+ hid_t *file_id = NULL, *dset_id = NULL, file_space, plist; /* HDF5 ids */
hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */
hsize_t max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED};
int data1[6] = {1, 2, 3, 4, 5, 6}; /* original contents of dataset */
@@ -63,13 +63,13 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
hsize_t dims4[RANK] = {3, 5}; /* extended dimensions of datasets */
int data4[15] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
/* extended contents of dataset */
- ssize_t * buf_size = NULL; /* pointer to array of buffer sizes */
- void ** buf_ptr = NULL; /* pointer to array of pointers to image buffers */
- char ** filename = NULL; /* pointer to array of pointers to filenames */
- unsigned * input_flags = NULL; /* pointer to array of flag combinations */
+ ssize_t *buf_size = NULL; /* pointer to array of buffer sizes */
+ void **buf_ptr = NULL; /* pointer to array of pointers to image buffers */
+ char **filename = NULL; /* pointer to array of pointers to filenames */
+ unsigned *input_flags = NULL; /* pointer to array of flag combinations */
size_t i, j, k, nrow, n_values;
herr_t status1;
- void * handle_ptr = NULL; /* pointers to driver buffer */
+ void *handle_ptr = NULL; /* pointers to driver buffer */
unsigned char **core_buf_ptr_ptr = NULL;
VERIFY(open_images > 1, "The number of open images must be greater than 1");
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index 4997df6..5d203e9 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -519,11 +519,11 @@ test_generate(void)
{
hid_t fid;
hsize_t pal_dims[2] = {256, 3};
- float * data = NULL;
+ float *data = NULL;
int imax, jmax, kmax;
int n_elements;
float valex, xmin, xmax, value;
- FILE * f = NULL;
+ FILE *f = NULL;
const char *data_file = H5_get_srcdir_filename(DATA_FILE4);
int i;
int retval = FAIL;
@@ -757,13 +757,13 @@ out:
static int
read_data(const char *fname, /*IN*/
- hsize_t * width, /*OUT*/
- hsize_t * height /*OUT*/)
+ hsize_t *width, /*OUT*/
+ hsize_t *height /*OUT*/)
{
int i, n;
int color_planes;
char str[20];
- FILE * f = NULL;
+ FILE *f = NULL;
int w, h;
int n_elements;
const char *data_file = H5_get_srcdir_filename(fname);
@@ -876,14 +876,14 @@ out:
static int
read_palette(const char *fname, rgb_t *palette, size_t palette_size)
{
- FILE * file;
+ FILE *file;
char buffer[80];
unsigned u;
unsigned int red;
unsigned int green;
unsigned int blue;
unsigned nentries;
- const char * data_file = H5_get_srcdir_filename(fname);
+ const char *data_file = H5_get_srcdir_filename(fname);
/* ensure the given palette is valid */
if (!palette)
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 4b01f49..0331737 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -130,13 +130,13 @@ char g_tmp_buf[TMP_BUF_SIZE];
} \
else if (type == TWO_CMPD_VALID1) { \
test_valid_fields1 *vb1 = (test_valid_fields1 *)_ldbuf; \
- set_t * cb = (set_t *)_buf; \
+ set_t *cb = (set_t *)_buf; \
\
VERIFY_ELMTS_VALID1(vb1[k], cb[ind + n]) \
} \
else if (type == TWO_CMPD_VALID2) { \
test_valid_fields2 *vb2 = (test_valid_fields2 *)_ldbuf; \
- set_t * cb = (set_t *)_buf; \
+ set_t *cb = (set_t *)_buf; \
\
VERIFY_ELMTS_VALID2(vb2[k], cb[ind + n]) \
} \
@@ -211,10 +211,10 @@ typedef struct test_valid_fields2 {
/* Temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
#define TEST_BUF_SIZE 100
-int * iibuf; /* buffer for storing retrieved elements */
-int * ibuf; /* buffer for storing retrieved elements (integer) */
-set_t * cbuf; /* buffer for storing retrieved elements (compound) */
-set_t * ccbuf; /* buffer for storing retrieved elements (compound) */
+int *iibuf; /* buffer for storing retrieved elements */
+int *ibuf; /* buffer for storing retrieved elements (integer) */
+set_t *cbuf; /* buffer for storing retrieved elements (compound) */
+set_t *ccbuf; /* buffer for storing retrieved elements (compound) */
test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 53f834a..e5d8e6e 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -468,7 +468,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
{
int rank_out;
- hsize_t * dims_out = 0;
+ hsize_t *dims_out = 0;
H5T_class_t type_class;
size_t type_size;
int i;
@@ -1073,7 +1073,7 @@ static int
test_integers(void)
{
hid_t dtype;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3("\n text for integer types");
@@ -1131,7 +1131,7 @@ static int
test_fps(void)
{
hid_t dtype;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3(" text for floating-point types");
@@ -1193,7 +1193,7 @@ test_strings(void)
H5T_str_t str_pad;
H5T_cset_t str_cset;
H5T_class_t type_class;
- char * dt_str = NULL;
+ char *dt_str = NULL;
size_t str_len;
HL_TESTING3(" text for string types");
@@ -1338,7 +1338,7 @@ test_opaques(void)
hid_t dtype;
size_t opq_size;
H5T_class_t type_class;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3(" text for opaque types");
@@ -1400,7 +1400,7 @@ test_enums(void)
const char *name2 = "WHITE";
int value2;
H5T_class_t type_class;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3(" text for enum types");
@@ -1476,7 +1476,7 @@ test_variables(void)
{
hid_t dtype;
H5T_class_t type_class;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3(" text for variable types");
@@ -1538,7 +1538,7 @@ test_arrays(void)
int ndims;
hsize_t dims[3];
H5T_class_t type_class;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3(" text for array types");
@@ -1601,10 +1601,10 @@ test_compounds(void)
{
hid_t dtype;
int nmembs;
- char * memb_name = NULL;
+ char *memb_name = NULL;
H5T_class_t memb_class;
H5T_class_t type_class;
- char * dt_str;
+ char *dt_str;
size_t str_len;
HL_TESTING3(" text for compound types");
@@ -1682,41 +1682,41 @@ test_compound_bug(void)
hid_t dtype;
H5T_class_t type_class;
int nmembs;
- char * memb_name = NULL;
- char * dt_str;
+ char *memb_name = NULL;
+ char *dt_str;
size_t str_len;
- char text[] = "H5T_COMPOUND { H5T_STD_I32LE "
- "\"state_________________________________________________________________________________"
- "\"; H5T_STD_I32LE "
- "\"desc____________________________________________________________________________________"
- "_____\"; H5T_VLEN { H5T_COMPOUND { H5T_ENUM { H5T_STD_I16LE; \"ZERO\" 0; \"ONE\" 1; "
- "\"TWO\" 2; \"THREE\" 3; } \"type____\"; H5T_STD_I32LE "
- "\"sub_____________________________________________________________________________________"
- "__________________________\"; H5T_STRING { STRSIZE H5T_VARIABLE; STRPAD H5T_STR_SPACEPAD; "
- "CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; } \"sub_desc\"; H5T_STD_I32LE "
- "\"final___________________________________________________________________________________"
- "________________\"; } } \"sub\"; }";
- char text2[] = "H5T_COMPOUND {\n"
- " H5T_STD_I16LE \"state___________________________"
- "__________________________________________________"
- "____\" : 0;\n"
- " H5T_STD_I16LE \"desc____________________________"
- "__________________________________________________"
- "___________\" : 2;\n"
- " H5T_VLEN { H5T_COMPOUND {\n"
- " H5T_ENUM { H5T_STD_I16LE; \"ZERO\" 0; \"ONE\" "
- "1; \"TWO\" 2; \"THREE\" 3; } \"type____\" : 0;\n"
- " H5T_STD_I32LE \"sub___________________________"
- "__________________________________________________"
- "__________________________________1\" : 4;\n"
- " H5T_STRING { STRSIZE H5T_VARIABLE; STRPAD H5T_"
- "STR_SPACEPAD; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1;"
- " } \"sub_desc\" : 8;\n"
- " H5T_STD_I32LE \"final_________________________"
- "__________________________________________________"
- "________________________\" : 16;\n"
- " } } \"sub\" : 8;\n"
- "}\n";
+ char text[] = "H5T_COMPOUND { H5T_STD_I32LE "
+ "\"state_________________________________________________________________________________"
+ "\"; H5T_STD_I32LE "
+ "\"desc____________________________________________________________________________________"
+ "_____\"; H5T_VLEN { H5T_COMPOUND { H5T_ENUM { H5T_STD_I16LE; \"ZERO\" 0; \"ONE\" 1; "
+ "\"TWO\" 2; \"THREE\" 3; } \"type____\"; H5T_STD_I32LE "
+ "\"sub_____________________________________________________________________________________"
+ "__________________________\"; H5T_STRING { STRSIZE H5T_VARIABLE; STRPAD H5T_STR_SPACEPAD; "
+ "CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; } \"sub_desc\"; H5T_STD_I32LE "
+ "\"final___________________________________________________________________________________"
+ "________________\"; } } \"sub\"; }";
+ char text2[] = "H5T_COMPOUND {\n"
+ " H5T_STD_I16LE \"state___________________________"
+ "__________________________________________________"
+ "____\" : 0;\n"
+ " H5T_STD_I16LE \"desc____________________________"
+ "__________________________________________________"
+ "___________\" : 2;\n"
+ " H5T_VLEN { H5T_COMPOUND {\n"
+ " H5T_ENUM { H5T_STD_I16LE; \"ZERO\" 0; \"ONE\" "
+ "1; \"TWO\" 2; \"THREE\" 3; } \"type____\" : 0;\n"
+ " H5T_STD_I32LE \"sub___________________________"
+ "__________________________________________________"
+ "__________________________________1\" : 4;\n"
+ " H5T_STRING { STRSIZE H5T_VARIABLE; STRPAD H5T_"
+ "STR_SPACEPAD; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1;"
+ " } \"sub_desc\" : 8;\n"
+ " H5T_STD_I32LE \"final_________________________"
+ "__________________________________________________"
+ "________________________\" : 16;\n"
+ " } } \"sub\" : 8;\n"
+ "}\n";
HL_TESTING3(" text for compound type of bug fix");
@@ -1806,8 +1806,8 @@ test_complicated_compound(void)
hid_t dtype;
int nmembs;
H5T_class_t type_class;
- char * line = NULL;
- FILE * fp = NULL;
+ char *line = NULL;
+ FILE *fp = NULL;
size_t size = 1024;
const char *filename = H5_get_srcdir_filename(INPUT_FILE);
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index e8b90f7..2c003d5 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -116,7 +116,7 @@ create_hl_table(hid_t fid)
hid_t field_type[NFIELDS];
hid_t string_type;
hsize_t chunk_size = 10;
- int * fill_data = NULL;
+ int *fill_data = NULL;
int compress = 0;
herr_t status;
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index aa88a6c..5e06c85 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -333,7 +333,7 @@ test_compound_VL_VLtype(void)
hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
- hvl_t * t1, *t2;
+ hvl_t *t1, *t2;
unsigned uu, vv, ww; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret; /* Returned status from a callee */
@@ -516,7 +516,7 @@ test_VLof_VLtype(void)
hid_t vlatomic = H5I_INVALID_HID; /* Variable length datatype */
hid_t vlofvl = H5I_INVALID_HID; /* VL datatype of VL datatypes */
hsize_t count; /* Number of records in the table */
- hvl_t * t1; /* pointer to advance */
+ hvl_t *t1; /* pointer to advance */
unsigned uu, vv, ww; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
@@ -1368,7 +1368,7 @@ testfl_compound_VL_VLtype(void)
hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
- hvl_t * t1, *t2;
+ hvl_t *t1, *t2;
unsigned uu, vv, ww; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret; /* Returned status from a callee */
@@ -1551,7 +1551,7 @@ testfl_VLof_VLtype(void)
hid_t vlatomic = H5I_INVALID_HID; /* Variable length datatype */
hid_t vlofvl = H5I_INVALID_HID; /* VL datatype of VL datatypes */
hsize_t count; /* Number of records in the table */
- hvl_t * t1; /* pointer to advance */
+ hvl_t *t1; /* pointer to advance */
unsigned uu, vv, ww; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 90a930c..24b7336 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -198,7 +198,7 @@ test_table(hid_t fid, int do_write)
hid_t fid2;
hsize_t chunk_size = 10;
int compress = 0;
- int * fill = NULL;
+ int *fill = NULL;
particle_t fill1[1] = {{"no data", -1, -99.0, -99.0, -1}};
int fill1_new[1] = {-100};
hsize_t position;