]> granicus.if.org Git - neomutt/commitdiff
test: add idna tests for degenerate cases
authorRichard Russon <rich@flatcap.org>
Sat, 27 Apr 2019 21:26:07 +0000 (22:26 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 27 Apr 2019 21:48:41 +0000 (22:48 +0100)
test/idna/mutt_idna_intl_to_local.c
test/idna/mutt_idna_local_to_intl.c
test/idna/mutt_idna_to_ascii_lz.c

index e076b69286a4636a5ab9975a9996909bac99a413..a6e0e6d0e4f6532d75876d93d947af2b65e7fb07 100644 (file)
 void test_mutt_idna_intl_to_local(void)
 {
   // char * mutt_idna_intl_to_local(const char *user, const char *domain, int flags);
+
+  {
+    TEST_CHECK(!mutt_idna_intl_to_local(NULL, "banana", 0));
+  }
+
+  {
+    TEST_CHECK(!mutt_idna_intl_to_local("apple", NULL, 0));
+  }
 }
index 11c905855f586384d442b9d13432ccfbe6348aa1..63657cd7ad1f9cd9fe03c20ca9c4e7867f442dd8 100644 (file)
 void test_mutt_idna_local_to_intl(void)
 {
   // char * mutt_idna_local_to_intl(const char *user, const char *domain);
+
+  {
+    TEST_CHECK(!mutt_idna_local_to_intl(NULL, "banana"));
+  }
+
+  {
+    TEST_CHECK(!mutt_idna_local_to_intl("apple", NULL));
+  }
 }
index 68826c1e4f7b515df30dbba80333711366884328..bf45b32d8f45afcac4fa5fa84f18f1c82609a44d 100644 (file)
 void test_mutt_idna_to_ascii_lz(void)
 {
   // int mutt_idna_to_ascii_lz(const char *input, char **output, int flags);
+
+  {
+    char *out = NULL;
+    TEST_CHECK(mutt_idna_to_ascii_lz(NULL, &out, 0) == -1);
+  }
+
+  {
+    TEST_CHECK(mutt_idna_to_ascii_lz("apple", NULL, 0) == -1);
+  }
 }