From 104ab156f94c55bd436202ea030f281dc804a400 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sun, 28 Apr 2019 12:37:15 +0100 Subject: [PATCH] test: templates for buffer functions --- .gitignore | 1 + test/Makefile.autosetup | 39 ++++++++++++++- test/buffer/main.c | 63 +++++++++++++++++++++++++ test/buffer/mutt_buffer_add_printf.c | 31 ++++++++++++ test/buffer/mutt_buffer_addch.c | 31 ++++++++++++ test/buffer/mutt_buffer_addstr.c | 31 ++++++++++++ test/buffer/mutt_buffer_addstr_n.c | 31 ++++++++++++ test/buffer/mutt_buffer_alloc.c | 31 ++++++++++++ test/buffer/mutt_buffer_concat_path.c | 31 ++++++++++++ test/buffer/mutt_buffer_fix_dptr.c | 31 ++++++++++++ test/buffer/mutt_buffer_free.c | 31 ++++++++++++ test/buffer/mutt_buffer_from.c | 31 ++++++++++++ test/buffer/mutt_buffer_increase_size.c | 31 ++++++++++++ test/buffer/mutt_buffer_init.c | 31 ++++++++++++ test/buffer/mutt_buffer_is_empty.c | 31 ++++++++++++ test/buffer/mutt_buffer_len.c | 31 ++++++++++++ test/buffer/mutt_buffer_new.c | 31 ++++++++++++ test/buffer/mutt_buffer_pool_free.c | 31 ++++++++++++ test/buffer/mutt_buffer_pool_get.c | 31 ++++++++++++ test/buffer/mutt_buffer_pool_release.c | 31 ++++++++++++ test/buffer/mutt_buffer_printf.c | 31 ++++++++++++ test/buffer/mutt_buffer_reset.c | 31 ++++++++++++ test/buffer/mutt_buffer_strcpy.c | 31 ++++++++++++ test/buffer/mutt_buffer_strcpy_n.c | 31 ++++++++++++ 24 files changed, 752 insertions(+), 2 deletions(-) create mode 100644 test/buffer/main.c create mode 100644 test/buffer/mutt_buffer_add_printf.c create mode 100644 test/buffer/mutt_buffer_addch.c create mode 100644 test/buffer/mutt_buffer_addstr.c create mode 100644 test/buffer/mutt_buffer_addstr_n.c create mode 100644 test/buffer/mutt_buffer_alloc.c create mode 100644 test/buffer/mutt_buffer_concat_path.c create mode 100644 test/buffer/mutt_buffer_fix_dptr.c create mode 100644 test/buffer/mutt_buffer_free.c create mode 100644 test/buffer/mutt_buffer_from.c create mode 100644 test/buffer/mutt_buffer_increase_size.c create mode 100644 test/buffer/mutt_buffer_init.c create mode 100644 test/buffer/mutt_buffer_is_empty.c create mode 100644 test/buffer/mutt_buffer_len.c create mode 100644 test/buffer/mutt_buffer_new.c create mode 100644 test/buffer/mutt_buffer_pool_free.c create mode 100644 test/buffer/mutt_buffer_pool_get.c create mode 100644 test/buffer/mutt_buffer_pool_release.c create mode 100644 test/buffer/mutt_buffer_printf.c create mode 100644 test/buffer/mutt_buffer_reset.c create mode 100644 test/buffer/mutt_buffer_strcpy.c create mode 100644 test/buffer/mutt_buffer_strcpy_n.c diff --git a/.gitignore b/.gitignore index 4c81b89e1..aeb3d316e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ neomutt pgpewrap test/address-test test/base64-test +test/buffer-test test/config-test test/group-test test/idna-test diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index 39b421f89..3584a0bc6 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -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 index 000000000..0a968e15b --- /dev/null +++ b/test/buffer/main.c @@ -0,0 +1,63 @@ +/** + * @file + * Test code for buffer Operations + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..208a3d7fb --- /dev/null +++ b/test/buffer/mutt_buffer_add_printf.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_add_printf() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..ac017552f --- /dev/null +++ b/test/buffer/mutt_buffer_addch.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_addch() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..bb934a598 --- /dev/null +++ b/test/buffer/mutt_buffer_addstr.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_addstr() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..3643f1b44 --- /dev/null +++ b/test/buffer/mutt_buffer_addstr_n.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_addstr_n() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..576a649b0 --- /dev/null +++ b/test/buffer/mutt_buffer_alloc.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_alloc() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..713d26963 --- /dev/null +++ b/test/buffer/mutt_buffer_concat_path.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_concat_path() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..0272b2175 --- /dev/null +++ b/test/buffer/mutt_buffer_fix_dptr.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_fix_dptr() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..c1a5b67fb --- /dev/null +++ b/test/buffer/mutt_buffer_free.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_free() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..55a47db80 --- /dev/null +++ b/test/buffer/mutt_buffer_from.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_from() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..d4f525198 --- /dev/null +++ b/test/buffer/mutt_buffer_increase_size.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_increase_size() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..eebf79ab6 --- /dev/null +++ b/test/buffer/mutt_buffer_init.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_init() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..50af33bbc --- /dev/null +++ b/test/buffer/mutt_buffer_is_empty.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_is_empty() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..654067534 --- /dev/null +++ b/test/buffer/mutt_buffer_len.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_len() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..330013800 --- /dev/null +++ b/test/buffer/mutt_buffer_new.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_new() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..32b9d7d22 --- /dev/null +++ b/test/buffer/mutt_buffer_pool_free.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_pool_free() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..e70f24d2d --- /dev/null +++ b/test/buffer/mutt_buffer_pool_get.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_pool_get() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..af93000cd --- /dev/null +++ b/test/buffer/mutt_buffer_pool_release.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_pool_release() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..3a7873774 --- /dev/null +++ b/test/buffer/mutt_buffer_printf.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_printf() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..e5dbf456e --- /dev/null +++ b/test/buffer/mutt_buffer_reset.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_reset() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..6701bc995 --- /dev/null +++ b/test/buffer/mutt_buffer_strcpy.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_strcpy() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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 index 000000000..2608a8244 --- /dev/null +++ b/test/buffer/mutt_buffer_strcpy_n.c @@ -0,0 +1,31 @@ +/** + * @file + * Test code for mutt_buffer_strcpy_n() + * + * @authors + * Copyright (C) 2019 Richard Russon + * + * @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 . + */ + +#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); +} -- 2.49.0