diff options
Diffstat (limited to 'test/suites/api/test_unpack.c')
-rw-r--r-- | test/suites/api/test_unpack.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/suites/api/test_unpack.c b/test/suites/api/test_unpack.c index bec8666..7f049dd 100644 --- a/test/suites/api/test_unpack.c +++ b/test/suites/api/test_unpack.c @@ -17,6 +17,7 @@ static void run_tests() int i1, i2, i3; json_int_t I1; int rv; + size_t z; double f; char *s; @@ -81,6 +82,13 @@ static void run_tests() fail("json_unpack string failed"); json_decref(j); + /* string with length (size_t) */ + j = json_string("foo"); + rv = json_unpack(j, "s%", &s, &z); + if(rv || strcmp(s, "foo") || z != 3) + fail("json_unpack string with length (size_t) failed"); + json_decref(j); + /* empty object */ j = json_object(); if(json_unpack(j, "{}")) |