]> granicus.if.org Git - neomutt/commitdiff
Add tests for mutt_addrlist_free_all
authorPietro Cerutti <gahr@gahr.ch>
Sun, 19 May 2019 08:37:00 +0000 (08:37 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 23 May 2019 10:57:10 +0000 (11:57 +0100)
test/address/mutt_addrlist_free_all.c

index 0b3358d8d58491dc29a0152b7d02451db6452c12..63dc48d3451eea10b59533c45a0452482862ea79 100644 (file)
@@ -34,4 +34,15 @@ void test_mutt_addrlist_free_all(void)
     mutt_addrlist_free_all(NULL);
     TEST_CHECK_(1, "mutt_addrlist_free_all(NULL)");
   }
+
+  {
+    struct AddressList al = TAILQ_HEAD_INITIALIZER(al);
+    mutt_addrlist_append(&al, mutt_addr_new());
+    mutt_addrlist_append(&al, mutt_addr_new());
+    mutt_addrlist_append(&al, mutt_addr_new());
+    mutt_addrlist_append(&al, mutt_addr_new());
+    mutt_addrlist_append(&al, mutt_addr_new());
+    mutt_addrlist_free_all(&al);
+    TEST_CHECK(TAILQ_EMPTY(&al));
+  }
 }