Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> --- check-qjson.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/check-qjson.c b/check-qjson.c index 32aa33c..8760941 100644 --- a/check-qjson.c +++ b/check-qjson.c @@ -9,6 +9,7 @@ * */ #include <check.h> +#include <stdbool.h> #include "qstring.h" #include "qint.h" @@ -282,6 +283,26 @@ START_TEST(keyword_literal) fail_unless(qbool_get_int(qbool) == 0); QDECREF(qbool); + + obj = qobject_from_jsonf("%i", &length, false); + fail_unless(obj != NULL); + fail_unless(qobject_type(obj) == QTYPE_QBOOL); + fail_unless(length == 2); + + qbool = qobject_to_qbool(obj); + fail_unless(qbool_get_int(qbool) == 0); + + QDECREF(qbool); + + obj = qobject_from_jsonf("%i", &length, true); + fail_unless(obj != NULL); + fail_unless(qobject_type(obj) == QTYPE_QBOOL); + fail_unless(length == 2); + + qbool = qobject_to_qbool(obj); + fail_unless(qbool_get_int(qbool) != 0); + + QDECREF(qbool); } END_TEST -- 1.6.2.5