From 24df42909081df4a3b3bceb5bd21a92eb50e2264 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sun, 28 Apr 2019 14:13:46 +0100 Subject: [PATCH] test: templates for parse functions --- .gitignore | 1 + test/Makefile.autosetup | 34 ++++++++++++++- test/parse/main.c | 58 ++++++++++++++++++++++++++ test/parse/mutt_auto_subscribe.c | 33 +++++++++++++++ test/parse/mutt_check_encoding.c | 33 +++++++++++++++ test/parse/mutt_check_mime_type.c | 33 +++++++++++++++ test/parse/mutt_extract_message_id.c | 33 +++++++++++++++ test/parse/mutt_is_message_type.c | 33 +++++++++++++++ test/parse/mutt_matches_ignore.c | 33 +++++++++++++++ test/parse/mutt_parse_content_type.c | 33 +++++++++++++++ test/parse/mutt_parse_mailto.c | 33 +++++++++++++++ test/parse/mutt_parse_multipart.c | 33 +++++++++++++++ test/parse/mutt_parse_part.c | 33 +++++++++++++++ test/parse/mutt_read_mime_header.c | 33 +++++++++++++++ test/parse/mutt_rfc822_parse_line.c | 33 +++++++++++++++ test/parse/mutt_rfc822_parse_message.c | 33 +++++++++++++++ test/parse/mutt_rfc822_read_header.c | 33 +++++++++++++++ test/parse/mutt_rfc822_read_line.c | 33 +++++++++++++++ 18 files changed, 586 insertions(+), 2 deletions(-) create mode 100644 test/parse/main.c create mode 100644 test/parse/mutt_auto_subscribe.c create mode 100644 test/parse/mutt_check_encoding.c create mode 100644 test/parse/mutt_check_mime_type.c create mode 100644 test/parse/mutt_extract_message_id.c create mode 100644 test/parse/mutt_is_message_type.c create mode 100644 test/parse/mutt_matches_ignore.c create mode 100644 test/parse/mutt_parse_content_type.c create mode 100644 test/parse/mutt_parse_mailto.c create mode 100644 test/parse/mutt_parse_multipart.c create mode 100644 test/parse/mutt_parse_part.c create mode 100644 test/parse/mutt_read_mime_header.c create mode 100644 test/parse/mutt_rfc822_parse_line.c create mode 100644 test/parse/mutt_rfc822_parse_message.c create mode 100644 test/parse/mutt_rfc822_read_header.c create mode 100644 test/parse/mutt_rfc822_read_line.c diff --git a/.gitignore b/.gitignore index 14e83ba94..8d0f8dd97 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ test/md5-test test/memory-test test/neomutt-test test/parameter-test +test/parse-test test/path-test test/pattern-test test/regex-test diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index f664e67ce..b651d68a5 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -304,6 +304,23 @@ PARAMETER_OBJS = test/parameter/main.o \ test/parameter/mutt_param_set.o \ test/parameter/mutt_param_free.o +PARSE_OBJS = test/parse/main.o \ + test/parse/mutt_check_encoding.o \ + test/parse/mutt_matches_ignore.o \ + test/parse/mutt_parse_mailto.o \ + test/parse/mutt_auto_subscribe.o \ + test/parse/mutt_rfc822_parse_line.o \ + test/parse/mutt_rfc822_parse_message.o \ + test/parse/mutt_is_message_type.o \ + test/parse/mutt_parse_multipart.o \ + test/parse/mutt_check_mime_type.o \ + test/parse/mutt_read_mime_header.o \ + test/parse/mutt_parse_part.o \ + test/parse/mutt_rfc822_read_line.o \ + test/parse/mutt_parse_content_type.o \ + test/parse/mutt_rfc822_read_header.o \ + test/parse/mutt_extract_message_id.o + PATH_OBJS = test/path/main.o \ test/path/mutt_path_abbr_folder.o \ test/path/mutt_path_basename.o \ @@ -459,6 +476,8 @@ TEST_MEMORY = test/memory-test$(EXEEXT) TEST_PARAMETER = test/parameter-test$(EXEEXT) +TEST_PARSE = test/parse-test$(EXEEXT) + TEST_PATH = test/path-test$(EXEEXT) TEST_PATTERN = test/pattern-test$(EXEEXT) @@ -472,7 +491,7 @@ TEST_SIGNAL = test/signal-test$(EXEEXT) TEST_STRING = test/string-test$(EXEEXT) .PHONY: test -test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(TEST_EMAIL) $(TEST_ENVELOPE) $(TEST_ENVLIST) $(TEST_FILE) $(TEST_FROM) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PARAMETER) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) +test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(TEST_EMAIL) $(TEST_ENVELOPE) $(TEST_ENVLIST) $(TEST_FILE) $(TEST_FROM) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PARAMETER) $(TEST_PARSE) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) @@ -497,6 +516,7 @@ test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PARAMETER) + $(TEST_PARSE) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) @@ -579,6 +599,9 @@ $(TEST_MEMORY): $(PWD)/test/memory $(MEMORY_OBJS) $(MUTTLIBS) $(TEST_PARAMETER): $(PWD)/test/parameter $(PARAMETER_OBJS) $(MUTTLIBS) $(CC) -o $@ $(PARAMETER_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) +$(TEST_PARSE): $(PWD)/test/parse $(PARSE_OBJS) $(MUTTLIBS) + $(CC) -o $@ $(PARSE_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) + $(TEST_PATH): $(PWD)/test/path $(PATH_OBJS) $(MUTTLIBS) $(CC) -o $@ $(PATH_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) @@ -669,6 +692,9 @@ $(PWD)/test/memory: $(PWD)/test/parameter: $(MKDIR_P) $(PWD)/test/parameter +$(PWD)/test/parse: + $(MKDIR_P) $(PWD)/test/parse + $(PWD)/test/path: $(MKDIR_P) $(PWD)/test/path @@ -687,7 +713,7 @@ $(PWD)/test/signal: $(PWD)/test/string: $(MKDIR_P) $(PWD)/test/string -all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(TEST_EMAIL) $(TEST_ENVELOPE) $(TEST_ENVLIST) $(TEST_FILE) $(TEST_FROM) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PARAMETER) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) +all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(TEST_EMAIL) $(TEST_ENVELOPE) $(TEST_ENVLIST) $(TEST_FILE) $(TEST_FROM) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PARAMETER) $(TEST_PARSE) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) clean-test: $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \ @@ -715,6 +741,7 @@ clean-test: $(TEST_MD5) $(MD5_OBJS) $(MD5_OBJS:.o=.Po) \ $(TEST_MEMORY) $(MEMORY_OBJS) $(MEMORY_OBJS:.o=.Po) \ $(TEST_PARAMETER) $(PARAMETER_OBJS) $(PARAMETER_OBJS:.o=.Po) \ + $(TEST_PARSE) $(PARSE_OBJS) $(PARSE_OBJS:.o=.Po) \ $(TEST_PATH) $(PATH_OBJS) $(PATH_OBJS:.o=.Po) \ $(TEST_PATTERN) $(PATTERN_OBJS) $(PATTERN_OBJS:.o=.Po) \ $(TEST_REGEX) $(REGEX_OBJS) $(REGEX_OBJS:.o=.Po) \ @@ -800,6 +827,9 @@ MEMORY_DEPFILES = $(MEMORY_OBJS:.o=.Po) PARAMETER_DEPFILES = $(PARAMETER_OBJS:.o=.Po) -include $(PARAMETER_DEPFILES) +PARSE_DEPFILES = $(PARSE_OBJS:.o=.Po) +-include $(PARSE_DEPFILES) + PATH_DEPFILES = $(PATH_OBJS:.o=.Po) -include $(PATH_DEPFILES) diff --git a/test/parse/main.c b/test/parse/main.c new file mode 100644 index 000000000..b73e5ddf5 --- /dev/null +++ b/test/parse/main.c @@ -0,0 +1,58 @@ +/** + * @file + * Test code for parse 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_auto_subscribe) \ + NEOMUTT_TEST_ITEM(test_mutt_check_encoding) \ + NEOMUTT_TEST_ITEM(test_mutt_check_mime_type) \ + NEOMUTT_TEST_ITEM(test_mutt_extract_message_id) \ + NEOMUTT_TEST_ITEM(test_mutt_is_message_type) \ + NEOMUTT_TEST_ITEM(test_mutt_matches_ignore) \ + NEOMUTT_TEST_ITEM(test_mutt_parse_content_type) \ + NEOMUTT_TEST_ITEM(test_mutt_parse_mailto) \ + NEOMUTT_TEST_ITEM(test_mutt_parse_multipart) \ + NEOMUTT_TEST_ITEM(test_mutt_parse_part) \ + NEOMUTT_TEST_ITEM(test_mutt_read_mime_header) \ + NEOMUTT_TEST_ITEM(test_mutt_rfc822_parse_line) \ + NEOMUTT_TEST_ITEM(test_mutt_rfc822_parse_message) \ + NEOMUTT_TEST_ITEM(test_mutt_rfc822_read_header) \ + NEOMUTT_TEST_ITEM(test_mutt_rfc822_read_line) + +/****************************************************************************** + * 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/parse/mutt_auto_subscribe.c b/test/parse/mutt_auto_subscribe.c new file mode 100644 index 000000000..296f9c0a1 --- /dev/null +++ b/test/parse/mutt_auto_subscribe.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_auto_subscribe() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_auto_subscribe(void) +{ + // void mutt_auto_subscribe(const char *mailto); +} diff --git a/test/parse/mutt_check_encoding.c b/test/parse/mutt_check_encoding.c new file mode 100644 index 000000000..e02a972af --- /dev/null +++ b/test/parse/mutt_check_encoding.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_check_encoding() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_check_encoding(void) +{ + // int mutt_check_encoding(const char *c); +} diff --git a/test/parse/mutt_check_mime_type.c b/test/parse/mutt_check_mime_type.c new file mode 100644 index 000000000..925569ad0 --- /dev/null +++ b/test/parse/mutt_check_mime_type.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_check_mime_type() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_check_mime_type(void) +{ + // int mutt_check_mime_type(const char *s); +} diff --git a/test/parse/mutt_extract_message_id.c b/test/parse/mutt_extract_message_id.c new file mode 100644 index 000000000..0f244ac4d --- /dev/null +++ b/test/parse/mutt_extract_message_id.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_extract_message_id() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_extract_message_id(void) +{ + // char *mutt_extract_message_id(const char *s, const char **saveptr); +} diff --git a/test/parse/mutt_is_message_type.c b/test/parse/mutt_is_message_type.c new file mode 100644 index 000000000..5271d1c40 --- /dev/null +++ b/test/parse/mutt_is_message_type.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_is_message_type() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_is_message_type(void) +{ + // bool mutt_is_message_type(int type, const char *subtype); +} diff --git a/test/parse/mutt_matches_ignore.c b/test/parse/mutt_matches_ignore.c new file mode 100644 index 000000000..dcf63cfac --- /dev/null +++ b/test/parse/mutt_matches_ignore.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_matches_ignore() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_matches_ignore(void) +{ + // bool mutt_matches_ignore(const char *s); +} diff --git a/test/parse/mutt_parse_content_type.c b/test/parse/mutt_parse_content_type.c new file mode 100644 index 000000000..c675b332c --- /dev/null +++ b/test/parse/mutt_parse_content_type.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_parse_content_type() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_parse_content_type(void) +{ + // void mutt_parse_content_type(const char *s, struct Body *ct); +} diff --git a/test/parse/mutt_parse_mailto.c b/test/parse/mutt_parse_mailto.c new file mode 100644 index 000000000..44b534afb --- /dev/null +++ b/test/parse/mutt_parse_mailto.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_parse_mailto() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_parse_mailto(void) +{ + // int mutt_parse_mailto(struct Envelope *e, char **body, const char *src); +} diff --git a/test/parse/mutt_parse_multipart.c b/test/parse/mutt_parse_multipart.c new file mode 100644 index 000000000..5dceffbcf --- /dev/null +++ b/test/parse/mutt_parse_multipart.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_parse_multipart() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_parse_multipart(void) +{ + // struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, off_t end_off, bool digest); +} diff --git a/test/parse/mutt_parse_part.c b/test/parse/mutt_parse_part.c new file mode 100644 index 000000000..4941208d0 --- /dev/null +++ b/test/parse/mutt_parse_part.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_parse_part() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_parse_part(void) +{ + // void mutt_parse_part(FILE *fp, struct Body *b); +} diff --git a/test/parse/mutt_read_mime_header.c b/test/parse/mutt_read_mime_header.c new file mode 100644 index 000000000..8c1f30650 --- /dev/null +++ b/test/parse/mutt_read_mime_header.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_read_mime_header() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_read_mime_header(void) +{ + // struct Body *mutt_read_mime_header(FILE *fp, bool digest); +} diff --git a/test/parse/mutt_rfc822_parse_line.c b/test/parse/mutt_rfc822_parse_line.c new file mode 100644 index 000000000..d47084156 --- /dev/null +++ b/test/parse/mutt_rfc822_parse_line.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_rfc822_parse_line() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_rfc822_parse_line(void) +{ + // int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, char *p, bool user_hdrs, bool weed, bool do_2047); +} diff --git a/test/parse/mutt_rfc822_parse_message.c b/test/parse/mutt_rfc822_parse_message.c new file mode 100644 index 000000000..3b6b6ae0a --- /dev/null +++ b/test/parse/mutt_rfc822_parse_message.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_rfc822_parse_message() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_rfc822_parse_message(void) +{ + // struct Body *mutt_rfc822_parse_message(FILE *fp, struct Body *parent); +} diff --git a/test/parse/mutt_rfc822_read_header.c b/test/parse/mutt_rfc822_read_header.c new file mode 100644 index 000000000..ed744990a --- /dev/null +++ b/test/parse/mutt_rfc822_read_header.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_rfc822_read_header() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_rfc822_read_header(void) +{ + // struct Envelope *mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed); +} diff --git a/test/parse/mutt_rfc822_read_line.c b/test/parse/mutt_rfc822_read_line.c new file mode 100644 index 000000000..8bdb5a521 --- /dev/null +++ b/test/parse/mutt_rfc822_read_line.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for mutt_rfc822_read_line() + * + * @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 "email/lib.h" +#include "address/lib.h" + +void test_mutt_rfc822_read_line(void) +{ + // char *mutt_rfc822_read_line(FILE *fp, char *line, size_t *linelen); +} -- 2.40.0