summaryrefslogtreecommitdiff
path: root/test/fzytest.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2016-08-03 23:43:36 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2016-08-03 23:45:11 -0700
commit7812c553d33ce105afbc7696fb9e01ca92fba2ea (patch)
tree56ec485f4f77a805821d5a133aab8c9be1ba3d61 /test/fzytest.c
parent010f4cf47a4a4a312b7fdcb05547d25d53b5d33b (diff)
Fix segfault when encountering utf-8 characters
Diffstat (limited to 'test/fzytest.c')
-rw-r--r--test/fzytest.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/fzytest.c b/test/fzytest.c
index 0e0bad0..3786cd7 100644
--- a/test/fzytest.c
+++ b/test/fzytest.c
@@ -268,6 +268,17 @@ void test_choices_without_search() {
choices_destroy(&choices);
}
+/* Regression test for segfault */
+void test_choices_unicode() {
+ choices_t choices;
+ choices_init(&choices);
+
+ choices_add(&choices, "Edmund Husserl - Méditations cartésiennes - Introduction a la phénoménologie.pdf");
+ choices_search(&choices, "e");
+
+ choices_destroy(&choices);
+}
+
void summary() {
printf("%i tests, %i assertions, %i failures\n", testsrun, assertionsrun, testsfailed);
}
@@ -298,6 +309,7 @@ int main(int argc, char *argv[]) {
runtest(test_choices_1);
runtest(test_choices_2);
runtest(test_choices_without_search);
+ runtest(test_choices_unicode);
summary();