From f4f0e87fcab2927ac1b66a79b743a4cb7429c227 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 27 Apr 2019 16:53:33 +0100 Subject: [PATCH] test: templates for address functions --- .gitignore | 1 + Makefile.autosetup | 2 +- test/Makefile.autosetup | 45 ++++++++++++++- test/address/main.c | 68 +++++++++++++++++++++++ test/address/mutt_addr_append.c | 32 +++++++++++ test/address/mutt_addr_cat.c | 32 +++++++++++ test/address/mutt_addr_cmp.c | 32 +++++++++++ test/address/mutt_addr_cmp_strict.c | 32 +++++++++++ test/address/mutt_addr_copy.c | 32 +++++++++++ test/address/mutt_addr_copy_list.c | 32 +++++++++++ test/address/mutt_addr_for_display.c | 32 +++++++++++ test/address/mutt_addr_free.c | 32 +++++++++++ test/address/mutt_addr_has_recips.c | 32 +++++++++++ test/address/mutt_addr_is_intl.c | 32 +++++++++++ test/address/mutt_addr_is_local.c | 32 +++++++++++ test/address/mutt_addr_mbox_to_udomain.c | 32 +++++++++++ test/address/mutt_addr_new.c | 32 +++++++++++ test/address/mutt_addr_parse_list.c | 32 +++++++++++ test/address/mutt_addr_parse_list2.c | 32 +++++++++++ test/address/mutt_addr_qualify.c | 32 +++++++++++ test/address/mutt_addr_remove_from_list.c | 32 +++++++++++ test/address/mutt_addr_remove_xrefs.c | 32 +++++++++++ test/address/mutt_addr_search.c | 32 +++++++++++ test/address/mutt_addr_set_intl.c | 32 +++++++++++ test/address/mutt_addr_set_local.c | 32 +++++++++++ test/address/mutt_addr_valid_msgid.c | 32 +++++++++++ test/address/mutt_addr_write.c | 32 +++++++++++ test/address/mutt_addr_write_single.c | 32 +++++++++++ test/address/mutt_addrlist_to_intl.c | 32 +++++++++++ test/address/mutt_addrlist_to_local.c | 32 +++++++++++ 30 files changed, 945 insertions(+), 3 deletions(-) create mode 100644 test/address/main.c create mode 100644 test/address/mutt_addr_append.c create mode 100644 test/address/mutt_addr_cat.c create mode 100644 test/address/mutt_addr_cmp.c create mode 100644 test/address/mutt_addr_cmp_strict.c create mode 100644 test/address/mutt_addr_copy.c create mode 100644 test/address/mutt_addr_copy_list.c create mode 100644 test/address/mutt_addr_for_display.c create mode 100644 test/address/mutt_addr_free.c create mode 100644 test/address/mutt_addr_has_recips.c create mode 100644 test/address/mutt_addr_is_intl.c create mode 100644 test/address/mutt_addr_is_local.c create mode 100644 test/address/mutt_addr_mbox_to_udomain.c create mode 100644 test/address/mutt_addr_new.c create mode 100644 test/address/mutt_addr_parse_list.c create mode 100644 test/address/mutt_addr_parse_list2.c create mode 100644 test/address/mutt_addr_qualify.c create mode 100644 test/address/mutt_addr_remove_from_list.c create mode 100644 test/address/mutt_addr_remove_xrefs.c create mode 100644 test/address/mutt_addr_search.c create mode 100644 test/address/mutt_addr_set_intl.c create mode 100644 test/address/mutt_addr_set_local.c create mode 100644 test/address/mutt_addr_valid_msgid.c create mode 100644 test/address/mutt_addr_write.c create mode 100644 test/address/mutt_addr_write_single.c create mode 100644 test/address/mutt_addrlist_to_intl.c create mode 100644 test/address/mutt_addrlist_to_local.c diff --git a/.gitignore b/.gitignore index bd974c33a..189108cc4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ Makefile doc/makedoc neomutt pgpewrap +test/address-test test/config-test test/neomutt-test test/path-test diff --git a/Makefile.autosetup b/Makefile.autosetup index 356167865..580e02c35 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -446,7 +446,7 @@ distclean: clean # coverage testing coverage: all test $(RM) lcov - lcov -t "test" -o lcov.info -c -d mutt -d config + lcov -t "test" -o lcov.info -c -d address -d config -d mutt -genhtml -o lcov lcov.info -f lcov -l lcov.info diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index 98a40bb57..58f1ce7b6 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -7,6 +7,34 @@ TEST_OBJS = test/main.o \ test/url.o \ test/file.o +ADDRESS_OBJS = test/address/main.o \ + test/address/mutt_addr_append.o \ + test/address/mutt_addr_cat.o \ + test/address/mutt_addr_cmp.o \ + test/address/mutt_addr_cmp_strict.o \ + test/address/mutt_addr_copy.o \ + test/address/mutt_addr_copy_list.o \ + test/address/mutt_addr_for_display.o \ + test/address/mutt_addr_free.o \ + test/address/mutt_addr_has_recips.o \ + test/address/mutt_addr_is_intl.o \ + test/address/mutt_addr_is_local.o \ + test/address/mutt_addrlist_to_intl.o \ + test/address/mutt_addrlist_to_local.o \ + test/address/mutt_addr_mbox_to_udomain.o \ + test/address/mutt_addr_new.o \ + test/address/mutt_addr_parse_list2.o \ + test/address/mutt_addr_parse_list.o \ + test/address/mutt_addr_qualify.o \ + test/address/mutt_addr_remove_from_list.o \ + test/address/mutt_addr_remove_xrefs.o \ + test/address/mutt_addr_search.o \ + test/address/mutt_addr_set_intl.o \ + test/address/mutt_addr_set_local.o \ + test/address/mutt_addr_valid_msgid.o \ + test/address/mutt_addr_write.o \ + test/address/mutt_addr_write_single.o + CONFIG_OBJS = test/config/main.o test/config/account.o \ test/config/address.o test/config/bool.o \ test/config/command.o test/config/common.o test/config/dump.o \ @@ -91,6 +119,8 @@ CFLAGS += -I$(SRCDIR)/test TEST_BINARY = test/neomutt-test$(EXEEXT) +TEST_ADDRESS = test/address-test$(EXEEXT) + TEST_CONFIG = test/config-test$(EXEEXT) TEST_PATH = test/path-test$(EXEEXT) @@ -100,8 +130,9 @@ TEST_PATTERN = test/pattern-test$(EXEEXT) TEST_STRING = test/string-test$(EXEEXT) .PHONY: test -test: $(TEST_BINARY) $(TEST_CONFIG) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING) +test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_CONFIG) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING) $(TEST_BINARY) + $(TEST_ADDRESS) $(TEST_CONFIG) $(TEST_PATH) $(TEST_PATTERN) @@ -110,6 +141,9 @@ test: $(TEST_BINARY) $(TEST_CONFIG) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING) $(TEST_BINARY): $(TEST_OBJS) $(MUTTLIBS) $(CC) -o $@ $(TEST_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) +$(TEST_ADDRESS): $(PWD)/test/address $(ADDRESS_OBJS) $(MUTTLIBS) + $(CC) -o $@ $(ADDRESS_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) + $(TEST_CONFIG): $(PWD)/test/config $(CONFIG_OBJS) $(MUTTLIBS) $(CC) -o $@ $(CONFIG_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) @@ -122,6 +156,9 @@ $(TEST_PATTERN): $(PWD)/test/pattern $(PATTERN_OBJS) $(MUTTLIBS) $(TEST_STRING): $(PWD)/test/string $(STRING_OBJS) $(MUTTLIBS) $(CC) -o $@ $(STRING_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) +$(PWD)/test/address: + $(MKDIR_P) $(PWD)/test/address + $(PWD)/test/config: $(MKDIR_P) $(PWD)/test/config @@ -134,10 +171,11 @@ $(PWD)/test/pattern: $(PWD)/test/string: $(MKDIR_P) $(PWD)/test/string -all-test: $(TEST_BINARY) $(TEST_CONFIG) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING) +all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_CONFIG) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING) clean-test: $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \ + $(TEST_ADDRESS) $(ADDRESS_OBJS) $(ADDRESS_OBJS:.o=.Po) \ $(TEST_CONFIG) $(CONFIG_OBJS) $(CONFIG_OBJS:.o=.Po) \ $(TEST_PATH) $(PATH_OBJS) $(PATH_OBJS:.o=.Po) \ $(TEST_PATTERN) $(PATTERN_OBJS) $(PATTERN_OBJS:.o=.Po) \ @@ -149,6 +187,9 @@ uninstall-test: TEST_DEPFILES = $(TEST_OBJS:.o=.Po) -include $(TEST_DEPFILES) +ADDRESS_DEPFILES = $(ADDRESS_OBJS:.o=.Po) +-include $(ADDRESS_DEPFILES) + CONFIG_DEPFILES = $(CONFIG_OBJS:.o=.Po) -include $(CONFIG_DEPFILES) diff --git a/test/address/main.c b/test/address/main.c new file mode 100644 index 000000000..3e2f50537 --- /dev/null +++ b/test/address/main.c @@ -0,0 +1,68 @@ +/** + * @file + * Test code for Path Operations + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include "acutest.h" + +/****************************************************************************** + * Add your test cases to this list. + *****************************************************************************/ +#define NEOMUTT_TEST_LIST \ + NEOMUTT_TEST_ITEM(test_mutt_addr_append) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_cat) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_cmp) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_cmp_strict) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_copy) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_copy_list) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_for_display) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_free) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_has_recips) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_is_intl) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_is_local) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_mbox_to_udomain) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_new) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_parse_list) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_parse_list2) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_qualify) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_remove_from_list) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_remove_xrefs) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_search) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_set_intl) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_set_local) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_valid_msgid) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_write) \ + NEOMUTT_TEST_ITEM(test_mutt_addr_write_single) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_to_intl) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_to_local) + +/****************************************************************************** + * You probably don't need to touch what follows. + *****************************************************************************/ +#define NEOMUTT_TEST_ITEM(x) void x(void); +NEOMUTT_TEST_LIST +#undef NEOMUTT_TEST_ITEM + +TEST_LIST = { +#define NEOMUTT_TEST_ITEM(x) { #x, x }, + NEOMUTT_TEST_LIST +#undef NEOMUTT_TEST_ITEM + { 0 } +}; diff --git a/test/address/mutt_addr_append.c b/test/address/mutt_addr_append.c new file mode 100644 index 000000000..225766739 --- /dev/null +++ b/test/address/mutt_addr_append.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_append() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_append(void) +{ + // struct Address *mutt_addr_append(struct Address **a, struct Address *b, bool prune); +} diff --git a/test/address/mutt_addr_cat.c b/test/address/mutt_addr_cat.c new file mode 100644 index 000000000..acae11c7b --- /dev/null +++ b/test/address/mutt_addr_cat.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_cat() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_cat(void) +{ + // void mutt_addr_cat(char *buf, size_t buflen, const char *value, const char *specials); +} diff --git a/test/address/mutt_addr_cmp.c b/test/address/mutt_addr_cmp.c new file mode 100644 index 000000000..432ff9480 --- /dev/null +++ b/test/address/mutt_addr_cmp.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_cmp() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_cmp(void) +{ + // bool mutt_addr_cmp(struct Address *a, struct Address *b); +} diff --git a/test/address/mutt_addr_cmp_strict.c b/test/address/mutt_addr_cmp_strict.c new file mode 100644 index 000000000..e88e72840 --- /dev/null +++ b/test/address/mutt_addr_cmp_strict.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_cmp_strict() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_cmp_strict(void) +{ + // bool mutt_addr_cmp_strict(const struct Address *a, const struct Address *b); +} diff --git a/test/address/mutt_addr_copy.c b/test/address/mutt_addr_copy.c new file mode 100644 index 000000000..9f600187f --- /dev/null +++ b/test/address/mutt_addr_copy.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_copy() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_copy(void) +{ + // struct Address *mutt_addr_copy(struct Address *addr); +} diff --git a/test/address/mutt_addr_copy_list.c b/test/address/mutt_addr_copy_list.c new file mode 100644 index 000000000..bf549b9ad --- /dev/null +++ b/test/address/mutt_addr_copy_list.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_copy_list() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_copy_list(void) +{ + // struct Address *mutt_addr_copy_list(struct Address *addr, bool prune); +} diff --git a/test/address/mutt_addr_for_display.c b/test/address/mutt_addr_for_display.c new file mode 100644 index 000000000..ca26eb5ed --- /dev/null +++ b/test/address/mutt_addr_for_display.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_for_display() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_for_display(void) +{ + // const char * mutt_addr_for_display(struct Address *a); +} diff --git a/test/address/mutt_addr_free.c b/test/address/mutt_addr_free.c new file mode 100644 index 000000000..a73e6287c --- /dev/null +++ b/test/address/mutt_addr_free.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_free() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_free(void) +{ + // void mutt_addr_free(struct Address **p); +} diff --git a/test/address/mutt_addr_has_recips.c b/test/address/mutt_addr_has_recips.c new file mode 100644 index 000000000..9582f3242 --- /dev/null +++ b/test/address/mutt_addr_has_recips.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_has_recips() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_has_recips(void) +{ + // int mutt_addr_has_recips(struct Address *a); +} diff --git a/test/address/mutt_addr_is_intl.c b/test/address/mutt_addr_is_intl.c new file mode 100644 index 000000000..d7530e50d --- /dev/null +++ b/test/address/mutt_addr_is_intl.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_is_intl() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_is_intl(void) +{ + // bool mutt_addr_is_intl(struct Address *a); +} diff --git a/test/address/mutt_addr_is_local.c b/test/address/mutt_addr_is_local.c new file mode 100644 index 000000000..c9f13f17e --- /dev/null +++ b/test/address/mutt_addr_is_local.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_is_local() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_is_local(void) +{ + // bool mutt_addr_is_local(struct Address *a); +} diff --git a/test/address/mutt_addr_mbox_to_udomain.c b/test/address/mutt_addr_mbox_to_udomain.c new file mode 100644 index 000000000..623d725b5 --- /dev/null +++ b/test/address/mutt_addr_mbox_to_udomain.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_mbox_to_udomain() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_mbox_to_udomain(void) +{ + // int mutt_addr_mbox_to_udomain(const char *mbox, char **user, char **domain); +} diff --git a/test/address/mutt_addr_new.c b/test/address/mutt_addr_new.c new file mode 100644 index 000000000..bd96ae5c4 --- /dev/null +++ b/test/address/mutt_addr_new.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_new() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_new(void) +{ + // struct Address *mutt_addr_new(void); +} diff --git a/test/address/mutt_addr_parse_list.c b/test/address/mutt_addr_parse_list.c new file mode 100644 index 000000000..e47e40509 --- /dev/null +++ b/test/address/mutt_addr_parse_list.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_parse_list() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_parse_list(void) +{ + // struct Address *mutt_addr_parse_list(struct Address *top, const char *s); +} diff --git a/test/address/mutt_addr_parse_list2.c b/test/address/mutt_addr_parse_list2.c new file mode 100644 index 000000000..73cff7901 --- /dev/null +++ b/test/address/mutt_addr_parse_list2.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_parse_list2() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_parse_list2(void) +{ + // struct Address *mutt_addr_parse_list2(struct Address *p, const char *s); +} diff --git a/test/address/mutt_addr_qualify.c b/test/address/mutt_addr_qualify.c new file mode 100644 index 000000000..4b32cb459 --- /dev/null +++ b/test/address/mutt_addr_qualify.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_qualify() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_qualify(void) +{ + // void mutt_addr_qualify(struct Address *addr, const char *host); +} diff --git a/test/address/mutt_addr_remove_from_list.c b/test/address/mutt_addr_remove_from_list.c new file mode 100644 index 000000000..1cff65951 --- /dev/null +++ b/test/address/mutt_addr_remove_from_list.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_remove_from_list() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_remove_from_list(void) +{ + // int mutt_addr_remove_from_list(struct Address **a, const char *mailbox); +} diff --git a/test/address/mutt_addr_remove_xrefs.c b/test/address/mutt_addr_remove_xrefs.c new file mode 100644 index 000000000..f2f177b94 --- /dev/null +++ b/test/address/mutt_addr_remove_xrefs.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_remove_xrefs() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_remove_xrefs(void) +{ + // struct Address *mutt_addr_remove_xrefs(struct Address *a, struct Address *b); +} diff --git a/test/address/mutt_addr_search.c b/test/address/mutt_addr_search.c new file mode 100644 index 000000000..cb6c2970f --- /dev/null +++ b/test/address/mutt_addr_search.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_search() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_search(void) +{ + // bool mutt_addr_search(struct Address *a, struct Address *lst); +} diff --git a/test/address/mutt_addr_set_intl.c b/test/address/mutt_addr_set_intl.c new file mode 100644 index 000000000..725410267 --- /dev/null +++ b/test/address/mutt_addr_set_intl.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_set_intl() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_set_intl(void) +{ + // void mutt_addr_set_intl(struct Address *a, char *intl_mailbox); +} diff --git a/test/address/mutt_addr_set_local.c b/test/address/mutt_addr_set_local.c new file mode 100644 index 000000000..9377aa618 --- /dev/null +++ b/test/address/mutt_addr_set_local.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_set_local() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_set_local(void) +{ + // void mutt_addr_set_local(struct Address *a, char *local_mailbox); +} diff --git a/test/address/mutt_addr_valid_msgid.c b/test/address/mutt_addr_valid_msgid.c new file mode 100644 index 000000000..ad420b87e --- /dev/null +++ b/test/address/mutt_addr_valid_msgid.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_valid_msgid() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_valid_msgid(void) +{ + // bool mutt_addr_valid_msgid(const char *msgid); +} diff --git a/test/address/mutt_addr_write.c b/test/address/mutt_addr_write.c new file mode 100644 index 000000000..d68535851 --- /dev/null +++ b/test/address/mutt_addr_write.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_write() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_write(void) +{ + // size_t mutt_addr_write(char *buf, size_t buflen, struct Address *addr, bool display); +} diff --git a/test/address/mutt_addr_write_single.c b/test/address/mutt_addr_write_single.c new file mode 100644 index 000000000..c7dc659e8 --- /dev/null +++ b/test/address/mutt_addr_write_single.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addr_write_single() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addr_write_single(void) +{ + // void mutt_addr_write_single(char *buf, size_t buflen, struct Address *addr, bool display); +} diff --git a/test/address/mutt_addrlist_to_intl.c b/test/address/mutt_addrlist_to_intl.c new file mode 100644 index 000000000..ff7acf5a7 --- /dev/null +++ b/test/address/mutt_addrlist_to_intl.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addrlist_to_intl() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addrlist_to_intl(void) +{ + // int mutt_addrlist_to_intl(struct Address *a, char **err); +} diff --git a/test/address/mutt_addrlist_to_local.c b/test/address/mutt_addrlist_to_local.c new file mode 100644 index 000000000..57a99a8ad --- /dev/null +++ b/test/address/mutt_addrlist_to_local.c @@ -0,0 +1,32 @@ +/** + * @file + * Test code for mutt_addrlist_to_local() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define TEST_NO_MAIN +#include "acutest.h" +#include "config.h" +#include "mutt/mutt.h" +#include "address/lib.h" + +void test_mutt_addrlist_to_local(void) +{ + // int mutt_addrlist_to_local(struct Address *a); +} -- 2.49.0