aboutsummaryrefslogtreecommitdiffhomepage
path: root/conformance/conformance_test.cc
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2016-01-05 16:31:40 -0500
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-01-05 16:31:40 -0500
commitdf4e4d8717987232499b9be50b24adac179528b3 (patch)
treec1b93f94c828a4ffe93a6118a354bc0ad815d1f2 /conformance/conformance_test.cc
parentd19c26f2c878883f103d9dd4d6c53bc20482756f (diff)
Fix up the conformance tests
- Update all the new runner cases to handle a skip result as a skip and not a failure. - Make ObjC use the new serialize_error result if it fails to generate the data.
Diffstat (limited to 'conformance/conformance_test.cc')
-rw-r--r--conformance/conformance_test.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc
index c39bf26d..a232ecc5 100644
--- a/conformance/conformance_test.cc
+++ b/conformance/conformance_test.cc
@@ -356,6 +356,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 +410,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 +451,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 +475,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.");