From: Richard Russon Date: Mon, 29 Apr 2019 13:46:56 +0000 (+0100) Subject: test: add tags tests for degenerate cases X-Git-Tag: 2019-10-25~233^2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56800487f535ae6f22ca8132ac069f98100651c4;p=neomutt test: add tags tests for degenerate cases --- diff --git a/test/tags/driver_tags_free.c b/test/tags/driver_tags_free.c index 849278a1e..8c5a86d9b 100644 --- a/test/tags/driver_tags_free.c +++ b/test/tags/driver_tags_free.c @@ -30,4 +30,9 @@ void test_driver_tags_free(void) { // void driver_tags_free(struct TagHead *head); + + { + driver_tags_free(NULL); + TEST_CHECK_(1, "driver_tags_free(NULL)"); + } } diff --git a/test/tags/driver_tags_get.c b/test/tags/driver_tags_get.c index 7000353ae..ef0d56ffe 100644 --- a/test/tags/driver_tags_get.c +++ b/test/tags/driver_tags_get.c @@ -30,4 +30,8 @@ void test_driver_tags_get(void) { // char *driver_tags_get(struct TagHead *head); + + { + TEST_CHECK(!driver_tags_get(NULL)); + } } diff --git a/test/tags/driver_tags_get_transformed.c b/test/tags/driver_tags_get_transformed.c index f610ba633..134906a94 100644 --- a/test/tags/driver_tags_get_transformed.c +++ b/test/tags/driver_tags_get_transformed.c @@ -30,4 +30,8 @@ void test_driver_tags_get_transformed(void) { // char *driver_tags_get_transformed(struct TagHead *head); + + { + TEST_CHECK(!driver_tags_get_transformed(NULL)); + } } diff --git a/test/tags/driver_tags_get_transformed_for.c b/test/tags/driver_tags_get_transformed_for.c index e06ae2945..dcb0bf3c7 100644 --- a/test/tags/driver_tags_get_transformed_for.c +++ b/test/tags/driver_tags_get_transformed_for.c @@ -30,4 +30,13 @@ void test_driver_tags_get_transformed_for(void) { // char *driver_tags_get_transformed_for(const char *name, struct TagHead *head); + + { + struct TagHead taghead = { 0 }; + TEST_CHECK(!driver_tags_get_transformed_for(NULL, &taghead)); + } + + { + TEST_CHECK(!driver_tags_get_transformed_for("apple", NULL)); + } } diff --git a/test/tags/driver_tags_get_with_hidden.c b/test/tags/driver_tags_get_with_hidden.c index fbddf1d77..06f5b3270 100644 --- a/test/tags/driver_tags_get_with_hidden.c +++ b/test/tags/driver_tags_get_with_hidden.c @@ -30,4 +30,8 @@ void test_driver_tags_get_with_hidden(void) { // char *driver_tags_get_with_hidden(struct TagHead *head); + + { + TEST_CHECK(!driver_tags_get_with_hidden(NULL)); + } } diff --git a/test/tags/driver_tags_replace.c b/test/tags/driver_tags_replace.c index 615f01fa0..a47f1f800 100644 --- a/test/tags/driver_tags_replace.c +++ b/test/tags/driver_tags_replace.c @@ -30,4 +30,13 @@ void test_driver_tags_replace(void) { // bool driver_tags_replace(struct TagHead *head, char *tags); + + { + TEST_CHECK(!driver_tags_replace(NULL, "apple")); + } + + { + struct TagHead taghead = { 0 }; + TEST_CHECK(driver_tags_replace(&taghead, NULL)); + } }