diff options
author | Petri Lehtinen <petri@digip.org> | 2014-12-19 08:35:31 +0200 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2014-12-19 08:35:46 +0200 |
commit | 890760b2fb780c05446b3ad14f25e536312c21f9 (patch) | |
tree | bfe4e8e1fb1b7e30510cf9a63180946c45b6795a /test/suites/api/test_dump.c | |
parent | 15653c47dd9a7d5714d1332704214446b71a5352 (diff) | |
download | jansson-890760b2fb780c05446b3ad14f25e536312c21f9.zip jansson-890760b2fb780c05446b3ad14f25e536312c21f9.tar.gz jansson-890760b2fb780c05446b3ad14f25e536312c21f9.tar.bz2 |
Increase test coverage
Diffstat (limited to 'test/suites/api/test_dump.c')
-rw-r--r-- | test/suites/api/test_dump.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/suites/api/test_dump.c b/test/suites/api/test_dump.c index 8731752..ac4a883 100644 --- a/test/suites/api/test_dump.c +++ b/test/suites/api/test_dump.c @@ -194,6 +194,24 @@ static void encode_nul_byte() json_decref(json); } +static void dump_file() +{ + json_t *json; + int result; + + result = json_dump_file(NULL, "", 0); + if (result != -1) + fail("json_dump_file succeeded with invalid args"); + + json = json_object(); + result = json_dump_file(json, "json_dump_file.json", 0); + if (result != 0) + fail("json_dump_file failed"); + + json_decref(json); + remove("json_dump_file.json"); +} + static void run_tests() { encode_null(); @@ -202,4 +220,5 @@ static void run_tests() encode_other_than_array_or_object(); escape_slashes(); encode_nul_byte(); + dump_file(); } |