comparison libtomcrypt/tests/common.h @ 1733:d529a52b2f7c coverity coverity

merge coverity from main
author Matt Johnston <matt@ucc.asn.au>
date Fri, 26 Jun 2020 21:07:34 +0800
parents e9dba7abd939
children
comparison
equal deleted inserted replaced
1643:b59623a64678 1733:d529a52b2f7c
14 extern prng_state yarrow_prng; 14 extern prng_state yarrow_prng;
15 15
16 #ifdef LTC_VERBOSE 16 #ifdef LTC_VERBOSE
17 #define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) 17 #define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0)
18 #define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) 18 #define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
19 #define SHOULD_FAIL(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x) != CRYPT_OK ? CRYPT_OK : CRYPT_FAIL_TESTVECTOR, __LINE__, __FILE__, #x, NULL); } while (0)
19 #else 20 #else
20 #define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) 21 #define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0)
21 #define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) 22 #define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
23 #define SHOULD_FAIL(x) do { run_cmd((x) != CRYPT_OK ? CRYPT_OK : CRYPT_FAIL_TESTVECTOR, __LINE__, __FILE__, #x, NULL); } while (0)
22 #endif 24 #endif
23 25
24 void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm); 26 void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm);
25 27
26 void print_hex(const char* what, const void* v, const unsigned long l); 28 void print_hex(const char* what, const void* v, const unsigned long l);