From 521ac7a89adb97bcd1781b4131333554ccd4de87 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 27 Aug 2011 20:36:34 -0700 Subject: Refined upb_status. --- tests/test_decoder.c | 6 ++---- tests/test_vs_proto2.cc | 7 +++---- tests/tests.c | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/test_decoder.c b/tests/test_decoder.c index e3fc1ea..2f3cc36 100644 --- a/tests/test_decoder.c +++ b/tests/test_decoder.c @@ -22,8 +22,7 @@ int main(int argc, char *argv[]) { upb_status status = UPB_STATUS_INIT; upb_read_descriptor(symtab, desc, desc_len, &status); if (!upb_ok(&status)) { - fprintf(stderr, "Error parsing descriptor: "); - upb_status_print(&status, stderr); + fprintf(stderr, "Error parsing descriptor: %s", upb_status_getstr(&status)); return 1; } free((void*)desc); @@ -59,8 +58,7 @@ int main(int argc, char *argv[]) { upb_decoder_decode(&d, &status); if (!upb_ok(&status)) { - fprintf(stderr, "Error parsing input: "); - upb_status_print(&status, stderr); + fprintf(stderr, "Error parsing input: %s", upb_status_getstr(&status)); } upb_status_uninit(&status); diff --git a/tests/test_vs_proto2.cc b/tests/test_vs_proto2.cc index b22c620..a313aa5 100644 --- a/tests/test_vs_proto2.cc +++ b/tests/test_vs_proto2.cc @@ -188,8 +188,7 @@ void parse_and_compare(MESSAGE_CIDENT *proto2_msg, upb_msg_clear(upb_msg, upb_md); upb_strtomsg(str, len, upb_msg, upb_md, &status); if (!upb_ok(&status)) { - fprintf(stderr, "Error parsing test protobuf: "); - upb_status_print(&status, stderr); + fprintf(stderr, "Error parsing protobuf: %s", upb_status_getstr(&status)); exit(1); } string_size = 0; @@ -226,8 +225,8 @@ int main(int argc, char *argv[]) } upb_read_descriptor(symtab, fds, fds_len, &status); if(!upb_ok(&status)) { - fprintf(stderr, "Error importing " MESSAGE_DESCRIPTOR_FILE ": "); - upb_status_print(&status, stderr); + fprintf(stderr, "Error importing " MESSAGE_DESCRIPTOR_FILE ": %s", + upb_status_getstr(&status)); return 1; } free((void*)fds); diff --git a/tests/tests.c b/tests/tests.c index 7941c2f..fc8e11d 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -19,7 +19,6 @@ static upb_symtab *load_test_proto() { } upb_status status = UPB_STATUS_INIT; upb_read_descriptor(s, descriptor, len, &status); - upb_status_print(&status, stderr); ASSERT(upb_ok(&status)); upb_status_uninit(&status); free(descriptor); -- cgit v1.2.3