Mercurial > dovecot > core-2.2
view src/lib-test/test-common.h @ 14629:c93ca5e46a8a
Marked functions parameters that are allowed to be NULL. Some APIs were also changed.
The non-obvious APIs where NULL parameter was changed to "" are
master_service_init() and auth_master_user_list_init().
These checks can currently be enabled only on a patched clang:
http://llvm.org/bugs/show_bug.cgi?id=6786
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 24 Jun 2012 00:52:57 +0300 |
parents | 7c3605774b93 |
children | ed9e50227250 |
line wrap: on
line source
#ifndef TEST_COMMON_H #define TEST_COMMON_H struct istream *test_istream_create(const char *data); struct istream *test_istream_create_data(const void *data, size_t size); void test_istream_set_size(struct istream *input, uoff_t size); void test_istream_set_allow_eof(struct istream *input, bool allow); void test_istream_set_max_buffer_size(struct istream *input, size_t size); void test_begin(const char *name); #define test_assert(code) STMT_START { \ if (!(code)) test_assert_failed(#code, __FILE__, __LINE__); \ } STMT_END void test_assert_failed(const char *code, const char *file, unsigned int line); void test_end(void); void test_out(const char *name, bool success); void test_out_reason(const char *name, bool success, const char *reason) ATTR_NULL(3); int test_run(void (*test_functions[])(void)); void test_init(void); int test_deinit(void); void test_run_funcs(void (*test_functions[])(void)); #endif