summaryrefslogtreecommitdiffstats
path: root/test/testutil.h
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-04-18 22:33:15 +0200
committerRich Salz <rsalz@openssl.org>2017-04-18 22:33:15 +0200
commitadcd8e37db682a5818415b1e0e1d8847dd9ab1e6 (patch)
tree87d3c0d4da92ff291ab78be08b778876b0586453 /test/testutil.h
parentUpdate more tests (diff)
downloadopenssl-adcd8e37db682a5818415b1e0e1d8847dd9ab1e6.tar.xz
openssl-adcd8e37db682a5818415b1e0e1d8847dd9ab1e6.zip
Convert more tests
ct_test,evp_extra_test,wpackettest,packettest Add strncmp TEST wrappers And make some style/consistency fixes to ct_test Silence travis; gcc bug? Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3234)
Diffstat (limited to 'test/testutil.h')
-rw-r--r--test/testutil.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/testutil.h b/test/testutil.h
index 0631a8b7f8..e7478a8ade 100644
--- a/test/testutil.h
+++ b/test/testutil.h
@@ -190,6 +190,14 @@ DECLARE_COMPARISON(char *, str, eq)
DECLARE_COMPARISON(char *, str, ne)
/*
+ * Same as above, but for strncmp.
+ */
+int test_strn_eq(const char *file, int line, const char *, const char *,
+ const char *a, const char *b, size_t s);
+int test_strn_ne(const char *file, int line, const char *, const char *,
+ const char *a, const char *b, size_t s);
+
+/*
* Equality test for memory blocks where NULL is a legitimate value.
* These calls return 1 if the two memory blocks compare true.
* Otherwise, they return 0 and pretty-print diagnostics.
@@ -293,6 +301,8 @@ void test_info_c90(const char *desc, ...) PRINTF_FORMAT(1, 2);
# define TEST_str_eq(a, b) test_str_eq(__FILE__, __LINE__, #a, #b, a, b)
# define TEST_str_ne(a, b) test_str_ne(__FILE__, __LINE__, #a, #b, a, b)
+# define TEST_strn_eq(a, b, n) test_strn_eq(__FILE__, __LINE__, #a, #b, a, b, n)
+# define TEST_strn_ne(a, b, n) test_strn_ne(__FILE__, __LINE__, #a, #b, a, b, n)
# define TEST_mem_eq(a, m, b, n) test_mem_eq(__FILE__, __LINE__, #a, #b, a, m, b, n)
# define TEST_mem_ne(a, m, b, n) test_mem_ne(__FILE__, __LINE__, #a, #b, a, m, b, n)