test/signal-test
test/string-test
test/tags-test
+test/thread-test
# Build products
*.o
test/tags/driver_tags_free.o \
test/tags/driver_tags_get_transformed_for.o
+THREAD_OBJS = test/thread/main.o \
+ test/thread/thread_hash_destructor.o \
+ test/thread/is_descendant.o \
+ test/thread/mutt_break_thread.o \
+ test/thread/unlink_message.o \
+ test/thread/clean_references.o \
+ test/thread/find_virtual.o \
+ test/thread/insert_message.o
+
CFLAGS += -I$(SRCDIR)/test
TEST_BINARY = test/neomutt-test$(EXEEXT)
TEST_TAGS = test/tags-test$(EXEEXT)
+TEST_THREAD = test/thread-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_RFC2231) $(TEST_SHA1) $(TEST_SIGNAL) $(TEST_STRING) $(TEST_TAGS)
+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_TAGS) $(TEST_THREAD)
$(TEST_BINARY)
$(TEST_ADDRESS)
$(TEST_ATTACH)
$(TEST_SIGNAL)
$(TEST_STRING)
$(TEST_TAGS)
+ $(TEST_THREAD)
$(TEST_BINARY): $(TEST_OBJS) $(MUTTLIBS)
$(CC) -o $@ $(TEST_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
$(TEST_TAGS): $(PWD)/test/tags $(TAGS_OBJS) $(MUTTLIBS)
$(CC) -o $@ $(TAGS_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+$(TEST_THREAD): $(PWD)/test/thread $(THREAD_OBJS) $(MUTTLIBS)
+ $(CC) -o $@ $(THREAD_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+
$(PWD)/test/address:
$(MKDIR_P) $(PWD)/test/address
$(PWD)/test/tags:
$(MKDIR_P) $(PWD)/test/tags
-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) $(TEST_TAGS)
+$(PWD)/test/thread:
+ $(MKDIR_P) $(PWD)/test/thread
+
+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) $(TEST_TAGS) $(TEST_THREAD)
clean-test:
$(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_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) \
- $(TEST_TAGS) $(TAGS_OBJS) $(TAGS_OBJS:.o=.Po)
+ $(TEST_TAGS) $(TAGS_OBJS) $(TAGS_OBJS:.o=.Po) \
+ $(TEST_THREAD) $(THREAD_OBJS) $(THREAD_OBJS:.o=.Po)
install-test:
uninstall-test:
TAGS_DEPFILES = $(TAGS_OBJS:.o=.Po)
-include $(TAGS_DEPFILES)
+THREAD_DEPFILES = $(THREAD_OBJS:.o=.Po)
+-include $(THREAD_DEPFILES)
+
# vim: set ts=8 noexpandtab:
--- /dev/null
+/**
+ * @file
+ * Test code for clean_references()
+ *
+ * @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_clean_references(void)
+{
+ // void clean_references(struct MuttThread *brk, struct MuttThread *cur);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for find_virtual()
+ *
+ * @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_find_virtual(void)
+{
+ // struct Email *find_virtual(struct MuttThread *cur, int reverse);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for insert_message()
+ *
+ * @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_insert_message(void)
+{
+ // void insert_message(struct MuttThread **new, struct MuttThread *newparent, struct MuttThread *cur);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for is_descendant()
+ *
+ * @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_is_descendant(void)
+{
+ // bool is_descendant(struct MuttThread *a, struct MuttThread *b);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for thread 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_clean_references) \
+ NEOMUTT_TEST_ITEM(test_find_virtual) \
+ NEOMUTT_TEST_ITEM(test_insert_message) \
+ NEOMUTT_TEST_ITEM(test_is_descendant) \
+ NEOMUTT_TEST_ITEM(test_mutt_break_thread) \
+ NEOMUTT_TEST_ITEM(test_thread_hash_destructor) \
+ NEOMUTT_TEST_ITEM(test_unlink_message)
+
+/******************************************************************************
+ * 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 }
+};
+
--- /dev/null
+/**
+ * @file
+ * Test code for mutt_break_thread()
+ *
+ * @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_break_thread(void)
+{
+ // void mutt_break_thread(struct Email *e);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for thread_hash_destructor()
+ *
+ * @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_thread_hash_destructor(void)
+{
+ // void thread_hash_destructor(int type, void *obj, intptr_t data);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for unlink_message()
+ *
+ * @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_unlink_message(void)
+{
+ // void unlink_message(struct MuttThread **old, struct MuttThread *cur);
+}