diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-11-22 16:19:52 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-11-22 18:17:17 +0100 |
commit | f0c82b07f8b31a4b86de32436cb4f5053de16336 (patch) | |
tree | ebd98235e60db5b9c242e7a04ca0881e1191f78a /trust | |
parent | 8287689158403090b5828a568b122b5b3a3ce987 (diff) |
build: Suppress cppcheck errors
Diffstat (limited to 'trust')
-rw-r--r-- | trust/test-bundle.c | 9 | ||||
-rw-r--r-- | trust/test-openssl.c | 9 | ||||
-rw-r--r-- | trust/test-save.c | 22 | ||||
-rw-r--r-- | trust/test-trust.c | 4 |
4 files changed, 30 insertions, 14 deletions
diff --git a/trust/test-bundle.c b/trust/test-bundle.c index 3f4bcad..f1c2841 100644 --- a/trust/test-bundle.c +++ b/trust/test-bundle.c @@ -236,11 +236,14 @@ test_directory_hash (void) ret = p11_extract_pem_directory_hash (&test.ex, test.directory); assert_num_eq (true, ret); - test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem", #ifdef OS_UNIX - "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0", + test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem", + "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0", + NULL)); +#else + test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem", + NULL)); #endif - NULL)); test_check_file (test.directory, "Cacert3_Here.pem", SRCDIR "/trust/fixtures/cacert3.pem"); test_check_file (test.directory, "Cacert3_Here.1.pem", SRCDIR "/trust/fixtures/cacert3.pem"); #ifdef OS_UNIX diff --git a/trust/test-openssl.c b/trust/test-openssl.c index b1276df..3c20625 100644 --- a/trust/test-openssl.c +++ b/trust/test-openssl.c @@ -595,11 +595,14 @@ test_directory (void) ret = p11_extract_openssl_directory (&test.ex, test.directory); assert_num_eq (true, ret); - test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem", #ifdef OS_UNIX - "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0", + test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem", + "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0", + NULL)); +#else + test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem", + NULL)); #endif - NULL)); test_check_file (test.directory, "Custom_Label.pem", SRCDIR "/trust/fixtures/cacert3-trusted-server-alias.pem"); test_check_file (test.directory, "Custom_Label.1.pem", diff --git a/trust/test-save.c b/trust/test-save.c index 1de798d..0609e79 100644 --- a/trust/test-save.c +++ b/trust/test-save.c @@ -357,11 +357,14 @@ test_directory_files (void) ret = p11_save_finish_directory (dir, true); assert_num_eq (true, ret); - test_check_directory (subdir, ("blah.cer", "file.txt", #ifdef OS_UNIX + test_check_directory (subdir, ("blah.cer", "file.txt", "link.ext", -#endif NULL)); +#else + test_check_directory (subdir, ("blah.cer", "file.txt", + NULL)); +#endif test_check_file (subdir, "blah.cer", SRCDIR "/trust/fixtures/cacert3.der"); test_check_data (subdir, "file.txt", test_text, strlen (test_text)); #ifdef OS_UNIX @@ -443,13 +446,18 @@ test_directory_dups (void) ret = p11_save_finish_directory (dir, true); assert_num_eq (true, ret); - test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt", - "no-ext", "no-ext.1", - "with-num.0", "with-num.1", #ifdef OS_UNIX - "link.0", "link.1", + test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt", + "no-ext", "no-ext.1", + "with-num.0", "with-num.1", + "link.0", "link.1", + NULL)); +#else + test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt", + "no-ext", "no-ext.1", + "with-num.0", "with-num.1", + NULL)); #endif - NULL)); test_check_data (subdir, "file.txt", test_text, 5); test_check_data (subdir, "file.1.txt", test_text, 10); test_check_data (subdir, "file.2.txt", test_text, 15); diff --git a/trust/test-trust.c b/trust/test-trust.c index 802007d..29b2797 100644 --- a/trust/test-trust.c +++ b/trust/test-trust.c @@ -283,8 +283,10 @@ test_check_directory_files (const char *file, va_start (va, file); while (file != NULL) { - if (!p11_dict_set (files, (void *)file, (void *)file)) + if (!p11_dict_set (files, (void *)file, (void *)file)) { + va_end (va); return_val_if_reached (NULL); + } file = va_arg (va, const char *); } |