test/mapping-test
test/mbyte-test
test/md5-test
+test/memory-test
test/neomutt-test
test/path-test
test/pattern-test
test/md5/mutt_md5_process.o \
test/md5/mutt_md5_toascii.o
+MEMORY_OBJS = test/memory/main.o \
+ test/memory/mutt_mem_calloc.o \
+ test/memory/mutt_mem_free.o \
+ test/memory/mutt_mem_malloc.o \
+ test/memory/mutt_mem_realloc.o
+
PATH_OBJS = test/path/main.o \
test/path/mutt_path_abbr_folder.o \
test/path/mutt_path_basename.o \
TEST_MD5 = test/md5-test$(EXEEXT)
+TEST_MEMORY = test/memory-test$(EXEEXT)
+
TEST_PATH = test/path-test$(EXEEXT)
TEST_PATTERN = test/pattern-test$(EXEEXT)
TEST_STRING = test/string-test$(EXEEXT)
.PHONY: test
-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(TEST_ENVLIST) $(TEST_FILE) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING)
+test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(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_STRING)
$(TEST_BINARY)
$(TEST_ADDRESS)
$(TEST_BASE64)
$(TEST_MAPPING)
$(TEST_MBYTE)
$(TEST_MD5)
+ $(TEST_MEMORY)
$(TEST_PATH)
$(TEST_PATTERN)
$(TEST_STRING)
$(TEST_MD5): $(PWD)/test/md5 $(MD5_OBJS) $(MUTTLIBS)
$(CC) -o $@ $(MD5_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+$(TEST_MEMORY): $(PWD)/test/memory $(MEMORY_OBJS) $(MUTTLIBS)
+ $(CC) -o $@ $(MEMORY_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+
$(TEST_PATH): $(PWD)/test/path $(PATH_OBJS) $(MUTTLIBS)
$(CC) -o $@ $(PATH_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
$(PWD)/test/md5:
$(MKDIR_P) $(PWD)/test/md5
+$(PWD)/test/memory:
+ $(MKDIR_P) $(PWD)/test/memory
+
$(PWD)/test/path:
$(MKDIR_P) $(PWD)/test/path
$(PWD)/test/string:
$(MKDIR_P) $(PWD)/test/string
-all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(TEST_ENVLIST) $(TEST_FILE) $(TEST_GROUP) $(TEST_HASH) $(TEST_HISTORY) $(TEST_IDNA) $(TEST_LIST) $(TEST_LOGGING) $(TEST_MAPPING) $(TEST_MBYTE) $(TEST_MD5) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING)
+all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CHARSET) $(TEST_CONFIG) $(TEST_DATE) $(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_STRING)
clean-test:
$(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \
$(TEST_MAPPING) $(MAPPING_OBJS) $(MAPPING_OBJS:.o=.Po) \
$(TEST_MBYTE) $(MBYTE_OBJS) $(MBYTE_OBJS:.o=.Po) \
$(TEST_MD5) $(MD5_OBJS) $(MD5_OBJS:.o=.Po) \
+ $(TEST_MEMORY) $(MEMORY_OBJS) $(MEMORY_OBJS:.o=.Po) \
$(TEST_PATH) $(PATH_OBJS) $(PATH_OBJS:.o=.Po) \
$(TEST_PATTERN) $(PATTERN_OBJS) $(PATTERN_OBJS:.o=.Po) \
$(TEST_STRING) $(STRING_OBJS) $(STRING_OBJS:.o=.Po)
MD5_DEPFILES = $(MD5_OBJS:.o=.Po)
-include $(MD5_DEPFILES)
+MEMORY_DEPFILES = $(MEMORY_OBJS:.o=.Po)
+-include $(MEMORY_DEPFILES)
+
PATH_DEPFILES = $(PATH_OBJS:.o=.Po)
-include $(PATH_DEPFILES)
--- /dev/null
+/**
+ * @file
+ * Test code for memory 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_mem_calloc) \
+ NEOMUTT_TEST_ITEM(test_mutt_mem_free) \
+ NEOMUTT_TEST_ITEM(test_mutt_mem_malloc) \
+ NEOMUTT_TEST_ITEM(test_mutt_mem_realloc)
+
+/******************************************************************************
+ * 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_mem_calloc()
+ *
+ * @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"
+
+void test_mutt_mem_calloc(void)
+{
+ // void *mutt_mem_calloc(size_t nmemb, size_t size);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for mutt_mem_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"
+
+void test_mutt_mem_free(void)
+{
+ // void mutt_mem_free(void *ptr);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for mutt_mem_malloc()
+ *
+ * @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"
+
+void test_mutt_mem_malloc(void)
+{
+ // void *mutt_mem_malloc(size_t size);
+}
--- /dev/null
+/**
+ * @file
+ * Test code for mutt_mem_realloc()
+ *
+ * @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"
+
+void test_mutt_mem_realloc(void)
+{
+ // void mutt_mem_realloc(void *ptr, size_t size);
+}