]> granicus.if.org Git - neomutt/commitdiff
test: templates for buffer functions
authorRichard Russon <rich@flatcap.org>
Sun, 28 Apr 2019 11:37:15 +0000 (12:37 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 30 Apr 2019 09:49:17 +0000 (10:49 +0100)
24 files changed:
.gitignore
test/Makefile.autosetup
test/buffer/main.c [new file with mode: 0644]
test/buffer/mutt_buffer_add_printf.c [new file with mode: 0644]
test/buffer/mutt_buffer_addch.c [new file with mode: 0644]
test/buffer/mutt_buffer_addstr.c [new file with mode: 0644]
test/buffer/mutt_buffer_addstr_n.c [new file with mode: 0644]
test/buffer/mutt_buffer_alloc.c [new file with mode: 0644]
test/buffer/mutt_buffer_concat_path.c [new file with mode: 0644]
test/buffer/mutt_buffer_fix_dptr.c [new file with mode: 0644]
test/buffer/mutt_buffer_free.c [new file with mode: 0644]
test/buffer/mutt_buffer_from.c [new file with mode: 0644]
test/buffer/mutt_buffer_increase_size.c [new file with mode: 0644]
test/buffer/mutt_buffer_init.c [new file with mode: 0644]
test/buffer/mutt_buffer_is_empty.c [new file with mode: 0644]
test/buffer/mutt_buffer_len.c [new file with mode: 0644]
test/buffer/mutt_buffer_new.c [new file with mode: 0644]
test/buffer/mutt_buffer_pool_free.c [new file with mode: 0644]
test/buffer/mutt_buffer_pool_get.c [new file with mode: 0644]
test/buffer/mutt_buffer_pool_release.c [new file with mode: 0644]
test/buffer/mutt_buffer_printf.c [new file with mode: 0644]
test/buffer/mutt_buffer_reset.c [new file with mode: 0644]
test/buffer/mutt_buffer_strcpy.c [new file with mode: 0644]
test/buffer/mutt_buffer_strcpy_n.c [new file with mode: 0644]

index 4c81b89e156129c225d1d2217cdba84629bde50e..aeb3d316e765a5043e2cdd1a3a634d700cc4d746 100644 (file)
@@ -12,6 +12,7 @@ neomutt
 pgpewrap
 test/address-test
 test/base64-test
+test/buffer-test
 test/config-test
 test/group-test
 test/idna-test
index 39b421f89896b9153dac8a817b36a14049fa9716..3584a0bc6c9f357b64053d1ed783fc6b30309b14 100644 (file)
@@ -41,6 +41,29 @@ BASE64_OBJS  = test/base64/main.o \
                  test/base64/mutt_b64_decode.o \
                  test/base64/mutt_b64_encode.o
 
+BUFFER_OBJS    = test/buffer/main.o \
+                 test/buffer/mutt_buffer_addch.o \
+                 test/buffer/mutt_buffer_add_printf.o \
+                 test/buffer/mutt_buffer_addstr.o \
+                 test/buffer/mutt_buffer_addstr_n.o \
+                 test/buffer/mutt_buffer_alloc.o \
+                 test/buffer/mutt_buffer_concat_path.o \
+                 test/buffer/mutt_buffer_fix_dptr.o \
+                 test/buffer/mutt_buffer_free.o \
+                 test/buffer/mutt_buffer_from.o \
+                 test/buffer/mutt_buffer_increase_size.o \
+                 test/buffer/mutt_buffer_init.o \
+                 test/buffer/mutt_buffer_is_empty.o \
+                 test/buffer/mutt_buffer_len.o \
+                 test/buffer/mutt_buffer_new.o \
+                 test/buffer/mutt_buffer_pool_free.o \
+                 test/buffer/mutt_buffer_pool_get.o \
+                 test/buffer/mutt_buffer_pool_release.o \
+                 test/buffer/mutt_buffer_printf.o \
+                 test/buffer/mutt_buffer_reset.o \
+                 test/buffer/mutt_buffer_strcpy.o \
+                 test/buffer/mutt_buffer_strcpy_n.o
+
 CONFIG_OBJS    = test/config/main.o test/config/account.o \
                  test/config/address.o test/config/bool.o \
                  test/config/command.o test/config/common.o test/config/dump.o \
@@ -148,6 +171,8 @@ TEST_ADDRESS = test/address-test$(EXEEXT)
 
 TEST_BASE64 = test/base64-test$(EXEEXT)
 
+TEST_BUFFER = test/buffer-test$(EXEEXT)
+
 TEST_CONFIG = test/config-test$(EXEEXT)
 
 TEST_GROUP = test/group-test$(EXEEXT)
@@ -161,10 +186,11 @@ TEST_PATTERN = test/pattern-test$(EXEEXT)
 TEST_STRING = test/string-test$(EXEEXT)
 
 .PHONY: test
-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_CONFIG) $(TEST_GROUP) $(TEST_IDNA) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING)
+test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CONFIG) $(TEST_GROUP) $(TEST_IDNA) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING)
        $(TEST_BINARY)
        $(TEST_ADDRESS)
        $(TEST_BASE64)
