From: Richard Russon Date: Sun, 28 Apr 2019 13:13:46 +0000 (+0100) Subject: test: templates for rfc2047 functions X-Git-Tag: 2019-10-25~233^2~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4585e029d1c7d54ab1783d164ed8e2829e45630;p=neomutt test: templates for rfc2047 functions --- diff --git a/.gitignore b/.gitignore index 8d0f8dd97..ee4514f54 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ test/parse-test test/path-test test/pattern-test test/regex-test +test/rfc2047-test test/sha1-test test/signal-test test/string-test diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index b651d68a5..dde637f69 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -360,6 +360,14 @@ REGEX_OBJS = test/regex/main.o \ test/regex/mutt_replacelist_new.o \ test/regex/mutt_replacelist_remove.o +RFC2047_OBJS = test/rfc2047/main.o \ + test/rfc2047/rfc2047_decode_addrlist.o \ + test/rfc2047/rfc2047_decode.o \ + test/rfc2047/rfc2047_decode_envelope.o \ + test/rfc2047/rfc2047_encode_addrlist.o \ + test/rfc2047/rfc2047_encode_envelope.o \ + test/rfc2047/rfc2047_encode.o + SHA1_OBJS = test/sha1/main.o \ test/sha1/mutt_sha1_final.o \ test/sha1/mutt_sha1_init.o \ @@ -484,6 +492,8 @@ TEST_PATTERN = test/pattern-test$(EXEEXT) TEST_REGEX = test/regex-test$(EXEEXT) +TEST_RFC2047 = test/rfc2047-test$(EXEEXT) + TEST_SHA1 = test/sha1-test$(EXEEXT) TEST_SIGNAL = test/signal-test$(EXEEXT) @@ -491,7 +501,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_PARSE) $(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_RFC2047) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) @@ -520,6 +530,7 @@ test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) + $(TEST_RFC2047) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) @@ -611,6 +622,9 @@ $(TEST_PATTERN): $(PWD)/test/pattern $(PATTERN_OBJS) $(MUTTLIBS) $(TEST_REGEX): $(PWD)/test/regex $(REGEX_OBJS) $(MUTTLIBS) $(CC) -o $@ $(REGEX_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) +$(TEST_RFC2047): $(PWD)/test/rfc2047 $(RFC2047_OBJS) $(MUTTLIBS) + $(CC) -o $@ $(RFC2047_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) + $(TEST_SHA1): $(PWD)/test/sha1 $(SHA1_OBJS) $(MUTTLIBS) $(CC) -o $@ $(SHA1_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) @@ -704,6 +718,9 @@ $(PWD)/test/pattern: $(PWD)/test/regex: $(MKDIR_P) $(PWD)/test/regex +$(PWD)/test/rfc2047: + $(MKDIR_P) $(PWD)/test/rfc2047 + $(PWD)/test/sha1: $(MKDIR_P) $(PWD)/test/sha1 @@ -713,7 +730,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_PARSE) $(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_RFC2047) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) clean-test: $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \ @@ -745,6 +762,7 @@ clean-test: $(TEST_PATH) $(PATH_OBJS) $(PATH_OBJS:.o=.Po) \ $(TEST_PATTERN) $(PATTERN_OBJS) $(PATTERN_OBJS:.o=.Po) \ $(TEST_REGEX) $(REGEX_OBJS) $(REGEX_OBJS:.o=.Po) \ + $(TEST_RFC2047) $(RFC2047_OBJS) $(RFC2047_OBJS:.o=.Po) \ $(TEST_SHA1) $(SHA1_OBJS) $(SHA1_OBJS:.o=.Po) \ $(TEST_SIGNAL) $(SIGNAL_OBJS) $(SIGNAL_OBJS:.o=.Po) \ $(TEST_STRING) $(STRING_OBJS) $(STRING_OBJS:.o=.Po) @@ -839,6 +857,9 @@ PATTERN_DEPFILES = $(PATTERN_OBJS:.o=.Po) REGEX_DEPFILES = $(REGEX_OBJS:.o=.Po) -include $(REGEX_DEPFILES) +RFC2047_DEPFILES = $(RFC2047_OBJS:.o=.Po) +-include $(RFC2047_DEPFILES) + SHA1_DEPFILES = $(SHA1_OBJS:.o=.Po) -include $(SHA1_DEPFILES) diff --git a/test/rfc2047/main.c b/test/rfc2047/main.c new file mode 100644 index 000000000..295717650 --- /dev/null +++ b/test/rfc2047/main.c @@ -0,0 +1,49 @@ +/** + * @file + * Test code for rfc2047 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_rfc2047_decode) \ + NEOMUTT_TEST_ITEM(test_rfc2047_decode_addrlist) \ + NEOMUTT_TEST_ITEM(test_rfc2047_decode_envelope) \ + NEOMUTT_TEST_ITEM(test_rfc2047_encode) \ + NEOMUTT_TEST_ITEM(test_rfc2047_encode_addrlist) \ + NEOMUTT_TEST_ITEM(test_rfc2047_encode_envelope) + +/****************************************************************************** + * 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/rfc2047/rfc2047_decode.c b/test/rfc2047/rfc2047_decode.c new file mode 100644 index 000000000..2b25b5b95 --- /dev/null +++ b/test/rfc2047/rfc2047_decode.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2047_decode() + * + * @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_rfc2047_decode(void) +{ + // void rfc2047_decode(char **pd); +} diff --git a/test/rfc2047/rfc2047_decode_addrlist.c b/test/rfc2047/rfc2047_decode_addrlist.c new file mode 100644 index 000000000..ad0f1a12f --- /dev/null +++ b/test/rfc2047/rfc2047_decode_addrlist.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2047_decode_addrlist() + * + * @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_rfc2047_decode_addrlist(void) +{ + // void rfc2047_decode_addrlist(struct Address *a); +} diff --git a/test/rfc2047/rfc2047_decode_envelope.c b/test/rfc2047/rfc2047_decode_envelope.c new file mode 100644 index 000000000..163813238 --- /dev/null +++ b/test/rfc2047/rfc2047_decode_envelope.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2047_decode_envelope() + * + * @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_rfc2047_decode_envelope(void) +{ + // void rfc2047_decode_envelope(struct Envelope *env); +} diff --git a/test/rfc2047/rfc2047_encode.c b/test/rfc2047/rfc2047_encode.c new file mode 100644 index 000000000..404e38f58 --- /dev/null +++ b/test/rfc2047/rfc2047_encode.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2047_encode() + * + * @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_rfc2047_encode(void) +{ + // void rfc2047_encode(char **pd, const char *specials, int col, const char *charsets); +} diff --git a/test/rfc2047/rfc2047_encode_addrlist.c b/test/rfc2047/rfc2047_encode_addrlist.c new file mode 100644 index 000000000..cdf5480e4 --- /dev/null +++ b/test/rfc2047/rfc2047_encode_addrlist.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2047_encode_addrlist() + * + * @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_rfc2047_encode_addrlist(void) +{ + // void rfc2047_encode_addrlist(struct Address *addr, const char *tag); +} diff --git a/test/rfc2047/rfc2047_encode_envelope.c b/test/rfc2047/rfc2047_encode_envelope.c new file mode 100644 index 000000000..afe87f006 --- /dev/null +++ b/test/rfc2047/rfc2047_encode_envelope.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2047_encode_envelope() + * + * @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_rfc2047_encode_envelope(void) +{ + // void rfc2047_encode_envelope(struct Envelope *env); +}