]> granicus.if.org Git - neomutt/commitdiff
test: templates for mbyte 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 10:22:04 +0000 (11:22 +0100)
15 files changed:
.gitignore
test/Makefile.autosetup
test/mbyte/main.c [new file with mode: 0644]
test/mbyte/mutt_mb_charlen.c [new file with mode: 0644]
test/mbyte/mutt_mb_filter_unprintable.c [new file with mode: 0644]
test/mbyte/mutt_mb_get_initials.c [new file with mode: 0644]
test/mbyte/mutt_mb_is_display_corrupting_utf8.c [new file with mode: 0644]
test/mbyte/mutt_mb_is_lower.c [new file with mode: 0644]
test/mbyte/mutt_mb_is_shell_char.c [new file with mode: 0644]
test/mbyte/mutt_mb_mbstowcs.c [new file with mode: 0644]
test/mbyte/mutt_mb_wcstombs.c [new file with mode: 0644]
test/mbyte/mutt_mb_wcswidth.c [new file with mode: 0644]
test/mbyte/mutt_mb_wcwidth.c [new file with mode: 0644]
test/mbyte/mutt_mb_width.c [new file with mode: 0644]
test/mbyte/mutt_mb_width_ceiling.c [new file with mode: 0644]

index f7f1b036de25d8123bb194cc7b2a0cfe6baaeeff..81eb9bd16b9b1888a19a19d6ad68ea7f7c55673d 100644 (file)
@@ -25,6 +25,7 @@ test/idna-test
 test/list-test
 test/logging-test
 test/mapping-test
+test/mbyte-test
 test/neomutt-test
 test/path-test
 test/pattern-test
index 7e68202b5c2934d3309593adffce740bf2fb965b..fd2cb9932ce22efeea952ff0129d5df444ba20ce 100644 (file)
@@ -237,6 +237,20 @@ MAPPING_OBJS       = test/mapping/main.o \
                  test/mapping/mutt_map_get_name.o \
                  test/mapping/mutt_map_get_value.o
 
+MBYTE_OBJS     = test/mbyte/main.o \
+                 test/mbyte/mutt_mb_charlen.o \
+                 test/mbyte/mutt_mb_filter_unprintable.o \
+                 test/mbyte/mutt_mb_get_initials.o \
+                 test/mbyte/mutt_mb_is_display_corrupting_utf8.o \
+                 test/mbyte/mutt_mb_is_lower.o \
+                 test/mbyte/mutt_mb_is_shell_char.o \
+                 test/mbyte/mutt_mb_mbstowcs.o \
+                 test/mbyte/mutt_mb_wcstombs.o \
+                 test/mbyte/mutt_mb_wcswidth.o \
+                 test/mbyte/mutt_mb_wcwidth.o \
+                 test/mbyte/mutt_mb_width.o \
+                 test/mbyte/mutt_mb_width_ceiling.o
+
 PATH_OBJS      = test/path/main.o \
                  test/path/mutt_path_abbr_folder.o \
                  test/path/mutt_path_basename.o \
@@ -342,6 +356,8 @@ TEST_LOGGING = test/logging-test$(EXEEXT)
 
 TEST_MAPPING = test/mapping-test$(EXEEXT)
 
+TEST_MBYTE = test/mbyte-test$(EXEEXT)
+
 TEST_PATH = test/path-test$(EXEEXT)
 
 TEST_PATTERN = test/pattern-test$(EXEEXT)
@@ -349,7 +365,7 @@ 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_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_PATH) $(TEST_PATTERN) $(TEST_STRING)
        $(TEST_BINARY)
        $(TEST_ADDRESS)
        $(TEST_BASE64)
