aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-05-30 16:17:06 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-06-05 16:59:25 -0700
commit9a1bb051812a53462b2deb7e472f20e3e1dd785f (patch)
tree8a7b99a4aa4d872f998f6cadee4f7387bc6bfc67 /test/cpp/util
parent23c50fda51a38d0484f4b1537492fd93eeae33ac (diff)
Build out the channelz unit test
Diffstat (limited to 'test/cpp/util')
-rw-r--r--test/cpp/util/channel_trace_proto_helper.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/cpp/util/channel_trace_proto_helper.cc b/test/cpp/util/channel_trace_proto_helper.cc
index db9390163b..ee310784c2 100644
--- a/test/cpp/util/channel_trace_proto_helper.cc
+++ b/test/cpp/util/channel_trace_proto_helper.cc
@@ -45,16 +45,21 @@ void VaidateProtoJsonTranslation(char* json_c_str) {
// then compare the output, and determine what fields are missing.
//
// parse_options.ignore_unknown_fields = true;
- ASSERT_EQ(google::protobuf::util::JsonStringToMessage(json_str, &msg,
+ EXPECT_EQ(google::protobuf::util::JsonStringToMessage(json_str, &msg,
parse_options),
google::protobuf::util::Status::OK);
std::string proto_json_str;
- ASSERT_EQ(google::protobuf::util::MessageToJsonString(msg, &proto_json_str),
+ google::protobuf::util::JsonPrintOptions print_options;
+ // We usually do not want this to be true, however it can be helpful to
+ // uncomment and see the output produced then all fields are printed.
+ // print_options.always_print_primitive_fields = true;
+ EXPECT_EQ(google::protobuf::util::MessageToJsonString(msg, &proto_json_str,
+ print_options),
google::protobuf::util::Status::OK);
// uncomment these to compare the the json strings.
// gpr_log(GPR_ERROR, "tracer json: %s", json_str.c_str());
// gpr_log(GPR_ERROR, "proto json: %s", proto_json_str.c_str());
- ASSERT_EQ(json_str, proto_json_str);
+ EXPECT_EQ(json_str, proto_json_str);
}
} // namespace