]> granicus.if.org Git - neomutt/commitdiff
test: add tags tests for degenerate cases
authorRichard Russon <rich@flatcap.org>
Mon, 29 Apr 2019 13:46:56 +0000 (14:46 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 30 Apr 2019 10:22:04 +0000 (11:22 +0100)
test/tags/driver_tags_free.c
test/tags/driver_tags_get.c
test/tags/driver_tags_get_transformed.c
test/tags/driver_tags_get_transformed_for.c
test/tags/driver_tags_get_with_hidden.c
test/tags/driver_tags_replace.c

index 849278a1ee84fb4911973651e933b31bc9878ff4..8c5a86d9b3462cfecce681d02c2098e6d5cd07c7 100644 (file)
@@ -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)");
+  }
 }
index 7000353aeda772e618ee34c0da28ddfe864a831c..ef0d56ffe1d6b4dd4f1885a55b1aeb60b6763e80 100644 (file)
@@ -30,4 +30,8 @@
 void test_driver_tags_get(void)
 {
   // char *driver_tags_get(struct TagHead *head);
+
+  {
+    TEST_CHECK(!driver_tags_get(NULL));
+  }
 }
index f610ba633f7567b99989af68c32d9dbf56dd5941..134906a94fdb45ced50b39c2e54457f2676aae5f 100644 (file)
@@ -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));
+  }
 }
index e06ae2945674f80a3de386b6afb8b3fb4183f701..dcb0bf3c78402e056c253dcbb789669faff923a1 100644 (file)
 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));
+  }
 }
index fbddf1d77da951cbed45e5b7d306d992ab68c915..06f5b3270c5132da3576196dc5f0da5f8356c68f 100644 (file)
@@ -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));
+  }
 }
index 615f01fa0c9073a49d0ff25c08c83cb6e60f4885..a47f1f800dfa2d037f0770b0f1cf1ef5d7ab4b1a 100644 (file)
 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));
+  }
 }