diff options
author | Haru <haru@dotalux.com> | 2015-12-26 02:28:59 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-05-08 19:53:57 +0200 |
commit | 2349b2a1528fe5dc41d930f8dd332df5ba521eb6 (patch) | |
tree | 3656a91a896f0ef090606b2b4c9184ad73153a3f /src/test | |
parent | 58a7bf46508b7f186704e7efb39576e09f0ab866 (diff) | |
download | hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.gz hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.bz2 hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.xz hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.zip |
Fixed various issues pointed out by cppcheck
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_libconfig.c | 6 | ||||
-rw-r--r-- | src/test/test_spinlock.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test_libconfig.c b/src/test/test_libconfig.c index a3b233b98..e0a470e21 100644 --- a/src/test/test_libconfig.c +++ b/src/test/test_libconfig.c @@ -113,6 +113,7 @@ static const char *test_libconfig_read(void) libconfig->destroy(&config); return "Unable to read from file '" FILENAME "'."; } + fclose(fp); #undef FILENAME if (config.root == NULL) { libconfig->destroy(&config); @@ -200,7 +201,6 @@ static const char *test_libconfig_set_include_dir(void) static const char *test_libconfig_lookup(void) { struct config_t config; - struct config_setting_t *t = NULL; int32 i32; int64 i64; double f; @@ -221,12 +221,12 @@ static const char *test_libconfig_lookup(void) return "Unable to parse configuration."; } - if ((t = libconfig->lookup(&config, "Setting_Int")) == NULL) { + if (libconfig->lookup(&config, "Setting_Int") == NULL) { libconfig->destroy(&config); return "libconfig->lookup failed."; } - if ((t = libconfig->setting_lookup(config.root, "Setting_Int")) == NULL) { + if (libconfig->setting_lookup(config.root, "Setting_Int") == NULL) { libconfig->destroy(&config); return "libconfig->setting_lookup failed."; } diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 38186a975..6ffc4eafc 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -91,9 +91,9 @@ int do_init(int argc, char **argv){ // Everything fine? if (val != (THRC*PERINC)) { - printf("FAILED! (Result: %u, Expected: %u)\n", val, (THRC*PERINC)); + printf("FAILED! (Result: %u, Expected: %d)\n", val, (THRC*PERINC)); } else { - printf("OK! (Result: %u, Expected: %u)\n", val, (THRC*PERINC)); + printf("OK! (Result: %u, Expected: %d)\n", val, (THRC*PERINC)); ok++; } |