test: fix linux compilation
This commit is contained in:
+3
-3
@@ -22,17 +22,17 @@ int main(int argc, const char **argv)
|
|||||||
/* TODO re-implement json support */
|
/* TODO re-implement json support */
|
||||||
fx_serial_ctx *ctx = NULL;
|
fx_serial_ctx *ctx = NULL;
|
||||||
|
|
||||||
fx_object *data;
|
fx_value data = FX_VALUE_EMPTY;
|
||||||
result = fx_serial_ctx_deserialise(ctx, src, &data, 0);
|
result = fx_serial_ctx_deserialise(ctx, src, &data, 0);
|
||||||
if (fx_result_is_error(result)) {
|
if (fx_result_is_error(result)) {
|
||||||
fx_throw(result);
|
fx_throw(result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fx_object_to_string(data, fx_stdout, NULL);
|
fx_value_to_string(&data, fx_stdout, NULL);
|
||||||
fx_stream_write_char(fx_stdout, '\n');
|
fx_stream_write_char(fx_stdout, '\n');
|
||||||
|
|
||||||
fx_object_unref(data);
|
fx_value_unset(&data);
|
||||||
fx_object_unref(src);
|
fx_object_unref(src);
|
||||||
fx_serial_ctx_unref(ctx);
|
fx_serial_ctx_unref(ctx);
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -22,21 +22,21 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
|
fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
|
||||||
|
|
||||||
fx_object *data = NULL;
|
fx_value data = FX_VALUE_EMPTY;
|
||||||
result = fx_serial_ctx_deserialise(ctx, src, &data, 0);
|
result = fx_serial_ctx_deserialise(ctx, src, &data, 0);
|
||||||
if (fx_result_is_error(result)) {
|
if (fx_result_is_error(result)) {
|
||||||
fx_throw(result);
|
fx_throw(result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (!fx_value_is_set(&data)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fx_object_to_string(data, fx_stdout, NULL);
|
fx_value_to_string(&data, fx_stdout, NULL);
|
||||||
fx_stream_write_char(fx_stdout, '\n');
|
fx_stream_write_char(fx_stdout, '\n');
|
||||||
|
|
||||||
fx_object_unref(data);
|
fx_value_unset(&data);
|
||||||
fx_object_unref(src);
|
fx_object_unref(src);
|
||||||
fx_serial_ctx_unref(ctx);
|
fx_serial_ctx_unref(ctx);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user