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

index 2dee5e312e06ef278a9fc51f48c1b50463121679..3f27ba7d007cbcb27ddb367cf5dd60d1bdeba3f6 100644 (file)
@@ -28,4 +28,8 @@
 void test_mutt_map_get_name(void)
 {
   // const char *mutt_map_get_name(int val, const struct Mapping *map);
+
+  {
+    TEST_CHECK(!mutt_map_get_name(0, NULL));
+  }
 }
index f44aaae2d7e5d09981f525b1a295279b6b64b99b..7e1cac6a8db78919d8f08f5204a2a77ca2a6a0b2 100644 (file)
 void test_mutt_map_get_value(void)
 {
   // int mutt_map_get_value(const char *name, const struct Mapping *map);
+
+  {
+    struct Mapping mapping = { 0 };
+    TEST_CHECK(mutt_map_get_value(NULL, &mapping) != 0);
+  }
+
+  {
+    TEST_CHECK(mutt_map_get_value("apple", NULL) != 0);
+  }
 }