]> granicus.if.org Git - neomutt/commitdiff
test: templates for rfc2047 functions
authorRichard Russon <rich@flatcap.org>
Sun, 28 Apr 2019 13:13:46 +0000 (14:13 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 30 Apr 2019 10:22:04 +0000 (11:22 +0100)
.gitignore
test/Makefile.autosetup
test/rfc2047/main.c [new file with mode: 0644]
test/rfc2047/rfc2047_decode.c [new file with mode: 0644]
test/rfc2047/rfc2047_decode_addrlist.c [new file with mode: 0644]
test/rfc2047/rfc2047_decode_envelope.c [new file with mode: 0644]
test/rfc2047/rfc2047_encode.c [new file with mode: 0644]
test/rfc2047/rfc2047_encode_addrlist.c [new file with mode: 0644]
test/rfc2047/rfc2047_encode_envelope.c [new file with mode: 0644]

index 8d0f8dd97315f798a42b4f7eb056d3adb6362252..ee4514f54a3d0f1f2dedc919380d490d9a8b917d 100644 (file)
@@ -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
index b651d68a57c2f62f339b12f06bb20a4e06e5d7e1..dde637f694907b852b5013525484810cc8316767 100644 (file)
@@ -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 (file)
index 0000000..2957176
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * @file
+ * Test code for rfc2047 Operations
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 (file)
index 0000000..2b25b5b
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for rfc2047_decode()
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 (file)
index 0000000..ad0f1a1
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for rfc2047_decode_addrlist()
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 (file)
index 0000000..1638132
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for rfc2047_decode_envelope()
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 (file)
index 0000000..404e38f
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for rfc2047_encode()
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 (file)
index 0000000..cdf5480
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for rfc2047_encode_addrlist()
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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 (file)
index 0000000..afe87f0
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for rfc2047_encode_envelope()
+ *
+ * @authors
+ * Copyright (C) 2019 Richard Russon <rich@flatcap.org>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+#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);
+}