diff --git a/docs/json-api/gen-api-parsers.sh b/docs/json-api/gen-api-parsers.sh new file mode 100755 index 00000000..b0042d16 --- /dev/null +++ b/docs/json-api/gen-api-parsers.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +outdir=${outc_dir:-"."} + +json-autotype --clang --no-autounify --debug -t json_error ./neu_json_error.json -o neu_json_error.c +json-autotype --clang --no-autounify --debug -t json_group_config ./neu_json_group_config.json -o neu_json_group_config.c +json-autotype --clang --no-autounify --debug -t json_node ./neu_json_node.json -o neu_json_node.c +json-autotype --clang --no-autounify --debug -t json_plugin ./neu_json_plugin.json -o neu_json_plugin.c +json-autotype --clang --no-autounify --debug -t json_rw ./neu_json_rw.json -o neu_json_rw.c +json-autotype --clang --no-autounify --debug -t json_tag ./neu_json_tag.json -o neu_json_tag.c +json-autotype --clang --no-autounify --debug -t json_tty ./neu_json_tty.json -o neu_json_tty.c + +mv *.c *.h ${outdir}/ diff --git a/tests/persistence_test.cc b/tests/persistence_test.cc index bd44124a..cccd7961 100644 --- a/tests/persistence_test.cc +++ b/tests/persistence_test.cc @@ -10,12 +10,12 @@ TEST(PersistenceAdapterTest, Adapter) const char *adapters_fname = neu_persister_get_adapters_fname(persister); const char *plugins_fname = neu_persister_get_plugins_fname(persister); - neu_json_node_req_node_t node1 = { (char *) "sample-driver-adapter", 1, 1, - (char *) "sample-drv-plugin" }; - neu_json_node_req_node_t node2 = { (char *) "sample-app-adapter", 5, 2, - (char *) "sample-app-plugin" }; - neu_json_node_req_node_t node3 = { (char *) "mqtt-adapter", 3, 3, - (char *) "mqtt-plugin" }; + neu_json_node_req_node_t node1 = { (char *) "sample-driver-adapter", 1, + (char *) "sample-drv-plugin", 1 }; + neu_json_node_req_node_t node2 = { (char *) "sample-app-adapter", 5, + (char *) "sample-app-plugin", 2 }; + neu_json_node_req_node_t node3 = { (char *) "mqtt-adapter", 3, + (char *) "mqtt-plugin", 3 }; neu_json_node_req_t *req = (neu_json_node_req_t *) malloc(sizeof(neu_json_node_req_t)); @@ -152,12 +152,12 @@ TEST(PersistenceDatatagTest, Datatag) const char *grp_config_name = "test-group"; const char *plugins_fname = neu_persister_get_plugins_fname(persister); - neu_json_datatag_req_tag_t tag1 = { (char *) "modbus1", 3, 1, - (char *) "1!400001" }; - neu_json_datatag_req_tag_t tag2 = { (char *) "modbus2", 4, 1, - (char *) "1!400002" }; - neu_json_datatag_req_tag_t tag3 = { (char *) "modbus3", 5, 1, - (char *) "1!400003" }; + neu_json_datatag_req_tag_t tag1 = { (char *) "1!400001", (char *) "modbus1", + 3, 1 }; + neu_json_datatag_req_tag_t tag2 = { (char *) "1!400002", (char *) "modbus2", + 4, 1 }; + neu_json_datatag_req_tag_t tag3 = { (char *) "1!400003", (char *) "modbus3", + 5, 1 }; neu_json_datatag_req_t *req = (neu_json_datatag_req_t *) malloc(sizeof(neu_json_datatag_req_t));