diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-06-04 15:04:00 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-06-04 15:04:00 -0700 |
commit | 23bf3b566f4bd1c5d73a5d093e2d0a45ee81ff27 (patch) | |
tree | a7c08a7874fe602bab8d0f466443712d68e2c18a /conformance/conformance_test.cc | |
parent | d2b67389b30d1bff1080be3a3d8d7cfb0b81b867 (diff) | |
download | protobuf-23bf3b566f4bd1c5d73a5d093e2d0a45ee81ff27.tar.gz protobuf-23bf3b566f4bd1c5d73a5d093e2d0a45ee81ff27.tar.bz2 protobuf-23bf3b566f4bd1c5d73a5d093e2d0a45ee81ff27.zip |
Removed test_name from conformance.proto.
Change-Id: I382dcda97fa123a6da4ff5faad5d7ece95853f33
Diffstat (limited to 'conformance/conformance_test.cc')
-rw-r--r-- | conformance/conformance_test.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index d441137d..7a7fc6f5 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -164,9 +164,9 @@ void ConformanceTestSuite::ReportSuccess(const string& test_name) { void ConformanceTestSuite::ReportFailure(const string& test_name, const char* fmt, ...) { if (expected_to_fail_.erase(test_name) == 1) { - StringAppendF(&output_, "FAILED AS EXPECTED: "); + StringAppendF(&output_, "FAILED AS EXPECTED, test=%s: ", test_name.c_str()); } else { - StringAppendF(&output_, "ERROR: "); + StringAppendF(&output_, "ERROR, test=%s: ", test_name.c_str()); unexpected_failing_tests_.insert(test_name); } va_list args; @@ -176,10 +176,11 @@ void ConformanceTestSuite::ReportFailure(const string& test_name, failures_++; } -void ConformanceTestSuite::RunTest(const ConformanceRequest& request, +void ConformanceTestSuite::RunTest(const string& test_name, + const ConformanceRequest& request, ConformanceResponse* response) { - if (test_names_.insert(request.test_name()).second == false) { - GOOGLE_LOG(FATAL) << "Duplicated test name: " << request.test_name(); + if (test_names_.insert(test_name).second == false) { + GOOGLE_LOG(FATAL) << "Duplicated test name: " << test_name; } string serialized_request; @@ -194,7 +195,8 @@ void ConformanceTestSuite::RunTest(const ConformanceRequest& request, } if (verbose_) { - StringAppendF(&output_, "conformance test: request=%s, response=%s\n", + StringAppendF(&output_, "conformance test: name=%s, request=%s, response=%s\n", + test_name.c_str(), request.ShortDebugString().c_str(), response->ShortDebugString().c_str()); } @@ -205,14 +207,13 @@ void ConformanceTestSuite::ExpectParseFailureForProto( const string& proto, const string& test_name) { ConformanceRequest request; ConformanceResponse response; - request.set_test_name(test_name); request.set_protobuf_payload(proto); // We don't expect output, but if the program erroneously accepts the protobuf // we let it send its response as this. We must not leave it unspecified. request.set_requested_output(ConformanceRequest::PROTOBUF); - RunTest(request, &response); + RunTest(test_name, request, &response); if (response.result_case() == ConformanceResponse::kParseError) { ReportSuccess(test_name); } else { |