]> granicus.if.org Git - neomutt/commitdiff
test: templates for envelope 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/envelope/main.c [new file with mode: 0644]
test/envelope/mutt_env_cmp_strict.c [new file with mode: 0644]
test/envelope/mutt_env_free.c [new file with mode: 0644]
test/envelope/mutt_env_merge.c [new file with mode: 0644]
test/envelope/mutt_env_new.c [new file with mode: 0644]
test/envelope/mutt_env_to_intl.c [new file with mode: 0644]
test/envelope/mutt_env_to_local.c [new file with mode: 0644]

index 9a6c82affe6d231bd24751bb5d5b5f841ed4c351..1f64eaaa5c474cd4d7c0ad045541527d5ee54ca9 100644 (file)
@@ -19,6 +19,7 @@ test/charset-test
 test/config-test
 test/date-test
 test/email-test
+test/envelope-test
 test/envlist-test
 test/file-test
 test/group-test
index bd1cdd97e32a79c65d4cc8f72dc09544450c24d8..1c5cd57e418f81f7dec12e8ca277d5147c1f4659 100644 (file)
@@ -129,6 +129,14 @@ EMAIL_OBJS = test/email/main.o \
                  test/email/mutt_email_size.o \
                  test/email/mutt_email_cmp_strict.o
 
+ENVELOPE_OBJS  = test/envelope/main.o \
+                 test/envelope/mutt_env_free.o \
+                 test/envelope/mutt_env_cmp_strict.o \
+                 test/envelope/mutt_env_to_local.o \
+                 test/envelope/mutt_env_merge.o \
+                 test/envelope/mutt_env_new.o \
+                 test/envelope/mutt_env_to_intl.o
+
 ENVLIST_OBJS   = test/envlist/main.o \
                  test/envlist/mutt_envlist_free.o \
                  test/envlist/mutt_envlist_getlist.o \
@@ -409,6 +417,8 @@ TEST_DATE = test/date-test$(EXEEXT)
 
 TEST_EMAIL = test/email-test$(EXEEXT)
 
+TEST_ENVELOPE = test/envelope-test$(EXEEXT)
+
 TEST_ENVLIST = test/envlist-test$(EXEEXT)
 
 TEST_FILE = test/file-test$(EXEEXT)
@@ -446,7 +456,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_ENVLIST) $(TEST_FILE) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(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_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING)
        $(TEST_BINARY)
        $(TEST_ADDRESS)
        $(TEST_ATTACH)
@@ -456,6 +466,7 @@ test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_ATTACH) $(TEST_BASE64) $(TEST_BODY)
        $(TEST_CONFIG)
        $(TEST_DATE)
        $(TEST_EMAIL)
+       $(TEST_ENVELOPE)
        $(TEST_ENVLIST)
        $(TEST_FILE)
        $(TEST_GROUP)