@@ -365,6 +381,7 @@ test: $(TEST_BINARY) $(TEST_ADDRESS) $(TEST_BASE64) $(TEST_BUFFER) $(TEST_CHARSE
        $(TEST_LIST)
        $(TEST_LOGGING)
        $(TEST_MAPPING)
+       $(TEST_MBYTE)
        $(TEST_PATH)
        $(TEST_PATTERN)
        $(TEST_STRING)
@@ -417,6 +434,9 @@ $(TEST_LOGGING): $(PWD)/test/logging $(LOGGING_OBJS) $(MUTTLIBS)
 $(TEST_MAPPING): $(PWD)/test/mapping $(MAPPING_OBJS) $(MUTTLIBS)
        $(CC) -o $@ $(MAPPING_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
 
+$(TEST_MBYTE): $(PWD)/test/mbyte $(MBYTE_OBJS) $(MUTTLIBS)
+       $(CC) -o $@ $(MBYTE_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
+
 $(TEST_PATH): $(PWD)/test/path $(PATH_OBJS) $(MUTTLIBS)
        $(CC) -o $@ $(PATH_OBJS) $(MUTTLIBS) $(LDFLAGS) $(LIBS)
 
@@ -471,6 +491,9 @@ $(PWD)/test/logging:
 $(PWD)/test/mapping:
        $(MKDIR_P) $(PWD)/test/mapping
 
+$(PWD)/test/mbyte:
+       $(MKDIR_P) $(PWD)/test/mbyte
+
 $(PWD)/test/path:
        $(MKDIR_P) $(PWD)/test/path
 
@@ -480,7 +503,7 @@ $(PWD)/test/pattern:
 $(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_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_PATH) $(TEST_PATTERN) $(TEST_STRING)
 
 clean-test:
        $(RM) $(TEST_BINARY) $(TEST_OBJS) $(TEST_OBJS:.o=.Po) \
@@ -498,6 +521,7 @@ clean-test:
              $(TEST_LIST) $(LIST_OBJS) $(LIST_OBJS:.o=.Po) \
              $(TEST_LOGGING) $(LOGGING_OBJS) $(LOGGING_OBJS:.o=.Po) \
              $(TEST_MAPPING) $(MAPPING_OBJS) $(MAPPING_OBJS:.o=.Po) \
+             $(TEST_MBYTE) $(MBYTE_OBJS) $(MBYTE_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)
@@ -553,6 +577,9 @@ LOGGING_DEPFILES = $(LOGGING_OBJS:.o=.Po)
 MAPPING_DEPFILES = $(MAPPING_OBJS:.o=.Po)
 -include $(MAPPING_DEPFILES)
 
+MBYTE_DEPFILES = $(MBYTE_OBJS:.o=.Po)
+-include $(MBYTE_DEPFILES)
+
 PATH_DEPFILES = $(PATH_OBJS:.o=.Po)
 -include $(PATH_DEPFILES)
 
diff --git a/test/mbyte/main.c b/test/mbyte/main.c
new file mode 100644 (file)
index 0000000..6a6c48f
--- /dev/null
@@ -0,0 +1,54 @@
+/**
+ * @file
+ * Test code for mbyte 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_mb_charlen)                                      \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_filter_unprintable)                           \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_get_initials)                                 \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_is_display_corrupting_utf8)                   \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_is_lower)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_is_shell_char)                                \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_mbstowcs)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_wcstombs)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_wcswidth)                                     \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_wcwidth)                                      \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_width)                                        \
+  NEOMUTT_TEST_ITEM(test_mutt_mb_width_ceiling)
+
+/******************************************************************************
+ * 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/mbyte/mutt_mb_charlen.c b/test/mbyte/mutt_mb_charlen.c
new file mode 100644 (file)
index 0000000..7288bd8
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_charlen()
+ *
+ * @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_mb_charlen(void)
+{
+  // int mutt_mb_charlen(const char *s, int *width);
+}
diff --git a/test/mbyte/mutt_mb_filter_unprintable.c b/test/mbyte/mutt_mb_filter_unprintable.c
new file mode 100644 (file)
index 0000000..c217f85
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_filter_unprintable()
+ *
+ * @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_mb_filter_unprintable(void)
+{
+  // int mutt_mb_filter_unprintable(char **s);
+}
diff --git a/test/mbyte/mutt_mb_get_initials.c b/test/mbyte/mutt_mb_get_initials.c
new file mode 100644 (file)
index 0000000..07748af
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_get_initials()
+ *
+ * @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_mb_get_initials(void)
+{
+  // bool mutt_mb_get_initials(const char *name, char *buf, size_t buflen);
+}
diff --git a/test/mbyte/mutt_mb_is_display_corrupting_utf8.c b/test/mbyte/mutt_mb_is_display_corrupting_utf8.c
new file mode 100644 (file)
index 0000000..4f31af5
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_is_display_corrupting_utf8()
+ *
+ * @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_mb_is_display_corrupting_utf8(void)
+{
+  // bool mutt_mb_is_display_corrupting_utf8(wchar_t wc);
+}
diff --git a/test/mbyte/mutt_mb_is_lower.c b/test/mbyte/mutt_mb_is_lower.c
new file mode 100644 (file)
index 0000000..51cc317
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_is_lower()
+ *
+ * @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_mb_is_lower(void)
+{
+  // bool mutt_mb_is_lower(const char *s);
+}
diff --git a/test/mbyte/mutt_mb_is_shell_char.c b/test/mbyte/mutt_mb_is_shell_char.c
new file mode 100644 (file)
index 0000000..ca81e1e
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_is_shell_char()
+ *
+ * @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_mb_is_shell_char(void)
+{
+  // bool mutt_mb_is_shell_char(wchar_t ch);
+}
diff --git a/test/mbyte/mutt_mb_mbstowcs.c b/test/mbyte/mutt_mb_mbstowcs.c
new file mode 100644 (file)
index 0000000..1030a5e
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_mbstowcs()
+ *
+ * @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_mb_mbstowcs(void)
+{
+  // size_t mutt_mb_mbstowcs(wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *buf);
+}
diff --git a/test/mbyte/mutt_mb_wcstombs.c b/test/mbyte/mutt_mb_wcstombs.c
new file mode 100644 (file)
index 0000000..d316336
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_wcstombs()
+ *
+ * @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_mb_wcstombs(void)
+{
+  // void mutt_mb_wcstombs(char *dest, size_t dlen, const wchar_t *src, size_t slen);
+}
diff --git a/test/mbyte/mutt_mb_wcswidth.c b/test/mbyte/mutt_mb_wcswidth.c
new file mode 100644 (file)
index 0000000..e83e160
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_wcswidth()
+ *
+ * @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_mb_wcswidth(void)
+{
+  // int mutt_mb_wcswidth(const wchar_t *s, size_t n);
+}
diff --git a/test/mbyte/mutt_mb_wcwidth.c b/test/mbyte/mutt_mb_wcwidth.c
new file mode 100644 (file)
index 0000000..bf1d02e
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_wcwidth()
+ *
+ * @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_mb_wcwidth(void)
+{
+  // int mutt_mb_wcwidth(wchar_t wc);
+}
diff --git a/test/mbyte/mutt_mb_width.c b/test/mbyte/mutt_mb_width.c
new file mode 100644 (file)
index 0000000..92ddd73
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_width()
+ *
+ * @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_mb_width(void)
+{
+  // int mutt_mb_width(const char *str, int col, bool display);
+}
diff --git a/test/mbyte/mutt_mb_width_ceiling.c b/test/mbyte/mutt_mb_width_ceiling.c
new file mode 100644 (file)
index 0000000..64a5a0e
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * @file
+ * Test code for mutt_mb_width_ceiling()
+ *
+ * @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_mb_width_ceiling(void)
+{
+  // size_t mutt_mb_width_ceiling(const wchar_t *s, size_t n, int w1);
+}