# HG changeset patch # User mabrand # Date 1344777636 25200 # Node ID 6cf5b6f1c0bc18c1728eae07424c9d41fc293ada # Parent bff0238b571776cb12d4991215272123a1889e1b# Parent 010e74541aca4423a86ff0655fa2b5486a212bc9 Merge pull request #65 from residuum/master Test case for json-c diff -r bff0238b5717 -r 6cf5b6f1c0bc src/json-c-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/json-c-test.c Sun Aug 12 06:20:36 2012 -0700 @@ -0,0 +1,23 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include + +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; +} diff -r bff0238b5717 -r 6cf5b6f1c0bc src/json-c.mk --- a/src/json-c.mk Sun Aug 12 06:18:43 2012 -0700 +++ b/src/json-c.mk Sun Aug 12 06:20:36 2012 -0700 @@ -25,4 +25,9 @@ --disable-shared CFLAGS=-Wno-error $(MAKE) -C '$(1)' -j '$(JOBS)' install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-json-c.exe' \ + `'$(TARGET)-pkg-config' json --cflags --libs` endef