@@ -505,6 +516,9 @@ $(TEST_DATE): $(PWD)/test/date $(DATE_OBJS) $(MUTTLIBS)
 $(TEST_EMAIL): $(PWD)/test/email $(EMAIL_OBJS) $(MUTTLIBS)
        $(CC) -o $@ $(EMAIL_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
 
+$(TEST_ENVELOPE): $(PWD)/test/envelope $(ENVELOPE_OBJS) $(MUTTLIBS)
+       $(CC) -o $@ $(ENVELOPE_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+
 $(TEST_ENVLIST): $(PWD)/test/envlist $(ENVLIST_OBJS) $(MUTTLIBS)
        $(CC) -o $@ $(ENVLIST_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
 
@@ -586,6 +600,9 @@ $(PWD)/test/date:
 $(PWD)/test/email:
        $(MKDIR_P) $(PWD)/test/email
 
+$(PWD)/test/envelope:
+       $(MKDIR_P) $(PWD)/test/envelope
+
 $(PWD)/test/envlist:
        $(MKDIR_P) $(PWD)/test/envlist
 
@@ -640,7 +657,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_ENVLIST) $(TEST_FILE) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(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_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_MEMORY) $(TEST_PATH) $(TEST_PATTERN) $(TEST_REGEX) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING)
 
 clean-test:
        $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \
@@ -653,6 +670,7 @@ clean-test:
              $(TEST_CONFIG) $(CONFIG_OBJS) $(CONFIG_OBJS:.o=.Po) \
              $(TEST_DATE) $(DATE_OBJS) $(DATE_OBJS:.o=.Po) \
              $(TEST_EMAIL) $(EMAIL_OBJS) $(EMAIL_OBJS:.o=.Po) \
+             $(TEST_ENVELOPE) $(ENVELOPE_OBJS) $(ENVELOPE_OBJS:.o=.Po) \
              $(TEST_ENVLIST) $(ENVLIST_OBJS) $(ENVLIST_OBJS:.o=.Po) \
              $(TEST_FILE) $(FILE_OBJS) $(FILE_OBJS:.o=.Po) \
              $(TEST_GROUP) $(GROUP_OBJS) $(GROUP_OBJS:.o=.Po) \
@@ -705,6 +723,9 @@ DATE_DEPFILES = $(DATE_OBJS:.o=.Po)
 EMAIL_DEPFILES = $(EMAIL_OBJS:.o=.Po)
 -include $(EMAIL_DEPFILES)
 
+ENVELOPE_DEPFILES = $(ENVELOPE_OBJS:.o=.Po)
+-include $(ENVELOPE_DEPFILES)
+
 ENVLIST_DEPFILES = $(ENVLIST_OBJS:.o=.Po)
 -include $(ENVLIST_DEPFILES)
 
diff --git a/test/envelope/main.c b/test/envelope/main.c
new file mode 100644 (file)
index 0000000..e77ba00
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * @file
+ * Test code for envelope 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_mutt_env_cmp_strict)                                  \
+  NEOMUTT_TEST_ITEM(test_mutt_env_free)                                        \
+  NEOMUTT_TEST_ITEM(test_mutt_env_merge)                                       \
+  NEOMUTT_TEST_ITEM(test_mutt_env_new)                                         \
+  NEOMUTT_TEST_ITEM(test_mutt_env_to_intl)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_env_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/envelope/mutt_env_cmp_strict.c b/test/envelope/mutt_env_cmp_strict.c
new file mode 100644 (file)
index 0000000..dc0ce37
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for mutt_env_cmp_strict()
+ *
+ * @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_mutt_env_cmp_strict(void)
+{
+  // bool mutt_env_cmp_strict(const struct Envelope *e1, const struct Envelope *e2);
+}
diff --git a/test/envelope/mutt_env_free.c b/test/envelope/mutt_env_free.c
new file mode 100644 (file)
index 0000000..390c2f6
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for mutt_env_free()
+ *
+ * @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_mutt_env_free(void)
+{
+  // void mutt_env_free(struct Envelope **p);
+}
diff --git a/test/envelope/mutt_env_merge.c b/test/envelope/mutt_env_merge.c
new file mode 100644 (file)
index 0000000..c342fa3
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for mutt_env_merge()
+ *
+ * @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_mutt_env_merge(void)
+{
+  // void mutt_env_merge(struct Envelope *base, struct Envelope **extra);
+}
diff --git a/test/envelope/mutt_env_new.c b/test/envelope/mutt_env_new.c
new file mode 100644 (file)
index 0000000..3b8baf9
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for mutt_env_new()
+ *
+ * @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_mutt_env_new(void)
+{
+  // struct Envelope *mutt_env_new(void);
+}
diff --git a/test/envelope/mutt_env_to_intl.c b/test/envelope/mutt_env_to_intl.c
new file mode 100644 (file)
index 0000000..69d5d40
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for mutt_env_to_intl()
+ *
+ * @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_mutt_env_to_intl(void)
+{
+  // int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err);
+}
diff --git a/test/envelope/mutt_env_to_local.c b/test/envelope/mutt_env_to_local.c
new file mode 100644 (file)
index 0000000..030bc95
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * Test code for mutt_env_to_local()
+ *
+ * @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_mutt_env_to_local(void)
+{
+  // void mutt_env_to_local(struct Envelope *env);
+}