From: Richard Russon Date: Sun, 28 Apr 2019 13:13:46 +0000 (+0100) Subject: test: templates for rfc2231 functions X-Git-Tag: 2019-10-25~233^2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65a8b0321a124aef13cce5d0275040c9728b92ac;p=neomutt test: templates for rfc2231 functions --- diff --git a/.gitignore b/.gitignore index ee4514f54..a4f844cae 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ test/path-test test/pattern-test test/regex-test test/rfc2047-test +test/rfc2231-test test/sha1-test test/signal-test test/string-test diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index dde637f69..1c20af71f 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -368,6 +368,10 @@ RFC2047_OBJS = test/rfc2047/main.o \ test/rfc2047/rfc2047_encode_envelope.o \ test/rfc2047/rfc2047_encode.o +RFC2231_OBJS = test/rfc2231/main.o \ + test/rfc2231/rfc2231_encode_string.o \ + test/rfc2231/rfc2231_decode_parameters.o + SHA1_OBJS = test/sha1/main.o \ test/sha1/mutt_sha1_final.o \ test/sha1/mutt_sha1_init.o \ @@ -494,6 +498,8 @@ TEST_REGEX = test/regex-test$(EXEEXT) TEST_RFC2047 = test/rfc2047-test$(EXEEXT) +TEST_RFC2231 = test/rfc2231-test$(EXEEXT) + TEST_SHA1 = test/sha1-test$(EXEEXT) TEST_SIGNAL = test/signal-test$(EXEEXT) @@ -501,7 +507,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_RFC2047) $(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_RFC2231) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) @@ -531,6 +537,7 @@ test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_RFC2047) + $(TEST_RFC2231) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) @@ -625,6 +632,9 @@ $(TEST_REGEX): $(PWD)/test/regex $(REGEX_OBJS) $(MUTTLIBS) $(TEST_RFC2047): $(PWD)/test/rfc2047 $(RFC2047_OBJS) $(MUTTLIBS) $(CC) -o $@ $(RFC2047_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) +$(TEST_RFC2231): $(PWD)/test/rfc2231 $(RFC2231_OBJS) $(MUTTLIBS) + $(CC) -o $@ $(RFC2231_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) + $(TEST_SHA1): $(PWD)/test/sha1 $(SHA1_OBJS) $(MUTTLIBS) $(CC) -o $@ $(SHA1_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS) @@ -721,6 +731,9 @@ $(PWD)/test/regex: $(PWD)/test/rfc2047: $(MKDIR_P) $(PWD)/test/rfc2047 +$(PWD)/test/rfc2231: + $(MKDIR_P) $(PWD)/test/rfc2231 + $(PWD)/test/sha1: $(MKDIR_P) $(PWD)/test/sha1 @@ -730,7 +743,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_RFC2047) $(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_RFC2231) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) clean-test: $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \ @@ -763,6 +776,7 @@ clean-test: $(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_RFC2231) $(RFC2231_OBJS) $(RFC2231_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) @@ -860,6 +874,9 @@ REGEX_DEPFILES = $(REGEX_OBJS:.o=.Po) RFC2047_DEPFILES = $(RFC2047_OBJS:.o=.Po) -include $(RFC2047_DEPFILES) +RFC2231_DEPFILES = $(RFC2231_OBJS:.o=.Po) +-include $(RFC2231_DEPFILES) + SHA1_DEPFILES = $(SHA1_OBJS:.o=.Po) -include $(SHA1_DEPFILES) diff --git a/test/rfc2231/main.c b/test/rfc2231/main.c new file mode 100644 index 000000000..05ef63e42 --- /dev/null +++ b/test/rfc2231/main.c @@ -0,0 +1,45 @@ +/** + * @file + * Test code for rfc2231 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_rfc2231_decode_parameters) \ + NEOMUTT_TEST_ITEM(test_rfc2231_encode_string) + +/****************************************************************************** + * 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/rfc2231/rfc2231_decode_parameters.c b/test/rfc2231/rfc2231_decode_parameters.c new file mode 100644 index 000000000..47655958c --- /dev/null +++ b/test/rfc2231/rfc2231_decode_parameters.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2231_decode_parameters() + * + * @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_rfc2231_decode_parameters(void) +{ + // void rfc2231_decode_parameters(struct ParameterList *p); +} diff --git a/test/rfc2231/rfc2231_encode_string.c b/test/rfc2231/rfc2231_encode_string.c new file mode 100644 index 000000000..8bcb42d93 --- /dev/null +++ b/test/rfc2231/rfc2231_encode_string.c @@ -0,0 +1,33 @@ +/** + * @file + * Test code for rfc2231_encode_string() + * + * @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_rfc2231_encode_string(void) +{ + // int rfc2231_encode_string(char **pd); +}