+       $(TEST_BUFFER)
        $(TEST_CONFIG)
        $(TEST_GROUP)
        $(TEST_IDNA)
@@ -181,6 +207,9 @@ $(TEST_ADDRESS): $(PWD)/test/address $(ADDRESS_OBJS) $(MUTTLIBS)
 $(TEST_BASE64): $(PWD)/test/base64 $(BASE64_OBJS) $(MUTTLIBS)
        $(CC) -o $@ $(BASE64_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
 
+$(TEST_BUFFER): $(PWD)/test/buffer $(BUFFER_OBJS) $(MUTTLIBS)
+       $(CC) -o $@ $(BUFFER_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+
 $(TEST_CONFIG): $(PWD)/test/config $(CONFIG_OBJS) $(MUTTLIBS)
        $(CC) -o $@ $(CONFIG_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
 
@@ -205,6 +234,9 @@ $(PWD)/test/address:
 $(PWD)/test/base64:
        $(MKDIR_P) $(PWD)/test/base64
 
+$(PWD)/test/buffer:
+       $(MKDIR_P) $(PWD)/test/buffer
+
 $(PWD)/test/config:
        $(MKDIR_P) $(PWD)/test/config
 
@@ -223,7 +255,7 @@ $(PWD)/test/pattern:
 $(PWD)/test/string:
        $(MKDIR_P) $(PWD)/test/string
 
-all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_CONFIG) $(TEST_GROUP) $(TEST_IDNA) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING)
+all-test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CONFIG) $(TEST_GROUP) $(TEST_IDNA) $(TEST_PATH) $(TEST_PATTERN) $(TEST_STRING)
 
 clean-test:
        $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \
@@ -248,6 +280,9 @@ ADDRESS_DEPFILES = $(ADDRESS_OBJS:.o=.Po)
 BASE64_DEPFILES = $(BASE64_OBJS:.o=.Po)
 -include $(BASE64_DEPFILES)
 
+BUFFER_DEPFILES = $(BUFFER_OBJS:.o=.Po)
+-include $(BUFFER_DEPFILES)
+
 CONFIG_DEPFILES = $(CONFIG_OBJS:.o=.Po)
 -include $(CONFIG_DEPFILES)
 
