]> granicus.if.org Git - neomutt/commitdiff
test: add from 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/from/is_from.c

index 952059754510e951c24315fb94e3af1f302a60f5..c5bf0d61b566a18f7747ebacc363774a304db9ce 100644 (file)
 void test_is_from(void)
 {
   // bool is_from(const char *s, char *path, size_t pathlen, time_t *tp);
+
+  {
+    char buf[32] = { 0 };
+    time_t t = { 0 };
+    TEST_CHECK(!is_from(NULL, buf, sizeof(buf), &t));
+  }
+
+  {
+    time_t t = { 0 };
+    TEST_CHECK(!is_from("apple", NULL, 10, &t));
+  }
+
+  {
+    char buf[32] = { 0 };
+    TEST_CHECK(!is_from("apple", buf, sizeof(buf), NULL));
+  }
 }