summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-08-23 21:14:53 (GMT)
committerGitHub <noreply@github.com>2021-08-23 21:14:53 (GMT)
commitf6c49fe8911a39810b236f7babf09a70fcc76c7b (patch)
tree4ee702ab548adf8e619525e14716dde7d26bb331 /hl/test
parentb5f5c59f297be19096051282068cdcc14275eb34 (diff)
downloadhdf5-f6c49fe8911a39810b236f7babf09a70fcc76c7b.zip
hdf5-f6c49fe8911a39810b236f7babf09a70fcc76c7b.tar.gz
hdf5-f6c49fe8911a39810b236f7babf09a70fcc76c7b.tar.bz2
More clang tidy (#908)
* Pacify clang-analyzer-unix.cstring.NullArg * Apply some bugprone-suspicious-string-compare * Apply some readability-simplify-boolean-expr * Apply some readability-make-member-function-const * Apple some bugprone-macro-parentheses * Changed an f suffix to L for `long double` * Applied some readability-uppercase-literal-suffix automatically * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/gen_test_ds.c2
-rw-r--r--hl/test/test_packet.c8
-rw-r--r--hl/test/test_table.c6
3 files changed, 8 insertions, 8 deletions
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index 368c083..a56e6cf 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -75,7 +75,7 @@ main(int argc, char **argv)
int nerrors = 0;
char filename[65];
- if (argc < 2) {
+ if (argc < 2 || !argv[0] || !argv[1]) {
HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 311f36a..5f30d4b 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -45,10 +45,10 @@ typedef struct particle_t {
* a static array of particles for writing and checking reads
*-------------------------------------------------------------------------
*/
-static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"Four", 40, 40, 4.0F, 40.0}, {"Five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/*-------------------------------------------------------------------------
* function that compares one particle
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 531f778..6199e27 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -245,7 +245,7 @@ test_table(hid_t fid, int do_write)
{"six", 60, 6.0, 60.0, 60},
{"seven", 70, 7.0, 70.0, 70}};
/* buffers for the field "Pressure" and "New_field" */
- float pressure_in[NRECORDS] = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f};
+ float pressure_in[NRECORDS] = {0.0F, 1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F};
float pressure_out[NRECORDS];
int buf_new[NRECORDS] = {0, 1, 2, 3, 4, 5, 6, 7};
/* buffers for the fields "Latitude,Longitude" */
@@ -254,8 +254,8 @@ test_table(hid_t fid, int do_write)
/* buffers for the fields "Name,Pressure" */
namepressure_t namepre_out[NRECORDS];
namepressure_t namepre_in[NRECORDS] = {
- {"zero", 0.0f}, {"one", 1.0f}, {"two", 2.0f}, {"three", 3.0f},
- {"four", 4.0f}, {"five", 5.0f}, {"six", 6.0f}, {"seven", 7.0f},
+ {"zero", 0.0F}, {"one", 1.0F}, {"two", 2.0F}, {"three", 3.0F},
+ {"four", 4.0F}, {"five", 5.0F}, {"six", 6.0F}, {"seven", 7.0F},
};
/*-------------------------------------------------------------------------