From: Pietro Cerutti Date: Sun, 19 May 2019 09:06:15 +0000 (+0000) Subject: Add tests for mutt_addrlist_free X-Git-Tag: 2019-10-25~200^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa624ccc71579487d222c97a114ae45e80ce46bd;p=neomutt Add tests for mutt_addrlist_free --- diff --git a/test/address/mutt_addrlist_free.c b/test/address/mutt_addrlist_free.c index 84e12a888..2f2089084 100644 --- a/test/address/mutt_addrlist_free.c +++ b/test/address/mutt_addrlist_free.c @@ -25,6 +25,7 @@ #include "config.h" #include "mutt/mutt.h" #include "address/lib.h" +#include "common.h" void test_mutt_addrlist_free(void) { @@ -34,4 +35,15 @@ void test_mutt_addrlist_free(void) mutt_addrlist_free(NULL); TEST_CHECK_(1, "mutt_addrlist_free(NULL)"); } + + { + struct AddressList *al = mutt_addrlist_new(); + int parsed = + mutt_addrlist_parse(al, "john@doe.org, foo@example.com, bar@baz.org"); + TEST_CHECK(parsed == 3); + TEST_CHECK_STR_EQ(TAILQ_FIRST(al)->mailbox, "john@doe.org"); + TEST_CHECK_STR_EQ(TAILQ_LAST(al, AddressList)->mailbox, "bar@baz.org"); + mutt_addrlist_free(&al); + TEST_CHECK(al == NULL); + } }