Convert more tests
[oweals/openssl.git] / test / testutil.h
index 0631a8b7f8f9711af94accc815bbab8b309605a3..e7478a8ade35f488bfa2901a4aa8d21b07bc6cbc 100644 (file)
@@ -189,6 +189,14 @@ int test_ptr_null(const char *file, int line, const char *s, const void *p);
 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.
@@ -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)