]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/testutil.h
use size_t tests instead of int ones
[thirdparty/openssl.git] / test / testutil.h
CommitLineData
440e5d80 1/*
8fe3127c 2 * Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
3ead9f37 3 *
440e5d80
RS
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
3ead9f37
MB
8 */
9
10#ifndef HEADER_TESTUTIL_H
0f113f3e 11# define HEADER_TESTUTIL_H
3ead9f37 12
2fae041d
P
13#include <stdarg.h>
14
d61f0078 15#include <openssl/err.h>
e364c3b2 16#include <openssl/e_os2.h>
dc352c19 17#include <openssl/bn.h>
d61f0078 18
e364c3b2 19/*-
ad887416
P
20 * Simple unit tests should implement setup_tests().
21 * This function should return zero if the registration process fails.
e364c3b2
EK
22 * To register tests, call ADD_TEST or ADD_ALL_TESTS:
23 *
ad887416 24 * int setup_tests(void)
e364c3b2
EK
25 * {
26 * ADD_TEST(test_foo);
27 * ADD_ALL_TESTS(test_bar, num_test_bar);
ad887416 28 * return 1;
e364c3b2
EK
29 * }
30 *
ad887416 31 * Tests that require clean up after execution should implement:
e364c3b2 32 *
ad887416 33 * void cleanup_tests(void);
e364c3b2 34 *
ad887416
P
35 * The cleanup_tests function will be called even if setup_tests()
36 * returns failure.
e364c3b2 37 *
ad887416
P
38 * In some cases, early initialization before the framework is set up
39 * may be needed. In such a case, this should be implemented:
e364c3b2 40 *
ad887416 41 * int global_init(void);
e364c3b2 42 *
ad887416 43 * This function should return zero if there is an unrecoverable error and
bdcacd93 44 * non-zero if the initialization was successful.
308b876d 45 */
e364c3b2
EK
46
47/* Adds a simple test case. */
308b876d
EK
48# define ADD_TEST(test_function) add_test(#test_function, test_function)
49
e364c3b2
EK
50/*
51 * Simple parameterized tests. Calls test_function(idx) for each 0 <= idx < num.
52 */
53# define ADD_ALL_TESTS(test_function, num) \
208d721a
RL
54 add_all_tests(#test_function, test_function, num, 1)
55/*
56 * A variant of the same without TAP output.
57 */
58# define ADD_ALL_TESTS_NOSUBTEST(test_function, num) \
59 add_all_tests(#test_function, test_function, num, 0)
e364c3b2 60
1d97c843 61/*-
308b876d 62 * Test cases that share common setup should use the helper
1d97c843 63 * SETUP_TEST_FIXTURE and EXECUTE_TEST macros for test case functions.
3ead9f37
MB
64 *
65 * SETUP_TEST_FIXTURE will call set_up() to create a new TEST_FIXTURE_TYPE
66 * object called "fixture". It will also allocate the "result" variable used
67 * by EXECUTE_TEST. set_up() should take a const char* specifying the test
99801878 68 * case name and return a TEST_FIXTURE_TYPE by reference.
3ead9f37 69 *
99801878 70 * EXECUTE_TEST will pass fixture to execute_func() by reference, call
3ead9f37 71 * tear_down(), and return the result of execute_func(). execute_func() should
99801878
P
72 * take a TEST_FIXTURE_TYPE by reference and return 1 on success and 0 on
73 * failure. The tear_down function is responsible for deallocation of the
74 * result variable, if required.
3ead9f37
MB
75 *
76 * Unit tests can define their own SETUP_TEST_FIXTURE and EXECUTE_TEST
77 * variations like so:
78 *
79 * #define SETUP_FOOBAR_TEST_FIXTURE()\
80 * SETUP_TEST_FIXTURE(FOOBAR_TEST_FIXTURE, set_up_foobar)
81 *
82 * #define EXECUTE_FOOBAR_TEST()\
83 * EXECUTE_TEST(execute_foobar, tear_down_foobar)
84 *
85 * Then test case functions can take the form:
86 *
87 * static int test_foobar_feature()
0f113f3e
MC
88 * {
89 * SETUP_FOOBAR_TEST_FIXTURE();
90 * [...set individual members of fixture...]
91 * EXECUTE_FOOBAR_TEST();
92 * }
3ead9f37 93 */
0f113f3e 94# define SETUP_TEST_FIXTURE(TEST_FIXTURE_TYPE, set_up)\
99801878 95 TEST_FIXTURE_TYPE *fixture = set_up(TEST_CASE_NAME); \
453dfd8d 96 int result = 0
3ead9f37 97
0f113f3e 98# define EXECUTE_TEST(execute_func, tear_down)\
99801878 99 if (fixture != NULL) {\
ababe86b 100 result = execute_func(fixture);\
0f113f3e 101 tear_down(fixture);\
99801878 102 }
3ead9f37 103
0f113f3e
MC
104/*
105 * TEST_CASE_NAME is defined as the name of the test case function where
3ead9f37
MB
106 * possible; otherwise we get by with the file name and line number.
107 */
01b76c2c 108# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
0f113f3e
MC
109# if defined(_MSC_VER)
110# define TEST_CASE_NAME __FUNCTION__
111# else
112# define testutil_stringify_helper(s) #s
113# define testutil_stringify(s) testutil_stringify_helper(s)
114# define TEST_CASE_NAME __FILE__ ":" testutil_stringify(__LINE__)
115# endif /* _MSC_VER */
116# else
117# define TEST_CASE_NAME __func__
118# endif /* __STDC_VERSION__ */
3ead9f37 119
453dfd8d 120/*
ad887416
P
121 * Tests that need access to command line arguments should use the functions:
122 * test_get_argument(int n) to get the nth argument, the first argument is
123 * argument 0. This function returns NULL on error.
124 * test_get_argument_count() to get the count of the arguments.
125 * test_has_option(const char *) to check if the specified option was passed.
126 * test_get_option_argument(const char *) to get an option which includes an
127 * argument. NULL is returns if the option is not found.
128 * const char *test_get_program_name(void) returns the name of the test program
129 * being executed.
453dfd8d 130 */
ad887416
P
131const char *test_get_program_name(void);
132char *test_get_argument(size_t n);
133size_t test_get_argument_count(void);
134int test_has_option(const char *option);
135const char *test_get_option_argument(const char *option);
e364c3b2 136
e364c3b2 137/*
ad887416
P
138 * Internal helpers. Test programs shouldn't use these directly, but should
139 * rather link to one of the helper main() methods.
e364c3b2 140 */
453dfd8d 141
735e3505 142void add_test(const char *test_case_name, int (*test_fn) (void));
208d721a
RL
143void add_all_tests(const char *test_case_name, int (*test_fn)(int idx), int num,
144 int subtest);
5e3de8e6 145
4db40c94 146/*
ad887416
P
147 * Declarations for user defined functions.
148 * The first two return a boolean indicating that the test should not proceed.
4db40c94 149 */
ad887416
P
150int global_init(void);
151int setup_tests(void);
152void cleanup_tests(void);
4db40c94 153
ce2cdac2
EK
154/*
155 * Test assumption verification helpers.
156 */
157
2fae041d 158#define PRINTF_FORMAT(a, b)
4db40c94
RL
159#if defined(__GNUC__) && defined(__STDC_VERSION__)
160 /*
161 * Because we support the 'z' modifier, which made its appearance in C99,
162 * we can't use __attribute__ with pre C99 dialects.
163 */
164# if __STDC_VERSION__ >= 199901L
165# undef PRINTF_FORMAT
166# define PRINTF_FORMAT(a, b) __attribute__ ((format(printf, a, b)))
167# endif
2fae041d
P
168#endif
169
735e3505 170# define DECLARE_COMPARISON(type, name, opname) \
2fae041d
P
171 int test_ ## name ## _ ## opname(const char *, int, \
172 const char *, const char *, \
173 const type, const type);
174
175# define DECLARE_COMPARISONS(type, name) \
176 DECLARE_COMPARISON(type, name, eq) \
177 DECLARE_COMPARISON(type, name, ne) \
178 DECLARE_COMPARISON(type, name, lt) \
179 DECLARE_COMPARISON(type, name, le) \
180 DECLARE_COMPARISON(type, name, gt) \
181 DECLARE_COMPARISON(type, name, ge)
182
183DECLARE_COMPARISONS(int, int)
184DECLARE_COMPARISONS(unsigned int, uint)
185DECLARE_COMPARISONS(char, char)
186DECLARE_COMPARISONS(unsigned char, uchar)
187DECLARE_COMPARISONS(long, long)
188DECLARE_COMPARISONS(unsigned long, ulong)
f044cd05
RL
189/*
190 * Because this comparison uses a printf format specifier that's not
191 * universally known (yet), we provide an option to not have it declared.
192 */
193# ifndef TESTUTIL_NO_size_t_COMPARISON
2fae041d 194DECLARE_COMPARISONS(size_t, size_t)
f044cd05 195# endif
2fae041d
P
196
197/*
198 * Pointer comparisons against other pointers and null.
199 * These functions return 1 if the test is true.
200 * Otherwise, they return 0 and pretty-print diagnostics.
201 * These should not be called directly, use the TEST_xxx macros below instead.
202 */
203DECLARE_COMPARISON(void *, ptr, eq)
204DECLARE_COMPARISON(void *, ptr, ne)
205int test_ptr(const char *file, int line, const char *s, const void *p);
206int test_ptr_null(const char *file, int line, const char *s, const void *p);
207
ce2cdac2 208/*
2fae041d
P
209 * Equality tests for strings where NULL is a legitimate value.
210 * These calls return 1 if the two passed strings compare true.
211 * Otherwise, they return 0 and pretty-print diagnostics.
212 * These should not be called directly, use the TEST_xxx macros below instead.
ce2cdac2 213 */
2fae041d
P
214DECLARE_COMPARISON(char *, str, eq)
215DECLARE_COMPARISON(char *, str, ne)
216
adcd8e37
RS
217/*
218 * Same as above, but for strncmp.
219 */
220int test_strn_eq(const char *file, int line, const char *, const char *,
221 const char *a, const char *b, size_t s);
222int test_strn_ne(const char *file, int line, const char *, const char *,
223 const char *a, const char *b, size_t s);
224
2fae041d
P
225/*
226 * Equality test for memory blocks where NULL is a legitimate value.
d063add7 227 * These calls return 1 if the two memory blocks compare true.
2fae041d
P
228 * Otherwise, they return 0 and pretty-print diagnostics.
229 * These should not be called directly, use the TEST_xxx macros below instead.
230 */
231int test_mem_eq(const char *, int, const char *, const char *,
232 const void *, size_t, const void *, size_t);
233int test_mem_ne(const char *, int, const char *, const char *,
234 const void *, size_t, const void *, size_t);
235
236/*
237 * Check a boolean result for being true or false.
bdcacd93
F
238 * They return 1 if the condition is true (i.e. the value is non-zero).
239 * Otherwise, they return 0 and pretty-prints diagnostics using |s|.
2fae041d
P
240 * These should not be called directly, use the TEST_xxx macros below instead.
241 */
242int test_true(const char *file, int line, const char *s, int b);
243int test_false(const char *file, int line, const char *s, int b);
244
dc352c19
P
245/*
246 * Comparisons between BIGNUMs.
247 * BIGNUMS can be compared against other BIGNUMs or zero.
248 * Some additional equality tests against 1 & specific values are provided.
249 * Tests for parity are included as well.
250 */
251DECLARE_COMPARISONS(BIGNUM *, BN)
252int test_BN_eq_zero(const char *file, int line, const char *s, const BIGNUM *a);
253int test_BN_ne_zero(const char *file, int line, const char *s, const BIGNUM *a);
254int test_BN_lt_zero(const char *file, int line, const char *s, const BIGNUM *a);
255int test_BN_le_zero(const char *file, int line, const char *s, const BIGNUM *a);
256int test_BN_gt_zero(const char *file, int line, const char *s, const BIGNUM *a);
257int test_BN_ge_zero(const char *file, int line, const char *s, const BIGNUM *a);
258int test_BN_eq_one(const char *file, int line, const char *s, const BIGNUM *a);
259int test_BN_odd(const char *file, int line, const char *s, const BIGNUM *a);
260int test_BN_even(const char *file, int line, const char *s, const BIGNUM *a);
261int test_BN_eq_word(const char *file, int line, const char *bns, const char *ws,
262 const BIGNUM *a, BN_ULONG w);
263int test_BN_abs_eq_word(const char *file, int line, const char *bns,
264 const char *ws, const BIGNUM *a, BN_ULONG w);
265
2fae041d
P
266/*
267 * Pretty print a failure message.
268 * These should not be called directly, use the TEST_xxx macros below instead.
269 */
270void test_error(const char *file, int line, const char *desc, ...)
271 PRINTF_FORMAT(3, 4);
272void test_error_c90(const char *desc, ...) PRINTF_FORMAT(1, 2);
273void test_info(const char *file, int line, const char *desc, ...)
274 PRINTF_FORMAT(3, 4);
275void test_info_c90(const char *desc, ...) PRINTF_FORMAT(1, 2);
37916462 276void test_note(const char *desc, ...) PRINTF_FORMAT(1, 2);
68e49bf2 277void test_openssl_errors(void);
8fe3127c 278void test_perror(const char *s);
2fae041d
P
279
280/*
281 * The following macros provide wrapper calls to the test functions with
282 * a default description that indicates the file and line number of the error.
d063add7
P
283 *
284 * The following macros guarantee to evaluate each argument exactly once.
f479eab2 285 * This allows constructs such as: if (!TEST_ptr(ptr = OPENSSL_malloc(..)))
d063add7
P
286 * to produce better contextual output than:
287 * ptr = OPENSSL_malloc(..);
288 * if (!TEST_ptr(ptr))
2fae041d
P
289 */
290# define TEST_int_eq(a, b) test_int_eq(__FILE__, __LINE__, #a, #b, a, b)
291# define TEST_int_ne(a, b) test_int_ne(__FILE__, __LINE__, #a, #b, a, b)
292# define TEST_int_lt(a, b) test_int_lt(__FILE__, __LINE__, #a, #b, a, b)
293# define TEST_int_le(a, b) test_int_le(__FILE__, __LINE__, #a, #b, a, b)
294# define TEST_int_gt(a, b) test_int_gt(__FILE__, __LINE__, #a, #b, a, b)
295# define TEST_int_ge(a, b) test_int_ge(__FILE__, __LINE__, #a, #b, a, b)
296
d063add7
P
297# define TEST_uint_eq(a, b) test_uint_eq(__FILE__, __LINE__, #a, #b, a, b)
298# define TEST_uint_ne(a, b) test_uint_ne(__FILE__, __LINE__, #a, #b, a, b)
299# define TEST_uint_lt(a, b) test_uint_lt(__FILE__, __LINE__, #a, #b, a, b)
300# define TEST_uint_le(a, b) test_uint_le(__FILE__, __LINE__, #a, #b, a, b)
301# define TEST_uint_gt(a, b) test_uint_gt(__FILE__, __LINE__, #a, #b, a, b)
302# define TEST_uint_ge(a, b) test_uint_ge(__FILE__, __LINE__, #a, #b, a, b)
303
304# define TEST_char_eq(a, b) test_char_eq(__FILE__, __LINE__, #a, #b, a, b)
305# define TEST_char_ne(a, b) test_char_ne(__FILE__, __LINE__, #a, #b, a, b)
306# define TEST_char_lt(a, b) test_char_lt(__FILE__, __LINE__, #a, #b, a, b)
307# define TEST_char_le(a, b) test_char_le(__FILE__, __LINE__, #a, #b, a, b)
308# define TEST_char_gt(a, b) test_char_gt(__FILE__, __LINE__, #a, #b, a, b)
309# define TEST_char_ge(a, b) test_char_ge(__FILE__, __LINE__, #a, #b, a, b)
310
311# define TEST_uchar_eq(a, b) test_uchar_eq(__FILE__, __LINE__, #a, #b, a, b)
312# define TEST_uchar_ne(a, b) test_uchar_ne(__FILE__, __LINE__, #a, #b, a, b)
313# define TEST_uchar_lt(a, b) test_uchar_lt(__FILE__, __LINE__, #a, #b, a, b)
314# define TEST_uchar_le(a, b) test_uchar_le(__FILE__, __LINE__, #a, #b, a, b)
315# define TEST_uchar_gt(a, b) test_uchar_gt(__FILE__, __LINE__, #a, #b, a, b)
316# define TEST_uchar_ge(a, b) test_uchar_ge(__FILE__, __LINE__, #a, #b, a, b)
317
318# define TEST_long_eq(a, b) test_long_eq(__FILE__, __LINE__, #a, #b, a, b)
319# define TEST_long_ne(a, b) test_long_ne(__FILE__, __LINE__, #a, #b, a, b)
320# define TEST_long_lt(a, b) test_long_lt(__FILE__, __LINE__, #a, #b, a, b)
321# define TEST_long_le(a, b) test_long_le(__FILE__, __LINE__, #a, #b, a, b)
322# define TEST_long_gt(a, b) test_long_gt(__FILE__, __LINE__, #a, #b, a, b)
323# define TEST_long_ge(a, b) test_long_ge(__FILE__, __LINE__, #a, #b, a, b)
324
325# define TEST_ulong_eq(a, b) test_ulong_eq(__FILE__, __LINE__, #a, #b, a, b)
326# define TEST_ulong_ne(a, b) test_ulong_ne(__FILE__, __LINE__, #a, #b, a, b)
327# define TEST_ulong_lt(a, b) test_ulong_lt(__FILE__, __LINE__, #a, #b, a, b)
328# define TEST_ulong_le(a, b) test_ulong_le(__FILE__, __LINE__, #a, #b, a, b)
329# define TEST_ulong_gt(a, b) test_ulong_gt(__FILE__, __LINE__, #a, #b, a, b)
330# define TEST_ulong_ge(a, b) test_ulong_ge(__FILE__, __LINE__, #a, #b, a, b)
331
332# define TEST_size_t_eq(a, b) test_size_t_eq(__FILE__, __LINE__, #a, #b, a, b)
333# define TEST_size_t_ne(a, b) test_size_t_ne(__FILE__, __LINE__, #a, #b, a, b)
334# define TEST_size_t_lt(a, b) test_size_t_lt(__FILE__, __LINE__, #a, #b, a, b)
335# define TEST_size_t_le(a, b) test_size_t_le(__FILE__, __LINE__, #a, #b, a, b)
336# define TEST_size_t_gt(a, b) test_size_t_gt(__FILE__, __LINE__, #a, #b, a, b)
337# define TEST_size_t_ge(a, b) test_size_t_ge(__FILE__, __LINE__, #a, #b, a, b)
2fae041d
P
338
339# define TEST_ptr_eq(a, b) test_ptr_eq(__FILE__, __LINE__, #a, #b, a, b)
340# define TEST_ptr_ne(a, b) test_ptr_ne(__FILE__, __LINE__, #a, #b, a, b)
341# define TEST_ptr(a) test_ptr(__FILE__, __LINE__, #a, a)
342# define TEST_ptr_null(a) test_ptr_null(__FILE__, __LINE__, #a, a)
343
344# define TEST_str_eq(a, b) test_str_eq(__FILE__, __LINE__, #a, #b, a, b)
345# define TEST_str_ne(a, b) test_str_ne(__FILE__, __LINE__, #a, #b, a, b)
adcd8e37
RS
346# define TEST_strn_eq(a, b, n) test_strn_eq(__FILE__, __LINE__, #a, #b, a, b, n)
347# define TEST_strn_ne(a, b, n) test_strn_ne(__FILE__, __LINE__, #a, #b, a, b, n)
2fae041d
P
348
349# define TEST_mem_eq(a, m, b, n) test_mem_eq(__FILE__, __LINE__, #a, #b, a, m, b, n)
350# define TEST_mem_ne(a, m, b, n) test_mem_ne(__FILE__, __LINE__, #a, #b, a, m, b, n)
351
298f40e1
P
352# define TEST_true(a) test_true(__FILE__, __LINE__, #a, (a) != 0)
353# define TEST_false(a) test_false(__FILE__, __LINE__, #a, (a) != 0)
2fae041d 354
dc352c19
P
355# define TEST_BN_eq(a, b) test_BN_eq(__FILE__, __LINE__, #a, #b, a, b)
356# define TEST_BN_ne(a, b) test_BN_ne(__FILE__, __LINE__, #a, #b, a, b)
03d8e9cb
P
357# define TEST_BN_lt(a, b) test_BN_lt(__FILE__, __LINE__, #a, #b, a, b)
358# define TEST_BN_gt(a, b) test_BN_gt(__FILE__, __LINE__, #a, #b, a, b)
359# define TEST_BN_le(a, b) test_BN_le(__FILE__, __LINE__, #a, #b, a, b)
360# define TEST_BN_ge(a, b) test_BN_ge(__FILE__, __LINE__, #a, #b, a, b)
dc352c19
P
361# define TEST_BN_eq_zero(a) test_BN_eq_zero(__FILE__, __LINE__, #a, a)
362# define TEST_BN_ne_zero(a) test_BN_ne_zero(__FILE__, __LINE__, #a, a)
363# define TEST_BN_lt_zero(a) test_BN_lt_zero(__FILE__, __LINE__, #a, a)
364# define TEST_BN_gt_zero(a) test_BN_gt_zero(__FILE__, __LINE__, #a, a)
365# define TEST_BN_le_zero(a) test_BN_le_zero(__FILE__, __LINE__, #a, a)
366# define TEST_BN_ge_zero(a) test_BN_ge_zero(__FILE__, __LINE__, #a, a)
367# define TEST_BN_eq_one(a) test_BN_eq_one(__FILE__, __LINE__, #a, a)
368# define TEST_BN_eq_word(a, w) test_BN_eq_word(__FILE__, __LINE__, #a, #w, a, w)
369# define TEST_BN_abs_eq_word(a, w) test_BN_abs_eq_word(__FILE__, __LINE__, #a, #w, a, w)
370# define TEST_BN_odd(a) test_BN_odd(__FILE__, __LINE__, #a, a)
371# define TEST_BN_even(a) test_BN_even(__FILE__, __LINE__, #a, a)
372
2fae041d
P
373/*
374 * TEST_error(desc, ...) prints an informative error message in the standard
375 * format. |desc| is a printf format string.
376 */
377# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
378# define TEST_error test_error_c90
379# define TEST_info test_info_c90
380# else
381# define TEST_error(...) test_error(__FILE__, __LINE__, __VA_ARGS__)
382# define TEST_info(...) test_info(__FILE__, __LINE__, __VA_ARGS__)
383# endif
37916462 384# define TEST_note test_note
68e49bf2 385# define TEST_openssl_errors test_openssl_errors
8fe3127c 386# define TEST_perror test_perror
d61f0078 387
4db40c94
RL
388extern BIO *bio_out;
389extern BIO *bio_err;
208d721a 390
37916462
P
391/*
392 * Formatted output for strings, memory and bignums.
393 */
394void test_output_string(const char *name, const char *m, size_t l);
395void test_output_bignum(const char *name, const BIGNUM *bn);
396void test_output_memory(const char *name, const unsigned char *m, size_t l);
397
398
ae269dd8
RS
399/*
400 * Utilities to parse a test file.
401 */
402#define TESTMAXPAIRS 20
403
404typedef struct pair_st {
405 char *key;
406 char *value;
407} PAIR;
408
409typedef struct stanza_st {
410 const char *test_file; /* Input file name */
411 BIO *fp; /* Input file */
412 int curr; /* Current line in file */
413 int start; /* Line where test starts */
414 int errors; /* Error count */
415 int numtests; /* Number of tests */
416 int numskip; /* Number of skipped tests */
417 int numpairs;
418 PAIR pairs[TESTMAXPAIRS];
419 BIO *key; /* temp memory BIO for reading in keys */
420 char buff[4096]; /* Input buffer for a single key/value */
421} STANZA;
422
423/*
424 * Prepare to start reading the file |testfile| as input.
425 */
426int test_start_file(STANZA *s, const char *testfile);
427int test_end_file(STANZA *s);
428
429/*
430 * Read a stanza from the test file. A stanza consists of a block
bd91e3c8 431 * of lines of the form
ae269dd8
RS
432 * key = value
433 * The block is terminated by EOF or a blank line.
434 * Return 1 if found, 0 on EOF or error.
435 */
436int test_readstanza(STANZA *s);
437
438/*
439 * Clear a stanza, release all allocated memory.
440 */
441void test_clearstanza(STANZA *s);
442
4483fbae
F
443/*
444 * Glue an array of strings together and return it as an allocated string.
445 * Optionally return the whole length of this string in |out_len|
446 */
447char *glue_strings(const char *list[], size_t *out_len);
448
579d0fab 449#endif /* HEADER_TESTUTIL_H */