diff options
author | Thomas Mayer <thomas@residuum.org> | 2012-08-10 19:05:20 (GMT) |
---|---|---|
committer | Thomas Mayer <thomas@residuum.org> | 2012-08-10 19:05:20 (GMT) |
commit | 5763978027d917a7622c19886401d594029b5892 (patch) | |
tree | 965059e380f47b7e7aea6a7230fca4f44eb6bf27 /src/json-c-test.c | |
parent | 1bced16c88b136c528fe6d0357c78299522053e8 (diff) | |
download | mxe-5763978027d917a7622c19886401d594029b5892.zip mxe-5763978027d917a7622c19886401d594029b5892.tar.gz mxe-5763978027d917a7622c19886401d594029b5892.tar.bz2 |
Test application for json-c.
Squashed commit of the following:
commit 1ad29ec164b9f07781f68fbe39276428105e3d8e
Author: Thomas Mayer <thomas@residuum.org>
Date: Fri Aug 10 20:51:42 2012 +0200
Test for json-c actually outputs something instead of just return 0 or 1.
commit 2650c38c79a627f25c7dda9e89dd1acaca8d3663
Author: Thomas Mayer <thomas@residuum.org>
Date: Sat Aug 4 16:46:28 2012 +0200
Test case for json-c.
Diffstat (limited to 'src/json-c-test.c')
-rw-r--r-- | src/json-c-test.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/json-c-test.c b/src/json-c-test.c new file mode 100644 index 0000000..676d6be --- /dev/null +++ b/src/json-c-test.c @@ -0,0 +1,23 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include <json/json.h> +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + json_object *jobj; + + (void)argc; + (void)argv; + + jobj = json_object_new_object(); + if (!jobj) { + return 1; + } + json_object_object_add(jobj, "key", json_object_new_string("value")); + printf("%s", json_object_to_json_string(jobj)); + return 0; +} |