Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: third_party/protobuf/conformance/conformance_test.cc

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/conformance/conformance_test.cc
diff --git a/third_party/protobuf/conformance/conformance_test.cc b/third_party/protobuf/conformance/conformance_test.cc
index 135e82dc4a0094660d2b5a53277b38339674f2bf..fc0605bfc4a20bcd9fc81c3a4b1b20478fc52a14 100644
--- a/third_party/protobuf/conformance/conformance_test.cc
+++ b/third_party/protobuf/conformance/conformance_test.cc
@@ -299,7 +299,13 @@ void ConformanceTestSuite::RunValidInputTest(
return;
}
- GOOGLE_CHECK(test_message.ParseFromString(binary_protobuf));
+ if (!test_message.ParseFromString(binary_protobuf)) {
+ ReportFailure(test_name, request, response,
+ "INTERNAL ERROR: internal JSON->protobuf transcode "
+ "yielded unparseable proto.");
+ return;
+ }
+
break;
}
@@ -356,6 +362,8 @@ void ConformanceTestSuite::ExpectParseFailureForProto(
RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kParseError) {
ReportSuccess(effective_test_name);
+ } else if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
} else {
ReportFailure(effective_test_name, request, response,
"Should have failed to parse, but didn't.");
@@ -408,6 +416,11 @@ void ConformanceTestSuite::RunValidJsonTestWithValidator(
RunTest(effective_test_name, request, &response);
+ if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
+ return;
+ }
+
if (response.result_case() != ConformanceResponse::kJsonPayload) {
ReportFailure(effective_test_name, request, response,
"Expected JSON payload but got type %d.",
@@ -444,6 +457,8 @@ void ConformanceTestSuite::ExpectParseFailureForJson(
RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kParseError) {
ReportSuccess(effective_test_name);
+ } else if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
} else {
ReportFailure(effective_test_name, request, response,
"Should have failed to parse, but didn't.");
@@ -466,6 +481,8 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson(
RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kSerializeError) {
ReportSuccess(effective_test_name);
+ } else if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
} else {
ReportFailure(effective_test_name, request, response,
"Should have failed to serialize, but didn't.");
@@ -1967,9 +1984,6 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
"These tests succeeded, even though they were listed in "
"the failure list. Remove them from the failure list");
- CheckSetEmpty(skipped_,
- "These tests were skipped (probably because support for some "
- "features is not implemented)");
if (verbose_) {
CheckSetEmpty(skipped_,
"These tests were skipped (probably because support for some "
« no previous file with comments | « third_party/protobuf/conformance/conformance_ruby.rb ('k') | third_party/protobuf/conformance/conformance_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698