From: Richard Russon Date: Mon, 29 Apr 2019 13:46:56 +0000 (+0100) Subject: test: add logging tests for degenerate cases X-Git-Tag: 2019-10-25~233^2~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=596818b1c26075782e10a0229eb7deb0e571bffd;p=neomutt test: add logging tests for degenerate cases --- diff --git a/test/logging/log_disp_file.c b/test/logging/log_disp_file.c index 2ee58f0cd..6c83e3437 100644 --- a/test/logging/log_disp_file.c +++ b/test/logging/log_disp_file.c @@ -28,4 +28,12 @@ void test_log_disp_file(void) { // int log_disp_file(time_t stamp, const char *file, int line, const char *function, int level, ...); + + { + TEST_CHECK(log_disp_file(0, NULL, 0, "banana", 0, "fmt") == 0); + } + + { + TEST_CHECK(log_disp_file(0, "apple", 0, NULL, 0, "fmt") == 0); + } } diff --git a/test/logging/log_disp_queue.c b/test/logging/log_disp_queue.c index 0e4b1a7a7..cdf7d22b1 100644 --- a/test/logging/log_disp_queue.c +++ b/test/logging/log_disp_queue.c @@ -28,4 +28,12 @@ void test_log_disp_queue(void) { // int log_disp_queue(time_t stamp, const char *file, int line, const char *function, int level, ...); + + { + TEST_CHECK(log_disp_queue(0, NULL, 0, "banana", 0, "fmt") != 0); + } + + { + TEST_CHECK(log_disp_queue(0, "apple", 0, NULL, 0, "fmt") != 0); + } } diff --git a/test/logging/log_disp_terminal.c b/test/logging/log_disp_terminal.c index 8ba18fe21..60cd33152 100644 --- a/test/logging/log_disp_terminal.c +++ b/test/logging/log_disp_terminal.c @@ -28,4 +28,12 @@ void test_log_disp_terminal(void) { // int log_disp_terminal(time_t stamp, const char *file, int line, const char *function, int level, ...); + + { + TEST_CHECK(log_disp_terminal(0, NULL, 0, "banana", 0, "fmt") != 0); + } + + { + TEST_CHECK(log_disp_terminal(0, "apple", 0, NULL, 0, "fmt") != 0); + } } diff --git a/test/logging/log_file_set_filename.c b/test/logging/log_file_set_filename.c index 507a7603d..44e88a4a6 100644 --- a/test/logging/log_file_set_filename.c +++ b/test/logging/log_file_set_filename.c @@ -28,4 +28,8 @@ void test_log_file_set_filename(void) { // int log_file_set_filename(const char *file, bool verbose); + + { + TEST_CHECK(log_file_set_filename(NULL, false) != 0); + } } diff --git a/test/logging/log_file_set_version.c b/test/logging/log_file_set_version.c index 82e502244..71ea04586 100644 --- a/test/logging/log_file_set_version.c +++ b/test/logging/log_file_set_version.c @@ -28,4 +28,9 @@ void test_log_file_set_version(void) { // void log_file_set_version(const char *version); + + { + log_file_set_version(NULL); + TEST_CHECK_(1, "log_file_set_version(NULL)"); + } } diff --git a/test/logging/log_queue_add.c b/test/logging/log_queue_add.c index 992bcb4be..eb23e4dd9 100644 --- a/test/logging/log_queue_add.c +++ b/test/logging/log_queue_add.c @@ -28,4 +28,8 @@ void test_log_queue_add(void) { // int log_queue_add(struct LogLine *ll); + + { + TEST_CHECK(log_queue_add(NULL) != 0); + } } diff --git a/test/logging/log_queue_flush.c b/test/logging/log_queue_flush.c index 82a6346f3..7c7a9ff4a 100644 --- a/test/logging/log_queue_flush.c +++ b/test/logging/log_queue_flush.c @@ -28,4 +28,9 @@ void test_log_queue_flush(void) { // void log_queue_flush(log_dispatcher_t disp); + + { + log_queue_flush(NULL); + TEST_CHECK_(1, "log_queue_flush(NULL)"); + } } diff --git a/test/logging/log_queue_save.c b/test/logging/log_queue_save.c index 5e6c8892f..bedd7e77b 100644 --- a/test/logging/log_queue_save.c +++ b/test/logging/log_queue_save.c @@ -28,4 +28,8 @@ void test_log_queue_save(void) { // int log_queue_save(FILE *fp); + + { + TEST_CHECK(log_queue_save(NULL) == 0); + } }