summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/json-test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tests/json-test.c b/src/tests/json-test.c
index 2e1ca6b92..7d273d70c 100644
--- a/src/tests/json-test.c
+++ b/src/tests/json-test.c
@@ -216,6 +216,18 @@ START_TEST(array_test) {
}
END_TEST
+START_TEST(bad_test) {
+ unsigned int i;
+ const char *bad_parse[] = {
+ "\"" /* Quote not closed */,
+ };
+
+ for (i = 0; i < PA_ELEMENTSOF(bad_parse); i++) {
+ fail_unless(pa_json_parse(bad_parse[i]) == NULL);
+ }
+}
+END_TEST
+
int main(int argc, char *argv[]) {
int failed = 0;
Suite *s;
@@ -231,6 +243,7 @@ int main(int argc, char *argv[]) {
tcase_add_test(tc, bool_test);
tcase_add_test(tc, object_test);
tcase_add_test(tc, array_test);
+ tcase_add_test(tc, bad_test);
suite_add_tcase(s, tc);
sr = srunner_create(s);