diff --git a/test/buffer/main.c b/test/buffer/main.c
new file mode 100644 (file)
index 0000000..0a968e1
--- /dev/null
@@ -0,0 +1,63 @@
+/**
+ * @file
+ * Test code for buffer 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_buffer_addch)                                    \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_add_printf)                               \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_addstr)                                   \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_addstr_n)                                 \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_alloc)                                    \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_concat_path)                              \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_fix_dptr)                                 \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_free)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_from)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_increase_size)                            \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_init)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_is_empty)                                 \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_len)                                      \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_new)                                      \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_pool_free)                                \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_pool_get)                                 \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_pool_release)                             \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_printf)                                   \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_reset)                                    \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_strcpy)                                   \
+  NEOMUTT_TEST_ITEM(test_mutt_buffer_strcpy_n)
+
+/******************************************************************************
+ * 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/buffer/mutt_buffer_add_printf.c b/test/buffer/mutt_buffer_add_printf.c
new file mode 100644 (file)
index 0000000..208a3d7
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_add_printf()
+ *
+ * @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_buffer_add_printf(void)
+{
+  // int mutt_buffer_add_printf(struct Buffer *buf, const char *fmt, ...);
+}
diff --git a/test/buffer/mutt_buffer_addch.c b/test/buffer/mutt_buffer_addch.c
new file mode 100644 (file)
index 0000000..ac01755
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_addch()
+ *
+ * @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_buffer_addch(void)
+{
+  // size_t mutt_buffer_addch(struct Buffer *buf, char c);
+}
diff --git a/test/buffer/mutt_buffer_addstr.c b/test/buffer/mutt_buffer_addstr.c
new file mode 100644 (file)
index 0000000..bb934a5
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_addstr()
+ *
+ * @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_buffer_addstr(void)
+{
+  // size_t mutt_buffer_addstr(struct Buffer *buf, const char *s);
+}
diff --git a/test/buffer/mutt_buffer_addstr_n.c b/test/buffer/mutt_buffer_addstr_n.c
new file mode 100644 (file)
index 0000000..3643f1b
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_addstr_n()
+ *
+ * @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_buffer_addstr_n(void)
+{
+  // size_t mutt_buffer_addstr_n(struct Buffer *buf, const char *s, size_t len);
+}
diff --git a/test/buffer/mutt_buffer_alloc.c b/test/buffer/mutt_buffer_alloc.c
new file mode 100644 (file)
index 0000000..576a649
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_alloc()
+ *
+ * @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_buffer_alloc(void)
+{
+  // struct Buffer *mutt_buffer_alloc(size_t size);
+}
diff --git a/test/buffer/mutt_buffer_concat_path.c b/test/buffer/mutt_buffer_concat_path.c
new file mode 100644 (file)
index 0000000..713d269
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_concat_path()
+ *
+ * @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_buffer_concat_path(void)
+{
+  // void mutt_buffer_concat_path(struct Buffer *buf, const char *dir, const char *fname);
+}
diff --git a/test/buffer/mutt_buffer_fix_dptr.c b/test/buffer/mutt_buffer_fix_dptr.c
new file mode 100644 (file)
index 0000000..0272b21
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_fix_dptr()
+ *
+ * @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_buffer_fix_dptr(void)
+{
+  // void mutt_buffer_fix_dptr(struct Buffer *buf);
+}
diff --git a/test/buffer/mutt_buffer_free.c b/test/buffer/mutt_buffer_free.c
new file mode 100644 (file)
index 0000000..c1a5b67
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_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_buffer_free(void)
+{
+  // void mutt_buffer_free(struct Buffer **p);
+}
diff --git a/test/buffer/mutt_buffer_from.c b/test/buffer/mutt_buffer_from.c
new file mode 100644 (file)
index 0000000..55a47db
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_from()
+ *
+ * @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_buffer_from(void)
+{
+  // struct Buffer *mutt_buffer_from(const char *seed);
+}
diff --git a/test/buffer/mutt_buffer_increase_size.c b/test/buffer/mutt_buffer_increase_size.c
new file mode 100644 (file)
index 0000000..d4f5251
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_increase_size()
+ *
+ * @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_buffer_increase_size(void)
+{
+  // void mutt_buffer_increase_size(struct Buffer *buf, size_t new_size);
+}
diff --git a/test/buffer/mutt_buffer_init.c b/test/buffer/mutt_buffer_init.c
new file mode 100644 (file)
index 0000000..eebf79a
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_init()
+ *
+ * @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_buffer_init(void)
+{
+  // struct Buffer *mutt_buffer_init(struct Buffer *buf);
+}
diff --git a/test/buffer/mutt_buffer_is_empty.c b/test/buffer/mutt_buffer_is_empty.c
new file mode 100644 (file)
index 0000000..50af33b
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_is_empty()
+ *
+ * @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_buffer_is_empty(void)
+{
+  // bool mutt_buffer_is_empty(const struct Buffer *buf);
+}
diff --git a/test/buffer/mutt_buffer_len.c b/test/buffer/mutt_buffer_len.c
new file mode 100644 (file)
index 0000000..6540675
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_len()
+ *
+ * @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_buffer_len(void)
+{
+  // size_t mutt_buffer_len(const struct Buffer *buf);
+}
diff --git a/test/buffer/mutt_buffer_new.c b/test/buffer/mutt_buffer_new.c
new file mode 100644 (file)
index 0000000..3300138
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_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"
+
+void test_mutt_buffer_new(void)
+{
+  // struct Buffer *mutt_buffer_new(void);
+}
diff --git a/test/buffer/mutt_buffer_pool_free.c b/test/buffer/mutt_buffer_pool_free.c
new file mode 100644 (file)
index 0000000..32b9d7d
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_pool_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_buffer_pool_free(void)
+{
+  // void mutt_buffer_pool_free(void);
+}
diff --git a/test/buffer/mutt_buffer_pool_get.c b/test/buffer/mutt_buffer_pool_get.c
new file mode 100644 (file)
index 0000000..e70f24d
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_pool_get()
+ *
+ * @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_buffer_pool_get(void)
+{
+  // struct Buffer *mutt_buffer_pool_get(void);
+}
diff --git a/test/buffer/mutt_buffer_pool_release.c b/test/buffer/mutt_buffer_pool_release.c
new file mode 100644 (file)
index 0000000..af93000
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_pool_release()
+ *
+ * @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_buffer_pool_release(void)
+{
+  // void mutt_buffer_pool_release(struct Buffer **pbuf);
+}
diff --git a/test/buffer/mutt_buffer_printf.c b/test/buffer/mutt_buffer_printf.c
new file mode 100644 (file)
index 0000000..3a78737
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_printf()
+ *
+ * @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_buffer_printf(void)
+{
+  // int mutt_buffer_printf(struct Buffer *buf, const char *fmt, ...);
+}
diff --git a/test/buffer/mutt_buffer_reset.c b/test/buffer/mutt_buffer_reset.c
new file mode 100644 (file)
index 0000000..e5dbf45
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_reset()
+ *
+ * @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_buffer_reset(void)
+{
+  // void mutt_buffer_reset(struct Buffer *buf);
+}
diff --git a/test/buffer/mutt_buffer_strcpy.c b/test/buffer/mutt_buffer_strcpy.c
new file mode 100644 (file)
index 0000000..6701bc9
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_strcpy()
+ *
+ * @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_buffer_strcpy(void)
+{
+  // void mutt_buffer_strcpy(struct Buffer *buf, const char *s);
+}
diff --git a/test/buffer/mutt_buffer_strcpy_n.c b/test/buffer/mutt_buffer_strcpy_n.c
new file mode 100644 (file)
index 0000000..2608a82
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_buffer_strcpy_n()
+ *
+ * @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_buffer_strcpy_n(void)
+{
+  // void mutt_buffer_strcpy_n(struct Buffer *buf, const char *s, size_t len);
+}