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

Unified Diff: third_party/protobuf/conformance/conformance_ruby.rb

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_ruby.rb
diff --git a/third_party/protobuf/conformance/conformance_ruby.rb b/third_party/protobuf/conformance/conformance_ruby.rb
index cd065673062f7a1c6ab573891db186e3e6dc33de..c716facdd6f3f9acc8638df39ef4b35848cc7868 100755
--- a/third_party/protobuf/conformance/conformance_ruby.rb
+++ b/third_party/protobuf/conformance/conformance_ruby.rb
@@ -51,7 +51,12 @@ def do_test(request)
end
when :json_payload
- test_message = Conformance::TestAllTypes.decode_json(request.json_payload)
+ begin
+ test_message = Conformance::TestAllTypes.decode_json(request.json_payload)
+ rescue Google::Protobuf::ParseError => err
+ response.parse_error = err.message.encode('utf-8')
+ return response
+ end
when nil
fail "Request didn't have payload"
@@ -66,6 +71,9 @@ def do_test(request)
when :JSON
response.json_payload = test_message.to_json
+
+ when nil
+ fail "Request didn't have requested output format"
end
rescue StandardError => err
response.runtime_error = err.message.encode('utf-8')
@@ -96,8 +104,8 @@ def do_test_io
STDOUT.flush
if $verbose
- STDERR.puts("conformance-cpp: request={request.to_json}, " \
- "response={response.to_json}\n")
+ STDERR.puts("conformance_ruby: request=#{request.to_json}, " \
+ "response=#{response.to_json}\n")
end
$test_count += 1
@@ -107,7 +115,7 @@ end
loop do
unless do_test_io
- STDERR.puts('conformance-cpp: received EOF from test runner ' \
+ STDERR.puts('conformance_ruby: received EOF from test runner ' \
"after #{$test_count} tests, exiting")
break
end
« no previous file with comments | « third_party/protobuf/conformance/conformance_objc.m ('k') | third_party/protobuf/conformance/conformance_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698