test: update i/o api usage re: b_error
This commit is contained in:
@@ -14,9 +14,9 @@ int main(int argc, const char **argv)
|
||||
b_path *path = b_path_create_from_cstr(path_cstr);
|
||||
|
||||
b_file *file = NULL;
|
||||
b_status status = b_file_open(NULL, path, B_FILE_READ_ONLY, &file);
|
||||
if (!B_OK(status)) {
|
||||
fprintf(stderr, "cannot open file %s\n", path_cstr);
|
||||
b_result result = b_file_open(NULL, path, B_FILE_READ_ONLY, &file);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
return -1;
|
||||
}
|
||||
b_stream *src_stream, *dest_stream;
|
||||
@@ -25,7 +25,7 @@ int main(int argc, const char **argv)
|
||||
|
||||
b_string *str = b_string_create();
|
||||
b_stream_pipeline *pipeline;
|
||||
status = b_string_open_stream(str, &dest_stream);
|
||||
b_status status = b_string_open_stream(str, &dest_stream);
|
||||
|
||||
b_stream_pipeline_create(1024, &pipeline);
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ int main(int argc, const char **argv)
|
||||
b_path *path = b_path_create_from_cstr(path_cstr);
|
||||
|
||||
b_file *file = NULL;
|
||||
b_status status = b_file_open(NULL, path, B_FILE_READ_ONLY, &file);
|
||||
if (!B_OK(status)) {
|
||||
fprintf(stderr, "cannot open file %s\n", path_cstr);
|
||||
b_result result = b_file_open(NULL, path, B_FILE_READ_ONLY, &file);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ int main(int argc, const char **argv)
|
||||
b_serial_ctx_create(&ctx);
|
||||
|
||||
b_object *data;
|
||||
status = b_serial_ctx_deserialise(
|
||||
b_status status = b_serial_ctx_deserialise(
|
||||
ctx, B_SERIAL_FORMAT_JSON, src_stream, &data, 0);
|
||||
if (!B_OK(status)) {
|
||||
fprintf(stderr, "cannot read data\n");
|
||||
|
||||
Reference in New Issue
Block a user