From c3093d3ee5f1d8e6264b3858d0ae44feddbf23c0 Mon Sep 17 00:00:00 2001 From: Chris Nix Date: Thu, 4 May 2017 09:50:37 +0100 Subject: [PATCH 01/61] Fix issue 3046: compilation on alpine 3.5 --- src/google/protobuf/compiler/mock_code_generator.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc index 0ddb99e56e..8b7a614612 100644 --- a/src/google/protobuf/compiler/mock_code_generator.cc +++ b/src/google/protobuf/compiler/mock_code_generator.cc @@ -55,6 +55,13 @@ #include #include +#ifdef major +#undef major +#endif +#ifdef minor +#undef minor +#endif + namespace google { namespace protobuf { namespace compiler { From 22c8772e21be4b1bf9722e44164ed2e93f18a9b9 Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Sun, 19 Mar 2017 13:51:20 +0000 Subject: [PATCH 02/61] Fix #1562 by using goog.crypt.byteArrayToString instead of String.fromCharCode.apply --- js/binary/decoder.js | 2 +- js/binary/utils.js | 2 +- js/binary/utils_test.js | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/js/binary/decoder.js b/js/binary/decoder.js index ad9cb01bd5..6db28e7c33 100644 --- a/js/binary/decoder.js +++ b/js/binary/decoder.js @@ -994,7 +994,7 @@ jspb.BinaryDecoder.prototype.readString = function(length) { codeUnits.length = 0; } } - result += String.fromCharCode.apply(null, codeUnits); + result += goog.crypt.byteArrayToString(codeUnits); this.cursor_ = cursor; return result; }; diff --git a/js/binary/utils.js b/js/binary/utils.js index 7702020b56..df16249ec4 100644 --- a/js/binary/utils.js +++ b/js/binary/utils.js @@ -613,7 +613,7 @@ jspb.utils.decimalStringToHash64 = function(dec) { muladd(1, 1); } - return String.fromCharCode.apply(null, resultBytes); + return goog.crypt.byteArrayToString(resultBytes); }; diff --git a/js/binary/utils_test.js b/js/binary/utils_test.js index d27e5ea2c6..0a2f4f0a2d 100644 --- a/js/binary/utils_test.js +++ b/js/binary/utils_test.js @@ -205,31 +205,31 @@ describe('binaryUtilsTest', function() { var convert = jspb.utils.decimalStringToHash64; result = convert('0'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), result); result = convert('-1'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]), result); result = convert('18446744073709551615'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]), result); result = convert('9223372036854775808'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80]), result); result = convert('-9223372036854775808'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80]), result); result = convert('123456789123456789'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0x15, 0x5F, 0xD0, 0xAC, 0x4B, 0x9B, 0xB6, 0x01]), result); result = convert('-123456789123456789'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0xEB, 0xA0, 0x2F, 0x53, 0xB4, 0x64, 0x49, 0xFE]), result); }); @@ -259,21 +259,21 @@ describe('binaryUtilsTest', function() { var convert = jspb.utils.hexStringToHash64; result = convert('0x0000000000000000'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), result); result = convert('0xffffffffffffffff'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]), result); // Hex string is big-endian, hash string is little-endian. result = convert('0x123456789ABCDEF0'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12]), result); // Capitalization should not matter. result = convert('0x0000abcdefABCDEF'); - assertEquals(String.fromCharCode.apply(null, + assertEquals(goog.crypt.byteArrayToString( [0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB, 0x00, 0x00]), result); }); @@ -643,7 +643,7 @@ describe('binaryUtilsTest', function() { var sourceBytes = new Uint8Array(sourceData); var sourceBuffer = sourceBytes.buffer; var sourceBase64 = goog.crypt.base64.encodeByteArray(sourceData); - var sourceString = String.fromCharCode.apply(null, sourceData); + var sourceString = goog.crypt.byteArrayToString(sourceData); function check(result) { assertEquals(Uint8Array, result.constructor); From 8859c07a35d9c2c02b6565627fbbc87c152cb731 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Thu, 4 May 2017 15:11:11 -0700 Subject: [PATCH 03/61] Add missing files to build files. --- BUILD | 1 + cmake/extract_includes.bat.in | 2 ++ cmake/libprotobuf.cmake | 1 + src/Makefile.am | 1 + src/google/protobuf/generated_message_table_driven.cc | 6 +++--- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index e5662c4d7a..da152495da 100644 --- a/BUILD +++ b/BUILD @@ -128,6 +128,7 @@ cc_library( "src/google/protobuf/extension_set_heavy.cc", "src/google/protobuf/field_mask.pb.cc", "src/google/protobuf/generated_message_reflection.cc", + "src/google/protobuf/generated_message_table_driven.cc", "src/google/protobuf/io/gzip_stream.cc", "src/google/protobuf/io/printer.cc", "src/google/protobuf/io/strtod.cc", diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index 245e917fc2..3faf33f5f9 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -50,6 +50,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.pb.h" incl copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_reflection.h" include\google\protobuf\generated_enum_reflection.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_util.h" include\google\protobuf\generated_enum_util.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_reflection.h" include\google\protobuf\generated_message_reflection.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_table_driven.h" include\google\protobuf\generated_message_table_driven.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h @@ -70,6 +71,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_type_handler.h" i copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message.h" include\google\protobuf\message.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message_lite.h" include\google\protobuf\message_lite.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata.h" include\google\protobuf\metadata.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata_lite.h" include\google\protobuf\metadata_lite.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection.h" include\google\protobuf\reflection.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection_ops.h" include\google\protobuf\reflection_ops.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_field.h" include\google\protobuf\repeated_field.h diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index 5313d39ef8..faecf2e601 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -13,6 +13,7 @@ set(libprotobuf_files ${protobuf_source_dir}/src/google/protobuf/extension_set_heavy.cc ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.cc + ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven.cc ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.cc ${protobuf_source_dir}/src/google/protobuf/io/printer.cc ${protobuf_source_dir}/src/google/protobuf/io/strtod.cc diff --git a/src/Makefile.am b/src/Makefile.am index bfb875acf4..5c19bcdc2d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -250,6 +250,7 @@ libprotobuf_la_SOURCES = \ google/protobuf/extension_set_heavy.cc \ google/protobuf/field_mask.pb.cc \ google/protobuf/generated_message_reflection.cc \ + google/protobuf/generated_message_table_driven.cc \ google/protobuf/map_field.cc \ google/protobuf/message.cc \ google/protobuf/reflection_internal.h \ diff --git a/src/google/protobuf/generated_message_table_driven.cc b/src/google/protobuf/generated_message_table_driven.cc index e281266dfe..f8fda9c624 100644 --- a/src/google/protobuf/generated_message_table_driven.cc +++ b/src/google/protobuf/generated_message_table_driven.cc @@ -74,7 +74,7 @@ inline Arena* GetArena(MessageLite* msg, int64 arena_offset) { template inline Type* AddField(MessageLite* msg, int64 offset) { #if LANG_CXX11 - static_assert(std::is_trivially_copy_assignable::value, + static_assert(google::protobuf::internal::has_trivial_copy::value, "Do not assign"); #endif @@ -94,7 +94,7 @@ inline string* AddField(MessageLite* msg, int64 offset) { template inline void AddField(MessageLite* msg, int64 offset, Type value) { #if LANG_CXX11 - static_assert(std::is_trivially_copy_assignable::value, + static_assert(google::protobuf::internal::has_trivial_copy::value, "Do not assign"); #endif *AddField(msg, offset) = value; @@ -118,7 +118,7 @@ template inline void SetField(MessageLite* msg, uint32* has_bits, uint32 has_bit_index, int64 offset, Type value) { #if LANG_CXX11 - static_assert(std::is_trivially_copy_assignable::value, + static_assert(google::protobuf::internal::has_trivial_copy::value, "Do not assign"); #endif *MutableField(msg, has_bits, has_bit_index, offset) = value; From 3a5a0724f300e9c7de98851a0bbaaa4363981486 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Thu, 4 May 2017 15:24:55 -0700 Subject: [PATCH 04/61] Skip C# test in C++ only distribution. --- .../protobuf/compiler/csharp/csharp_bootstrap_unittest.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc index 4e44b578e8..5c54270e4c 100644 --- a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc +++ b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc @@ -134,6 +134,14 @@ class GenerateAndTest { }; TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) { + // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11 + // only distribution). + string descriptor_file_name = + "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs"; + if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) { + return; + } + MockErrorCollector error_collector; DiskSourceTree source_tree; Importer importer(&source_tree, &error_collector); From 7378ec2bc8da17ba4b1050dbb1ff05425f05537e Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Thu, 4 May 2017 15:27:30 -0700 Subject: [PATCH 05/61] Add missing LIBRPOTOC_EXPORT. --- src/google/protobuf/compiler/code_generator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h index b917d37334..6ea5f18db0 100644 --- a/src/google/protobuf/compiler/code_generator.h +++ b/src/google/protobuf/compiler/code_generator.h @@ -162,8 +162,8 @@ typedef GeneratorContext OutputDirectory; // "foo=bar,baz,qux=corge" // parses to the pairs: // ("foo", "bar"), ("baz", ""), ("qux", "corge") -extern void ParseGeneratorParameter(const string&, - std::vector >*); +LIBPROTOC_EXPORT void ParseGeneratorParameter( + const string&, std::vector >*); } // namespace compiler } // namespace protobuf From e82d81a8843c1aa99b3d33f5478ac3b8ad127982 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 5 May 2017 22:04:28 +0100 Subject: [PATCH 06/61] Fix offset type to match the tables it is used in --- src/google/protobuf/generated_message_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index 44174466a8..299d95b6bc 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -100,7 +100,7 @@ namespace internal { // choose 16 rather than some other number just in case the compiler would // be confused by an unaligned pointer. #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \ - static_cast( \ + static_cast<::google::protobuf::uint32>( \ reinterpret_cast( \ &reinterpret_cast(16)->FIELD) - \ reinterpret_cast(16)) From e062f70c6d2e981686caa39e44701f7aaa6c66ed Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Sat, 6 May 2017 09:08:44 +0100 Subject: [PATCH 07/61] Fix compilation <: is a digraph, so a space is necessary for compilation on certain compilers. --- src/google/protobuf/generated_message_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index 299d95b6bc..b9654ece5d 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -100,7 +100,7 @@ namespace internal { // choose 16 rather than some other number just in case the compiler would // be confused by an unaligned pointer. #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \ - static_cast<::google::protobuf::uint32>( \ + static_cast< ::google::protobuf::uint32>( \ reinterpret_cast( \ &reinterpret_cast(16)->FIELD) - \ reinterpret_cast(16)) From 9b82fce7f1a5c7ce067866f06136e45fe9518cb2 Mon Sep 17 00:00:00 2001 From: "Mario J. Rugiero" Date: Fri, 5 May 2017 13:52:58 -0300 Subject: [PATCH 08/61] Workaround gcc < 4.5.0 bug See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=189 Signed-off-by: Mario J. Rugiero --- src/google/protobuf/metadata_lite.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/metadata_lite.h b/src/google/protobuf/metadata_lite.h index 840c02e82e..64fde0c6c6 100644 --- a/src/google/protobuf/metadata_lite.h +++ b/src/google/protobuf/metadata_lite.h @@ -167,7 +167,8 @@ class InternalMetadataWithArenaLite InternalMetadataWithArenaLite() {} explicit InternalMetadataWithArenaLite(Arena* arena) - : InternalMetadataWithArenaBase(arena) {} + : InternalMetadataWithArenaBase(arena) {} void DoSwap(string* other) { mutable_unknown_fields()->swap(*other); From 58538ea91979faa4f8b9841238c53a2276dd3856 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Mon, 8 May 2017 16:02:08 -0700 Subject: [PATCH 09/61] Update version number to 3.3.1 --- Protobuf.podspec | 2 +- configure.ac | 2 +- csharp/Google.Protobuf.Tools.nuspec | 2 +- csharp/src/Google.Protobuf/project.json | 2 +- java/core/pom.xml | 2 +- java/pom.xml | 2 +- java/util/pom.xml | 2 +- js/package.json | 2 +- php/ext/google/protobuf/package.xml | 18 +++++++++++++++++- php/ext/google/protobuf/protobuf.h | 2 +- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/__init__.py | 2 +- ruby/google-protobuf.gemspec | 2 +- src/Makefile.am | 6 +++--- src/google/protobuf/stubs/common.h | 2 +- 15 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Protobuf.podspec b/Protobuf.podspec index 649f3ae3e1..ffaf7a72fe 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '3.3.0' + s.version = '3.3.1' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/google/protobuf' s.license = '3-Clause BSD License' diff --git a/configure.ac b/configure.ac index 82b221e84c..e06ebe5f9c 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.3.0],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.3.1],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 182309bf13..18a03f59af 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,7 +5,7 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.3.0 + 3.3.1 Google Inc. protobuf-packages https://github.com/google/protobuf/blob/master/LICENSE diff --git a/csharp/src/Google.Protobuf/project.json b/csharp/src/Google.Protobuf/project.json index f437623895..6596ddf6cd 100644 --- a/csharp/src/Google.Protobuf/project.json +++ b/csharp/src/Google.Protobuf/project.json @@ -1,5 +1,5 @@ { - "version": "3.3.0", + "version": "3.3.1", "title": "Google Protocol Buffers", "description": "See project site for more info.", "authors": [ "Google Inc." ], diff --git a/java/core/pom.xml b/java/core/pom.xml index 9c4e1b930b..24bc58c713 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -6,7 +6,7 @@ com.google.protobuf protobuf-parent - 3.3.0 + 3.3.1 protobuf-java diff --git a/java/pom.xml b/java/pom.xml index 81ffc48a31..2c2f4413f0 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -11,7 +11,7 @@ com.google.protobuf protobuf-parent - 3.3.0 + 3.3.1 pom Protocol Buffers [Parent] diff --git a/java/util/pom.xml b/java/util/pom.xml index c72fa65090..8a54e10d2b 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -6,7 +6,7 @@ com.google.protobuf protobuf-parent - 3.3.0 + 3.3.1 protobuf-java-util diff --git a/js/package.json b/js/package.json index 14f54b8bfd..b7343cc395 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.3.0", + "version": "3.3.1", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index a2a8e0668c..7bbc2792a9 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -13,7 +13,7 @@ 2017-01-13 - 3.3.0 + 3.3.1 3.3.0 @@ -100,6 +100,22 @@ Second alpha release. 3-Clause BSD License +GA release. + + + + + 3.3.1 + 3.3.0 + + + stable + stable + + 2017-05-08 + + 3-Clause BSD License + GA release. diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index e6d42ebacc..c3374af3f8 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -37,7 +37,7 @@ #include "upb.h" #define PHP_PROTOBUF_EXTNAME "protobuf" -#define PHP_PROTOBUF_VERSION "3.3.0" +#define PHP_PROTOBUF_VERSION "3.3.1" #define MAX_LENGTH_OF_INT64 20 #define SIZEOF_INT64 8 diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index a06c99982a..eeb2987f2b 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protoc - 3.3.0 + 3.3.1 pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 0375d72d0d..8628edd785 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,7 +30,7 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.3.0' +__version__ = '3.3.1' if __name__ != '__main__': try: diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 836b1dd282..8aff7bf0f4 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.3.0" + s.version = "3.3.1" s.licenses = ["BSD-3-Clause"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." diff --git a/src/Makefile.am b/src/Makefile.am index 5c19bcdc2d..4524aeb275 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -184,7 +184,7 @@ nobase_include_HEADERS = \ lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_lite_la_LDFLAGS = -version-info 13:0:0 -export-dynamic -no-undefined +libprotobuf_lite_la_LDFLAGS = -version-info 13:1:0 -export-dynamic -no-undefined if HAVE_LD_VERSION_SCRIPT libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map @@ -229,7 +229,7 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/io/zero_copy_stream_impl_lite.cc libprotobuf_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_la_LDFLAGS = -version-info 13:0:0 -export-dynamic -no-undefined +libprotobuf_la_LDFLAGS = -version-info 13:1:0 -export-dynamic -no-undefined if HAVE_LD_VERSION_SCRIPT libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map @@ -319,7 +319,7 @@ libprotobuf_la_SOURCES = \ nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -version-info 13:0:0 -export-dynamic -no-undefined +libprotoc_la_LDFLAGS = -version-info 13:1:0 -export-dynamic -no-undefined if HAVE_LD_VERSION_SCRIPT libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index 35fdf96b73..15321ebe76 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -96,7 +96,7 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3003000 +#define GOOGLE_PROTOBUF_VERSION 3003001 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" From 757cc9f9dadf370b3ff075a047a3f9a1ce18356b Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Mon, 8 May 2017 16:58:13 -0700 Subject: [PATCH 10/61] Update C++ generated code. --- src/google/protobuf/any.pb.h | 2 +- src/google/protobuf/api.pb.h | 2 +- src/google/protobuf/compiler/plugin.pb.h | 2 +- src/google/protobuf/compiler/profile.pb.h | 2 +- src/google/protobuf/descriptor.pb.h | 2 +- src/google/protobuf/duration.pb.h | 2 +- src/google/protobuf/empty.pb.h | 2 +- src/google/protobuf/field_mask.pb.h | 2 +- src/google/protobuf/source_context.pb.h | 2 +- src/google/protobuf/struct.pb.h | 2 +- src/google/protobuf/timestamp.pb.h | 2 +- src/google/protobuf/type.pb.h | 2 +- src/google/protobuf/wrappers.pb.h | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index bc05fb35c8..ef3667984a 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 108c63a424..36bf43c7a3 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 4f8befb6ed..843436881a 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/compiler/profile.pb.h b/src/google/protobuf/compiler/profile.pb.h index d20b87ed68..0b023eb01e 100644 --- a/src/google/protobuf/compiler/profile.pb.h +++ b/src/google/protobuf/compiler/profile.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index d1ed2b1f51..ef77e6ebda 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index 34873d9744..d9cd405de9 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index f28dc19beb..c318cceb2b 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index 742c1cf9b8..c63cbad7b2 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index 23cd7f3ec2..1c72780c1f 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index a37a5652a9..3f2d8bc0f1 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index 9847854037..abc997ebcf 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index c1cd41640d..6e3d997ae4 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h index 4202541b6c..9a91be3d93 100644 --- a/src/google/protobuf/wrappers.pb.h +++ b/src/google/protobuf/wrappers.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. From 22319315df18526277873058f79cf69e77d8b4a2 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 10 May 2017 15:59:59 -0700 Subject: [PATCH 11/61] Fix c extension for php7.1. (#3077) --- jenkins/docker/Dockerfile | 15 +++++++- jenkins/docker32/Dockerfile | 63 +++++++++++++++++++------------ php/ext/google/protobuf/message.c | 8 ++++ tests.sh | 37 ++++++++++++++++++ 4 files changed, 98 insertions(+), 25 deletions(-) diff --git a/jenkins/docker/Dockerfile b/jenkins/docker/Dockerfile index 9c9ee56b8c..3173afbfe8 100644 --- a/jenkins/docker/Dockerfile +++ b/jenkins/docker/Dockerfile @@ -164,6 +164,14 @@ RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php RUN cd php-7.0.18 && make clean && ./configure --prefix=/usr/local/php-7.0 && \ make && make install && cd .. +RUN wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror +RUN mv mirror php-7.1.4.tar.bz2 +RUN tar -xvf php-7.1.4.tar.bz2 +RUN cd php-7.1.4 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.1-zts && \ + make && make install && cd .. +RUN cd php-7.1.4 && make clean && ./configure --prefix=/usr/local/php-7.1 && \ + make && make install && cd .. + RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" RUN php composer-setup.php RUN mv composer.phar /usr/bin/composer @@ -190,7 +198,12 @@ RUN cd /tmp && \ ln -sfn /usr/local/php-7.0/bin/php-config /usr/bin/php-config && \ ln -sfn /usr/local/php-7.0/bin/phpize /usr/bin/phpize && \ composer install && \ - mv vendor /usr/local/vendor-7.0 + mv vendor /usr/local/vendor-7.0 && \ + ln -sfn /usr/local/php-7.1/bin/php /usr/bin/php && \ + ln -sfn /usr/local/php-7.1/bin/php-config /usr/bin/php-config && \ + ln -sfn /usr/local/php-7.1/bin/phpize /usr/bin/phpize && \ + composer install && \ + mv vendor /usr/local/vendor-7.1 ################## # Go dependencies. diff --git a/jenkins/docker32/Dockerfile b/jenkins/docker32/Dockerfile index ab3fd9578b..c6813b07d5 100644 --- a/jenkins/docker32/Dockerfile +++ b/jenkins/docker32/Dockerfile @@ -57,30 +57,6 @@ RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ ################## # PHP dependencies. -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -RUN php composer-setup.php -RUN mv composer.phar /usr/bin/composer -RUN php -r "unlink('composer-setup.php');" -RUN cd /tmp && \ - git clone https://github.com/google/protobuf.git && \ - cd protobuf/php && \ - git reset --hard 6b27c1f981a9a93918e4039f236ead27165a8e91 && \ - ln -sfn /usr/bin/php5.5 /usr/bin/php && \ - ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config && \ - ln -sfn /usr/bin/phpize5.5 /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-5.5 && \ - ln -sfn /usr/bin/php5.6 /usr/bin/php && \ - ln -sfn /usr/bin/php-config5.6 /usr/bin/php-config && \ - ln -sfn /usr/bin/phpize5.6 /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-5.6 && \ - ln -sfn /usr/bin/php7.0 /usr/bin/php && \ - ln -sfn /usr/bin/php-config7.0 /usr/bin/php-config && \ - ln -sfn /usr/bin/phpize7.0 /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-7.0 - RUN wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror RUN mv mirror php-5.5.38.tar.bz2 RUN tar -xvf php-5.5.38.tar.bz2 @@ -105,6 +81,45 @@ RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php RUN cd php-7.0.18 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.0 && \ make && make install && cd .. +RUN wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror +RUN mv mirror php-7.1.4.tar.bz2 +RUN tar -xvf php-7.1.4.tar.bz2 +RUN cd php-7.1.4 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.1-zts && \ + make && make install && cd .. +RUN cd php-7.1.4 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.1 && \ + make && make install && cd .. + +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +RUN php composer-setup.php +RUN mv composer.phar /usr/bin/composer +RUN php -r "unlink('composer-setup.php');" +RUN composer config -g -- disable-tls true +RUN composer config -g -- secure-http false +RUN cd /tmp && \ + git clone https://github.com/google/protobuf.git && \ + cd protobuf/php && \ + git reset --hard 6b27c1f981a9a93918e4039f236ead27165a8e91 && \ + ln -sfn /usr/local/php-5.5/bin/php /usr/bin/php && \ + ln -sfn /usr/local/php-5.5/bin/php-config /usr/bin/php-config && \ + ln -sfn /usr/local/php-5.5/bin/phpize /usr/bin/phpize && \ + composer install && \ + mv vendor /usr/local/vendor-5.5 && \ + ln -sfn /usr/local/php-5.6/bin/php /usr/bin/php && \ + ln -sfn /usr/local/php-5.6/bin/php-config /usr/bin/php-config && \ + ln -sfn /usr/local/php-5.6/bin/phpize /usr/bin/phpize && \ + composer install && \ + mv vendor /usr/local/vendor-5.6 && \ + ln -sfn /usr/local/php-7.0/bin/php /usr/bin/php && \ + ln -sfn /usr/local/php-7.0/bin/php-config /usr/bin/php-config && \ + ln -sfn /usr/local/php-7.0/bin/phpize /usr/bin/phpize && \ + composer install && \ + mv vendor /usr/local/vendor-7.0 && \ + ln -sfn /usr/local/php-7.1/bin/php /usr/bin/php && \ + ln -sfn /usr/local/php-7.1/bin/php-config /usr/bin/php-config && \ + ln -sfn /usr/local/php-7.1/bin/phpize /usr/bin/phpize && \ + composer install && \ + mv vendor /usr/local/vendor-7.1 + ################## # Python dependencies diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index cabc39879e..48b87b10c4 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -116,7 +116,11 @@ static void message_set_property(zval* object, zval* member, zval* value, return; } +#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0) if (Z_OBJCE_P(object) != EG(scope)) { +#else + if (Z_OBJCE_P(object) != zend_get_executed_scope()) { +#endif // User cannot set property directly (e.g., $m->a = 1) zend_error(E_USER_ERROR, "Cannot access private property."); return; @@ -146,7 +150,11 @@ static zval* message_get_property(zval* object, zval* member, int type, return PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL; } +#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0) if (Z_OBJCE_P(object) != EG(scope)) { +#else + if (Z_OBJCE_P(object) != zend_get_executed_scope()) { +#endif // User cannot get property directly (e.g., $a = $m->a) zend_error(E_USER_ERROR, "Cannot access private property."); return PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL; diff --git a/tests.sh b/tests.sh index edb37da7ac..6dc277dfb1 100755 --- a/tests.sh +++ b/tests.sh @@ -545,16 +545,51 @@ build_php7.0_mac() { popd } +build_php7.1() { + use_php 7.1 + pushd php + rm -rf vendor + cp -r /usr/local/vendor-7.1 vendor + wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit + phpunit + popd + pushd conformance + # TODO(teboring): Add it back + # make test_php + popd +} + +build_php7.1_c() { + use_php 7.1 + wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit + cd php/tests && /bin/bash ./test.sh && cd ../.. + pushd conformance + # make test_php_c + popd +} + +build_php7.1_zts_c() { + use_php_zts 7.1 + wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit + cd php/tests && /bin/bash ./test.sh && cd ../.. + pushd conformance + # make test_php_c + popd +} + build_php_all() { build_php5.5 build_php5.6 build_php7.0 + build_php7.1 build_php5.5_c build_php5.6_c build_php7.0_c + build_php7.1_c build_php5.5_zts_c build_php5.6_zts_c build_php7.0_zts_c + build_php7.1_zts_c } # Note: travis currently does not support testing more than one language so the @@ -595,6 +630,8 @@ Usage: $0 { cpp | php5.6_c | php7.0 | php7.0_c | + php7.1 | + php7.1_c | php_all) " exit 1 From de6ae7d4ebea9bf15ab3ca139a00c975826450bf Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 11 May 2017 13:56:05 -0700 Subject: [PATCH 12/61] Fix upb load descriptor when no messages defined in prorto. (#3080) --- php/ext/google/protobuf/upb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/ext/google/protobuf/upb.c b/php/ext/google/protobuf/upb.c index 70983016cb..760848e8b2 100644 --- a/php/ext/google/protobuf/upb.c +++ b/php/ext/google/protobuf/upb.c @@ -2290,6 +2290,9 @@ bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status) { bool ret; n = upb_filedef_defcount(file); + if (n == 0) { + return true; + } defs = upb_gmalloc(sizeof(*defs) * n); if (defs == NULL) { From 474cca52a3fb063c71b22d7440933cee3f2f5417 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 11 May 2017 14:52:50 -0700 Subject: [PATCH 13/61] Add LICENSE in package.xml (#3083) --- php/ext/google/protobuf/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index 7bbc2792a9..2c405aa9ac 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -40,6 +40,7 @@ GA release. + From 26f00119f2dd90a81cd54c57acfcc444b65102e8 Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Thu, 11 May 2017 15:24:58 -0700 Subject: [PATCH 14/61] Use bool deterministic to suppress warning Fixes #3059 by re-applying 08b1c718 from #3087. --- src/google/protobuf/any.pb.cc | 1 + src/google/protobuf/api.pb.cc | 3 +++ .../protobuf/compiler/cpp/cpp_message.cc | 1 + src/google/protobuf/compiler/plugin.pb.cc | 3 +++ src/google/protobuf/descriptor.pb.cc | 25 +++++++++++++++++++ src/google/protobuf/duration.pb.cc | 1 + src/google/protobuf/empty.pb.cc | 1 + src/google/protobuf/field_mask.pb.cc | 1 + src/google/protobuf/source_context.pb.cc | 1 + src/google/protobuf/struct.pb.cc | 3 +++ src/google/protobuf/timestamp.pb.cc | 1 + src/google/protobuf/type.pb.cc | 5 ++++ src/google/protobuf/wrappers.pb.cc | 9 +++++++ 13 files changed, 55 insertions(+) diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 6c80aaa24e..4bcb7125e4 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -309,6 +309,7 @@ void Any::SerializeWithCachedSizes( ::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 94c6685f57..d1bff52a85 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -482,6 +482,7 @@ void Api::SerializeWithCachedSizes( ::google::protobuf::uint8* Api::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1244,6 +1245,7 @@ void Method::SerializeWithCachedSizes( ::google::protobuf::uint8* Method::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1857,6 +1859,7 @@ void Mixin::SerializeWithCachedSizes( ::google::protobuf::uint8* Mixin::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index d9524f649c..316220c660 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -3715,6 +3715,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) { "classname", classname_); printer->Indent(); + printer->Print("(void)deterministic; // Unused\n"); printer->Print( "// @@protoc_insertion_point(serialize_to_array_start:$full_name$)\n", "full_name", descriptor_->full_name()); diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index f7dc1b7086..83b035f8c0 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -964,6 +964,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorRequest::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1573,6 +1574,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorResponse_File::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -2096,6 +2098,7 @@ void CodeGeneratorResponse::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorResponse::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 56c395e6b8..b389a4e45e 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1123,6 +1123,7 @@ void FileDescriptorSet::SerializeWithCachedSizes( ::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1720,6 +1721,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -2746,6 +2748,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -3083,6 +3086,7 @@ void DescriptorProto_ReservedRange::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -3619,6 +3623,7 @@ void DescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -4747,6 +4752,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -5689,6 +5695,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -6140,6 +6147,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -6644,6 +6652,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValueDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -7136,6 +7145,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* ServiceDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -7739,6 +7749,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* MethodDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -8838,6 +8849,7 @@ void FileOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -10182,6 +10194,7 @@ void MessageOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* MessageOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MessageOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -10778,6 +10791,7 @@ void FieldOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -11314,6 +11328,7 @@ void OneofOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* OneofOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -11659,6 +11674,7 @@ void EnumOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -12061,6 +12077,7 @@ void EnumValueOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValueOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -12419,6 +12436,7 @@ void ServiceOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* ServiceOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -12809,6 +12827,7 @@ void MethodOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* MethodOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -13219,6 +13238,7 @@ void UninterpretedOption_NamePart::SerializeWithCachedSizes( ::google::protobuf::uint8* UninterpretedOption_NamePart::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption.NamePart) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -13763,6 +13783,7 @@ void UninterpretedOption::SerializeWithCachedSizes( ::google::protobuf::uint8* UninterpretedOption::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -14562,6 +14583,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceCodeInfo_Location::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo.Location) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -15168,6 +15190,7 @@ void SourceCodeInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceCodeInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -15536,6 +15559,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( ::google::protobuf::uint8* GeneratedCodeInfo_Annotation::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo.Annotation) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -15989,6 +16013,7 @@ void GeneratedCodeInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* GeneratedCodeInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index ae1a5e08f5..7edb4f2b58 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -299,6 +299,7 @@ void Duration::SerializeWithCachedSizes( ::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 71195056f7..01f8bbcf01 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -244,6 +244,7 @@ void Empty::SerializeWithCachedSizes( ::google::protobuf::uint8* Empty::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Empty) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index 094c4cc9c2..0714f18c19 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -264,6 +264,7 @@ void FieldMask::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index 3244444aa4..203b4df2de 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -269,6 +269,7 @@ void SourceContext::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceContext::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 207e9efed7..ac53d31544 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -436,6 +436,7 @@ void Struct::SerializeWithCachedSizes( ::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -952,6 +953,7 @@ void Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1683,6 +1685,7 @@ void ListValue::SerializeWithCachedSizes( ::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index b2fe28a472..b05f61cee8 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -299,6 +299,7 @@ void Timestamp::SerializeWithCachedSizes( ::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 8f017a8921..fd61906fbc 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -667,6 +667,7 @@ void Type::SerializeWithCachedSizes( ::google::protobuf::uint8* Type::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Type) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1530,6 +1531,7 @@ void Field::SerializeWithCachedSizes( ::google::protobuf::uint8* Field::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Field) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -2466,6 +2468,7 @@ void Enum::SerializeWithCachedSizes( ::google::protobuf::uint8* Enum::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Enum) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -3047,6 +3050,7 @@ void EnumValue::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -3529,6 +3533,7 @@ void Option::SerializeWithCachedSizes( ::google::protobuf::uint8* Option::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Option) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc index 12c04fd5f0..e82736b3d3 100644 --- a/src/google/protobuf/wrappers.pb.cc +++ b/src/google/protobuf/wrappers.pb.cc @@ -392,6 +392,7 @@ void DoubleValue::SerializeWithCachedSizes( ::google::protobuf::uint8* DoubleValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DoubleValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -656,6 +657,7 @@ void FloatValue::SerializeWithCachedSizes( ::google::protobuf::uint8* FloatValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FloatValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -920,6 +922,7 @@ void Int64Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Int64Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int64Value) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1186,6 +1189,7 @@ void UInt64Value::SerializeWithCachedSizes( ::google::protobuf::uint8* UInt64Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt64Value) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1452,6 +1456,7 @@ void Int32Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Int32Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int32Value) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1718,6 +1723,7 @@ void UInt32Value::SerializeWithCachedSizes( ::google::protobuf::uint8* UInt32Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt32Value) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1984,6 +1990,7 @@ void BoolValue::SerializeWithCachedSizes( ::google::protobuf::uint8* BoolValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BoolValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -2260,6 +2267,7 @@ void StringValue::SerializeWithCachedSizes( ::google::protobuf::uint8* StringValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.StringValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -2589,6 +2597,7 @@ void BytesValue::SerializeWithCachedSizes( ::google::protobuf::uint8* BytesValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BytesValue) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; From 969e0bece2c77900a2dca78013ebb1f39daee3dd Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Thu, 11 May 2017 16:35:32 -0700 Subject: [PATCH 15/61] regenerate plugin and profile message code --- src/google/protobuf/compiler/plugin.pb.cc | 1 + src/google/protobuf/compiler/profile.pb.cc | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 83b035f8c0..65fdd9f5f8 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -428,6 +428,7 @@ void Version::SerializeWithCachedSizes( ::google::protobuf::uint8* Version::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.Version) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; diff --git a/src/google/protobuf/compiler/profile.pb.cc b/src/google/protobuf/compiler/profile.pb.cc index c185e4f910..42cc6850e4 100644 --- a/src/google/protobuf/compiler/profile.pb.cc +++ b/src/google/protobuf/compiler/profile.pb.cc @@ -394,6 +394,7 @@ void FieldAccessInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldAccessInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.FieldAccessInfo) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -889,6 +890,7 @@ void MessageAccessInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* MessageAccessInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.MessageAccessInfo) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -1293,6 +1295,7 @@ void AccessInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* AccessInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.AccessInfo) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; From 129a6e2aca95dcfb6c3e717d7b9cca1f104fde39 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Fri, 12 May 2017 15:29:08 -0700 Subject: [PATCH 16/61] Revert guava depedency to version 19. --- java/core/pom.xml | 5 ---- .../com/google/protobuf/TextFormatTest.java | 28 +++++++++---------- java/pom.xml | 8 +----- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/java/core/pom.xml b/java/core/pom.xml index 24bc58c713..bd035adfd0 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -34,11 +34,6 @@ easymockclassextension test - - com.google.truth - truth - test - diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java index 249d7c5ed2..910f360f09 100644 --- a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java +++ b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java @@ -30,8 +30,6 @@ package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.TextFormat.Parser.SingularOverwritePolicy; @@ -1079,12 +1077,12 @@ public class TextFormatTest extends TestCase { { TestMap.Builder dest = TestMap.newBuilder(); TextFormat.merge(text, dest); - assertThat(dest.build()).isEqualTo(message); + assertEquals(message, dest.build()); } { TestMap.Builder dest = TestMap.newBuilder(); parserWithOverwriteForbidden.merge(text, dest); - assertThat(dest.build()).isEqualTo(message); + assertEquals(message, dest.build()); } } @@ -1096,10 +1094,10 @@ public class TextFormatTest extends TestCase { TestMap.Builder dest = TestMap.newBuilder(); parserWithOverwriteForbidden.merge(text, dest); TestMap message = dest.build(); - assertThat(message.getStringToInt32Field().size()).isEqualTo(2); - assertThat(message.getInt32ToMessageField().size()).isEqualTo(2); - assertThat(message.getStringToInt32Field().get("x")).isEqualTo(10); - assertThat(message.getInt32ToMessageField().get(2).getValue()).isEqualTo(200); + assertEquals(2, message.getStringToInt32Field().size()); + assertEquals(2, message.getInt32ToMessageField().size()); + assertEquals(10, message.getStringToInt32Field().get("x").intValue()); + assertEquals(200, message.getInt32ToMessageField().get(2).getValue()); } public void testMapShortFormEmpty() throws Exception { @@ -1108,8 +1106,8 @@ public class TextFormatTest extends TestCase { TestMap.Builder dest = TestMap.newBuilder(); parserWithOverwriteForbidden.merge(text, dest); TestMap message = dest.build(); - assertThat(message.getStringToInt32Field().size()).isEqualTo(0); - assertThat(message.getInt32ToMessageField().size()).isEqualTo(0); + assertEquals(0, message.getStringToInt32Field().size()); + assertEquals(0, message.getInt32ToMessageField().size()); } public void testMapShortFormTrailingComma() throws Exception { @@ -1119,7 +1117,7 @@ public class TextFormatTest extends TestCase { parserWithOverwriteForbidden.merge(text, dest); fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo("1:48: Expected \"{\"."); + assertEquals("1:48: Expected \"{\".", e.getMessage()); } } @@ -1134,8 +1132,8 @@ public class TextFormatTest extends TestCase { TestMap.Builder builder = TestMap.newBuilder(); defaultParser.merge(text, builder); TestMap map = builder.build(); - assertThat(map.getInt32ToInt32Field().size()).isEqualTo(2); - assertThat(map.getInt32ToInt32Field().get(1).intValue()).isEqualTo(30); + assertEquals(2, map.getInt32ToInt32Field().size()); + assertEquals(30, map.getInt32ToInt32Field().get(1).intValue()); } { @@ -1144,8 +1142,8 @@ public class TextFormatTest extends TestCase { TestMap.Builder builder = TestMap.newBuilder(); defaultParser.merge(text, builder); TestMap map = builder.build(); - assertThat(map.getInt32ToInt32Field().size()).isEqualTo(2); - assertThat(map.getInt32ToInt32Field().get(1).intValue()).isEqualTo(30); + assertEquals(2, map.getInt32ToInt32Field().size()); + assertEquals(30, map.getInt32ToInt32Field().get(1).intValue()); } } diff --git a/java/pom.xml b/java/pom.xml index 2c2f4413f0..9733829261 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -84,13 +84,7 @@ com.google.guava guava - 20.0 - - - com.google.truth - truth - test - 0.32 + 19.0 From 49a56da93ff3ab7d9a2252639344ad28db8cdff6 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Fri, 12 May 2017 16:10:30 -0700 Subject: [PATCH 17/61] Update jenkins Java deps. --- jenkins/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/docker/Dockerfile b/jenkins/docker/Dockerfile index 3173afbfe8..00eabeb03a 100644 --- a/jenkins/docker/Dockerfile +++ b/jenkins/docker/Dockerfile @@ -129,7 +129,7 @@ ENV MVN mvn --batch-mode RUN cd /tmp && \ git clone https://github.com/google/protobuf.git && \ cd protobuf && \ - git reset --hard c2b3b3e04e7a023efe06f2107705b45428847800 && \ + git reset --hard 129a6e2aca95dcfb6c3e717d7b9cca1f104fde39 && \ ./autogen.sh && \ ./configure && \ make -j4 && \ From dba8928ff53ae372bba3d928a6145754a97238d5 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 29 May 2017 15:30:47 -0700 Subject: [PATCH 18/61] Add ARRAY for reserved name (#3150) --- php/ext/google/protobuf/def.c | 4 ++-- php/src/Google/Protobuf/descriptor.php | 2 +- php/tests/generated_class_test.php | 1 + php/tests/memory_leak_test.php | 1 + php/tests/proto/test.proto | 4 ++++ src/google/protobuf/compiler/php/php_generator.cc | 4 ++-- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index 8e563a618a..099ebd052e 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -30,8 +30,8 @@ #include "protobuf.h" -const char* const kReservedNames[] = {"Empty"}; -const int kReservedNamesSize = 1; +const char* const kReservedNames[] = {"Empty", "ECHO", "ARRAY"}; +const int kReservedNamesSize = 3; // Forward declare. static void descriptor_init_c_instance(Descriptor* intern TSRMLS_DC); diff --git a/php/src/Google/Protobuf/descriptor.php b/php/src/Google/Protobuf/descriptor.php index fb69eda0dc..35e4929b36 100644 --- a/php/src/Google/Protobuf/descriptor.php +++ b/php/src/Google/Protobuf/descriptor.php @@ -236,7 +236,7 @@ function getClassNamePrefix( return $prefix; } - $reserved_words = array("Empty"); + $reserved_words = array("Empty", "ECHO", "ARRAY"); foreach ($reserved_words as $reserved_word) { if ($classname === $reserved_word) { if ($file_proto->getPackage() === "google.protobuf") { diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php index 21ee849078..7289bbc5c7 100644 --- a/php/tests/generated_class_test.php +++ b/php/tests/generated_class_test.php @@ -876,5 +876,6 @@ class GeneratedClassTest extends TestBase $m = new \Foo\TestMessage_Empty(); $m = new \Foo\PBEmpty(); $m = new \PrefixEmpty(); + $m = new \Foo\PBARRAY(); } } diff --git a/php/tests/memory_leak_test.php b/php/tests/memory_leak_test.php index 361982b550..5eac56f025 100644 --- a/php/tests/memory_leak_test.php +++ b/php/tests/memory_leak_test.php @@ -8,6 +8,7 @@ require_once('generated/NoNamespaceMessage_NestedEnum.php'); require_once('generated/PrefixEmpty.php'); require_once('generated/PrefixTestPrefix.php'); require_once('generated/Bar/TestInclude.php'); +require_once('generated/Foo/PBARRAY.php'); require_once('generated/Foo/PBEmpty.php'); require_once('generated/Foo/TestEnum.php'); require_once('generated/Foo/TestIncludePrefixMessage.php'); diff --git a/php/tests/proto/test.proto b/php/tests/proto/test.proto index 3922925451..583bf8e153 100644 --- a/php/tests/proto/test.proto +++ b/php/tests/proto/test.proto @@ -127,6 +127,10 @@ message Empty { int32 a = 1; } +message ARRAY { + int32 a = 1; +} + message TestPackedMessage { repeated int32 repeated_int32 = 90 [packed = true]; repeated int64 repeated_int64 = 91 [packed = true]; diff --git a/src/google/protobuf/compiler/php/php_generator.cc b/src/google/protobuf/compiler/php/php_generator.cc index ea850c0f45..f8e7e5f006 100644 --- a/src/google/protobuf/compiler/php/php_generator.cc +++ b/src/google/protobuf/compiler/php/php_generator.cc @@ -49,8 +49,8 @@ const std::string kDescriptorMetadataFile = "GPBMetadata/Google/Protobuf/Internal/Descriptor.php"; const std::string kDescriptorDirName = "Google/Protobuf/Internal"; const std::string kDescriptorPackageName = "Google\\Protobuf\\Internal"; -const char* const kReservedNames[] = {"Empty", "ECHO"}; -const int kReservedNamesSize = 2; +const char* const kReservedNames[] = {"ARRAY", "Empty", "ECHO"}; +const int kReservedNamesSize = 3; namespace google { namespace protobuf { From c344fe8caa6da817d3f0ece0babf1d1acbf2bbbf Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 29 May 2017 22:04:20 -0700 Subject: [PATCH 19/61] Oneof field should be serialized even it's equal to default. (#3153) --- php/ext/google/protobuf/encode_decode.c | 4 +++- php/src/Google/Protobuf/Internal/Message.php | 7 +++++++ php/tests/encode_decode_test.php | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/php/ext/google/protobuf/encode_decode.c b/php/ext/google/protobuf/encode_decode.c index 28bf18f4d5..6e3c606b6c 100644 --- a/php/ext/google/protobuf/encode_decode.c +++ b/php/ext/google/protobuf/encode_decode.c @@ -1167,6 +1167,7 @@ static void putrawmsg(MessageHeader* msg, const Descriptor* desc, upb_msg_field_next(&i)) { upb_fielddef* f = upb_msg_iter_field(&i); uint32_t offset = desc->layout->fields[upb_fielddef_index(f)].offset; + bool containing_oneof = false; if (upb_fielddef_containingoneof(f)) { uint32_t oneof_case_offset = @@ -1179,6 +1180,7 @@ static void putrawmsg(MessageHeader* msg, const Descriptor* desc, } // Otherwise, fall through to the appropriate singular-field handler // below. + containing_oneof = true; } if (is_map_field(f)) { @@ -1209,7 +1211,7 @@ static void putrawmsg(MessageHeader* msg, const Descriptor* desc, #define T(upbtypeconst, upbtype, ctype, default_value) \ case upbtypeconst: { \ ctype value = DEREF(message_data(msg), offset, ctype); \ - if (value != default_value) { \ + if (containing_oneof || value != default_value) { \ upb_sink_put##upbtype(sink, sel, value); \ } \ } break; diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index cd15e0f042..10c639ac2c 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -739,6 +739,13 @@ class Message */ private function existField($field) { + $oneof_index = $field->getOneofIndex(); + if ($oneof_index !== -1) { + $oneof = $this->desc->getOneofDecl()[$oneof_index]; + $oneof_name = $oneof->getName(); + return $this->$oneof_name->getNumber() === $field->getNumber(); + } + $getter = $field->getGetter(); $value = $this->$getter(); return $value !== $this->defaultValue($field); diff --git a/php/tests/encode_decode_test.php b/php/tests/encode_decode_test.php index 288df5696d..b4cfed422b 100644 --- a/php/tests/encode_decode_test.php +++ b/php/tests/encode_decode_test.php @@ -88,6 +88,13 @@ class EncodeDecodeTest extends TestBase $n = new TestMessage(); $n->mergeFromString($data); $this->assertSame(1, $n->getOneofMessage()->getA()); + + // Encode default value + $m->setOneofEnum(TestEnum::ZERO); + $data = $m->serializeToString(); + $n = new TestMessage(); + $n->mergeFromString($data); + $this->assertSame("oneof_enum", $n->getMyOneof()); } public function testPackedEncode() From 3b1a87518cead7403b8e13c41945e41a30d602e4 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Sat, 17 Jun 2017 11:01:16 -0700 Subject: [PATCH 20/61] Remove inclusion of ext/json/php_json.h. (#3241) That implementation of json is not being used - this extension is using a json encoder/decoder provided by 'upb'. --- php/ext/google/protobuf/message.c | 1 - 1 file changed, 1 deletion(-) diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 48b87b10c4..1162a5f82f 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -30,7 +30,6 @@ #include #include -#include #include "protobuf.h" From e7bcfc42411c8c1ffcec68474b308bc1da21f460 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Wed, 21 Jun 2017 10:20:34 -0700 Subject: [PATCH 21/61] Update version number to 3.3.2 --- Protobuf.podspec | 2 +- configure.ac | 2 +- csharp/Google.Protobuf.Tools.nuspec | 2 +- csharp/src/Google.Protobuf/project.json | 2 +- java/core/pom.xml | 2 +- java/pom.xml | 2 +- java/util/pom.xml | 2 +- js/package.json | 2 +- php/ext/google/protobuf/package.xml | 18 +++++++++++++++++- php/ext/google/protobuf/protobuf.h | 2 +- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/__init__.py | 2 +- ruby/google-protobuf.gemspec | 2 +- src/Makefile.am | 6 +++--- src/google/protobuf/stubs/common.h | 2 +- 15 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Protobuf.podspec b/Protobuf.podspec index ffaf7a72fe..941bf5fbd7 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '3.3.1' + s.version = '3.3.2' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/google/protobuf' s.license = '3-Clause BSD License' diff --git a/configure.ac b/configure.ac index e06ebe5f9c..e75bdbaac0 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.3.1],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.3.2],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 18a03f59af..95e6b04a3e 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,7 +5,7 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.3.1 + 3.3.2 Google Inc. protobuf-packages https://github.com/google/protobuf/blob/master/LICENSE diff --git a/csharp/src/Google.Protobuf/project.json b/csharp/src/Google.Protobuf/project.json index 6596ddf6cd..38830d013f 100644 --- a/csharp/src/Google.Protobuf/project.json +++ b/csharp/src/Google.Protobuf/project.json @@ -1,5 +1,5 @@ { - "version": "3.3.1", + "version": "3.3.2", "title": "Google Protocol Buffers", "description": "See project site for more info.", "authors": [ "Google Inc." ], diff --git a/java/core/pom.xml b/java/core/pom.xml index bd035adfd0..e4f50dd157 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -6,7 +6,7 @@ com.google.protobuf protobuf-parent - 3.3.1 + 3.3.2 protobuf-java diff --git a/java/pom.xml b/java/pom.xml index 9733829261..39ed31ab95 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -11,7 +11,7 @@ com.google.protobuf protobuf-parent - 3.3.1 + 3.3.2 pom Protocol Buffers [Parent] diff --git a/java/util/pom.xml b/java/util/pom.xml index 8a54e10d2b..62394ed792 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -6,7 +6,7 @@ com.google.protobuf protobuf-parent - 3.3.1 + 3.3.2 protobuf-java-util diff --git a/js/package.json b/js/package.json index b7343cc395..afb223db1a 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.3.1", + "version": "3.3.2", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index 2c405aa9ac..20a45bc63c 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -13,7 +13,7 @@ 2017-01-13 - 3.3.1 + 3.3.2 3.3.0 @@ -117,6 +117,22 @@ GA release. 3-Clause BSD License +GA release. + + + + + 3.3.2 + 3.3.0 + + + stable + stable + + 2017-06-21 + + 3-Clause BSD License + GA release. diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index c3374af3f8..8a4b82da85 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -37,7 +37,7 @@ #include "upb.h" #define PHP_PROTOBUF_EXTNAME "protobuf" -#define PHP_PROTOBUF_VERSION "3.3.1" +#define PHP_PROTOBUF_VERSION "3.3.2" #define MAX_LENGTH_OF_INT64 20 #define SIZEOF_INT64 8 diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index eeb2987f2b..6003f09da6 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protoc - 3.3.1 + 3.3.2 pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 8628edd785..622dfb3d47 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,7 +30,7 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.3.1' +__version__ = '3.3.2' if __name__ != '__main__': try: diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 8aff7bf0f4..bed835cb05 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.3.1" + s.version = "3.3.2" s.licenses = ["BSD-3-Clause"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." diff --git a/src/Makefile.am b/src/Makefile.am index 4524aeb275..d17355e0bf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -184,7 +184,7 @@ nobase_include_HEADERS = \ lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_lite_la_LDFLAGS = -version-info 13:1:0 -export-dynamic -no-undefined +libprotobuf_lite_la_LDFLAGS = -version-info 13:2:0 -export-dynamic -no-undefined if HAVE_LD_VERSION_SCRIPT libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map @@ -229,7 +229,7 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/io/zero_copy_stream_impl_lite.cc libprotobuf_la_LIBADD = $(PTHREAD_LIBS) -libprotobuf_la_LDFLAGS = -version-info 13:1:0 -export-dynamic -no-undefined +libprotobuf_la_LDFLAGS = -version-info 13:2:0 -export-dynamic -no-undefined if HAVE_LD_VERSION_SCRIPT libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map @@ -319,7 +319,7 @@ libprotobuf_la_SOURCES = \ nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -version-info 13:1:0 -export-dynamic -no-undefined +libprotoc_la_LDFLAGS = -version-info 13:2:0 -export-dynamic -no-undefined if HAVE_LD_VERSION_SCRIPT libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index 15321ebe76..daa9b22330 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -96,7 +96,7 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3003001 +#define GOOGLE_PROTOBUF_VERSION 3003002 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" From 5520b4384a87d010814bfc503cc2df109268a9a8 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Wed, 21 Jun 2017 11:17:30 -0700 Subject: [PATCH 22/61] Update C++ generated code. --- src/google/protobuf/any.pb.h | 2 +- src/google/protobuf/api.pb.h | 2 +- src/google/protobuf/compiler/plugin.pb.h | 2 +- src/google/protobuf/compiler/profile.pb.h | 2 +- src/google/protobuf/descriptor.pb.h | 2 +- src/google/protobuf/duration.pb.h | 2 +- src/google/protobuf/empty.pb.h | 2 +- src/google/protobuf/field_mask.pb.h | 2 +- src/google/protobuf/source_context.pb.h | 2 +- src/google/protobuf/struct.pb.h | 2 +- src/google/protobuf/timestamp.pb.h | 2 +- src/google/protobuf/type.pb.h | 2 +- src/google/protobuf/wrappers.pb.h | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index ef3667984a..ad2073a8df 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 36bf43c7a3..5b68bd9863 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 843436881a..baeb6a1d65 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/compiler/profile.pb.h b/src/google/protobuf/compiler/profile.pb.h index 0b023eb01e..b4931cf1cb 100644 --- a/src/google/protobuf/compiler/profile.pb.h +++ b/src/google/protobuf/compiler/profile.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index ef77e6ebda..a2e91d72a3 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index d9cd405de9..02679c6a95 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index c318cceb2b..306301a491 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index c63cbad7b2..42110be63b 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index 1c72780c1f..66ee188673 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 3f2d8bc0f1..c70912cdef 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index abc997ebcf..9ce2c96adf 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index 6e3d997ae4..85c6390b6a 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h index 9a91be3d93..7495aa6898 100644 --- a/src/google/protobuf/wrappers.pb.h +++ b/src/google/protobuf/wrappers.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 3003002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. From 5555d3b0785d7a73299fa95203073c4bab2af97a Mon Sep 17 00:00:00 2001 From: "Brian J. Watson" Date: Fri, 2 Jun 2017 17:30:39 -0700 Subject: [PATCH 23/61] Fix typos in comment --- python/google/protobuf/json_format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/google/protobuf/json_format.py b/python/google/protobuf/json_format.py index d02cb09156..937285b0ff 100644 --- a/python/google/protobuf/json_format.py +++ b/python/google/protobuf/json_format.py @@ -532,8 +532,8 @@ class _Parser(object): def _ConvertGenericMessage(self, value, message): """Convert a JSON representation into message with FromJsonString.""" - # Durantion, Timestamp, FieldMask have FromJsonString method to do the - # convert. Users can also call the method directly. + # Duration, Timestamp, FieldMask have a FromJsonString method to do the + # conversion. Users can also call the method directly. message.FromJsonString(value) def _ConvertValueMessage(self, value, message): From 4987ddac75e650a9f659394f7161ab91e0e5a144 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 22 Jun 2017 22:06:56 +0800 Subject: [PATCH 24/61] Fix a bazel build error on Windows --- python/google/protobuf/pyext/message.cc | 6 ++++-- .../google/protobuf/pyext/repeated_composite_container.cc | 3 ++- python/google/protobuf/pyext/repeated_scalar_container.cc | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index 85aaa46fe0..49113c7ca0 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -1055,13 +1055,15 @@ int InternalDeleteRepeatedField( if (PySlice_Check(slice)) { from = to = step = slice_length = 0; - PySlice_GetIndicesEx( #if PY_MAJOR_VERSION < 3 + PySlice_GetIndicesEx( reinterpret_cast(slice), + length, &from, &to, &step, &slice_length); #else + PySlice_GetIndicesEx( slice, -#endif length, &from, &to, &step, &slice_length); +#endif if (from < to) { min = from; max = to - 1; diff --git a/python/google/protobuf/pyext/repeated_composite_container.cc b/python/google/protobuf/pyext/repeated_composite_container.cc index 9cb4e9a1be..06a976dead 100644 --- a/python/google/protobuf/pyext/repeated_composite_container.cc +++ b/python/google/protobuf/pyext/repeated_composite_container.cc @@ -266,10 +266,11 @@ int AssignSubscript(RepeatedCompositeContainer* self, if (PySlice_Check(slice)) { #if PY_MAJOR_VERSION >= 3 if (PySlice_GetIndicesEx(slice, + length, &from, &to, &step, &slicelength) == -1) { #else if (PySlice_GetIndicesEx(reinterpret_cast(slice), -#endif length, &from, &to, &step, &slicelength) == -1) { +#endif return -1; } return PySequence_DelSlice(self->child_messages, from, to); diff --git a/python/google/protobuf/pyext/repeated_scalar_container.cc b/python/google/protobuf/pyext/repeated_scalar_container.cc index 95da85f87b..9fedb9529e 100644 --- a/python/google/protobuf/pyext/repeated_scalar_container.cc +++ b/python/google/protobuf/pyext/repeated_scalar_container.cc @@ -305,10 +305,12 @@ static PyObject* Subscript(RepeatedScalarContainer* self, PyObject* slice) { length = Len(self); #if PY_MAJOR_VERSION >= 3 if (PySlice_GetIndicesEx(slice, + length, &from, &to, &step, &slicelength) == -1) { #else if (PySlice_GetIndicesEx(reinterpret_cast(slice), -#endif length, &from, &to, &step, &slicelength) == -1) { + +#endif return NULL; } return_list = true; @@ -458,10 +460,11 @@ static int AssSubscript(RepeatedScalarContainer* self, length = reflection->FieldSize(*message, field_descriptor); #if PY_MAJOR_VERSION >= 3 if (PySlice_GetIndicesEx(slice, + length, &from, &to, &step, &slicelength) == -1) { #else if (PySlice_GetIndicesEx(reinterpret_cast(slice), -#endif length, &from, &to, &step, &slicelength) == -1) { +#endif return -1; } create_list = true; From 58a3c74df04af9ed7d531e3f247677a4661a98b6 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Fri, 23 Jun 2017 11:14:22 -0700 Subject: [PATCH 25/61] add test_proto2_message.proto and change conformnace/makefile.am --- README.md | 2 +- conformance/Makefile.am | 22 +- .../protobuf/test_messages_proto2.proto | 196 ++++++++++++++++++ 3 files changed, 213 insertions(+), 7 deletions(-) create mode 100644 src/google/protobuf/test_messages_proto2.proto diff --git a/README.md b/README.md index 653f663276..e456863e8f 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ as well as a set of standard .proto files distributed along with protobuf. If you are looking for an old version that is not available in the release page, check out the maven repo here: - [https://repo1.maven.org/maven2/com/google/protobuf/protoc/](https://repo1.maven.org/maven2/com/google/protobuf/protoc/) + [http://repo1.maven.org/maven2/com/google/protobuf/protoc/](http://repo1.maven.org/maven2/com/google/protobuf/protoc/) These pre-built binaries are only provided for released versions. If you want to use the github master version at HEAD, or you need to modify protobuf code, diff --git a/conformance/Makefile.am b/conformance/Makefile.am index 1a8b57485b..268fc7e6b7 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -2,7 +2,11 @@ conformance_protoc_inputs = \ conformance.proto \ - $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto + $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto + +conformance_proto2_protoc_inputs = \ + conformance.proto \ + $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto well_known_type_protoc_inputs = \ $(top_srcdir)/src/google/protobuf/any.proto \ @@ -64,6 +68,7 @@ other_language_protoc_outputs = \ com/google/protobuf/ValueOrBuilder.java \ com/google/protobuf/WrappersProto.java \ com/google/protobuf_test_messages/proto3/TestMessagesProto3.java \ + com/google/protobuf_test_messages/proto2/TestMessagesProto2.java \ google/protobuf/any.pb.cc \ google/protobuf/any.pb.h \ google/protobuf/any.rb \ @@ -84,8 +89,11 @@ other_language_protoc_outputs = \ google/protobuf/TestMessagesProto3.pbobjc.m \ google/protobuf/test_messages_proto3.pb.cc \ google/protobuf/test_messages_proto3.pb.h \ + google/protobuf/test_messages_proto2.pb.cc \ + google/protobuf/test_messages_proto2.pb.h \ google/protobuf/test_messages_proto3_pb.rb \ google/protobuf/test_messages_proto3_pb2.py \ + google/protobuf/test_messages_proto2_pb2.py \ google/protobuf/timestamp.pb.cc \ google/protobuf/timestamp.pb.h \ google/protobuf/timestamp.rb \ @@ -198,7 +206,7 @@ conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \ conformance_test_runner.cc \ third_party/jsoncpp/json.h \ third_party/jsoncpp/jsoncpp.cpp -nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc +nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) conformance_test_runner_CXXFLAGS = -std=c++11 # Explicit deps beacuse BUILT_SOURCES are only done before a "make all/check" @@ -208,7 +216,7 @@ conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la conformance_cpp_SOURCES = conformance_cpp.cc -nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc +nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check" # so a direct "make test_cpp" could fail if parallel enough. @@ -242,8 +250,9 @@ google-protobuf: if USE_EXTERNAL_PROTOC # Some implementations include pre-generated versions of well-known types. -protoc_middleman: $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf +protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:. $(conformance_protoc_inputs) + $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --python_out=. $(conformance_proto2_protoc_inputs) $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:google-protobuf $(well_known_type_protoc_inputs) ## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) touch protoc_middleman @@ -253,8 +262,9 @@ else # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is # relative to srcdir, which may not be the same as the current directory when # building out-of-tree. -protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf +protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --python_out=$$oldpwd $(conformance_proto2_protoc_inputs) ) oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd/google-protobuf $(well_known_type_protoc_inputs) ) ## @mkdir -p lite ## oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) ) @@ -274,7 +284,7 @@ MAINTAINERCLEANFILES = \ Makefile.in javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs) - jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java com/google/protobuf_test_messages/proto3/TestMessagesProto3.java + jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java com/google/protobuf_test_messages/proto3/TestMessagesProto3.java com/google/protobuf_test_messages/proto2/TestMessagesProto2.java @touch javac_middleman conformance-java: javac_middleman diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto new file mode 100644 index 0000000000..0708cbe7ff --- /dev/null +++ b/src/google/protobuf/test_messages_proto2.proto @@ -0,0 +1,196 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto2 messages. This test schema is used by: +// +// - conformance tests +// + +syntax = "proto2"; + +package protobuf_test_messages.proto2; +option java_package = "com.google.protobuf_test_messages.proto2"; + +// This is the default, but we specify it here explicitly. +option optimize_for = SPEED; + +option cc_enable_arenas = true; + +// This proto includes every type of field in both singular and repeated +// forms. +// +// Also, crucially, all messages and enums in this file are eventually +// submessages of this message. So for example, a fuzz test of TestAllTypes +// could trigger bugs that occur in any message type in this file. We verify +// this stays true in a unit test. +message TestAllTypes { + message NestedMessage { + optional int32 a = 1; + optional TestAllTypes corecursive = 2; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + // Singular + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + + optional NestedMessage optional_nested_message = 18; + optional ForeignMessage optional_foreign_message = 19; + + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnum optional_foreign_enum = 22; + + optional string optional_string_piece = 24 [ctype=STRING_PIECE]; + optional string optional_cord = 25 [ctype=CORD]; + + optional TestAllTypes recursive_message = 27; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; + repeated string repeated_cord = 55 [ctype=CORD]; + + // Map + map < int32, int32> map_int32_int32 = 56; + map < int64, int64> map_int64_int64 = 57; + map < uint32, uint32> map_uint32_uint32 = 58; + map < uint64, uint64> map_uint64_uint64 = 59; + map < sint32, sint32> map_sint32_sint32 = 60; + map < sint64, sint64> map_sint64_sint64 = 61; + map < fixed32, fixed32> map_fixed32_fixed32 = 62; + map < fixed64, fixed64> map_fixed64_fixed64 = 63; + map map_sfixed32_sfixed32 = 64; + map map_sfixed64_sfixed64 = 65; + map < int32, float> map_int32_float = 66; + map < int32, double> map_int32_double = 67; + map < bool, bool> map_bool_bool = 68; + map < string, string> map_string_string = 69; + map < string, bytes> map_string_bytes = 70; + map < string, NestedMessage> map_string_nested_message = 71; + map < string, ForeignMessage> map_string_foreign_message = 72; + map < string, NestedEnum> map_string_nested_enum = 73; + map < string, ForeignEnum> map_string_foreign_enum = 74; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; + } + + // extensions + extensions 120 to 200; + + // groups + optional group Data = 201 { + optional int32 group_int32 = 202; + optional uint32 group_uint32 = 203; + }; + + // Test field-name-to-JSON-name convention. + // (protobuf says names can be any valid C/C++ identifier.) + optional int32 fieldname1 = 401; + optional int32 field_name2 = 402; + optional int32 _field_name3 = 403; + optional int32 field__name4_ = 404; + optional int32 field0name5 = 405; + optional int32 field_0_name6 = 406; + optional int32 fieldName7 = 407; + optional int32 FieldName8 = 408; + optional int32 field_Name9 = 409; + optional int32 Field_Name10 = 410; + optional int32 FIELD_NAME11 = 411; + optional int32 FIELD_name12 = 412; + optional int32 __field_name13 = 413; + optional int32 __Field_name14 = 414; + optional int32 field__name15 = 415; + optional int32 field__Name16 = 416; + optional int32 field_name17__ = 417; + optional int32 Field_name18__ = 418; +} + +message ForeignMessage { + optional int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} + +extend TestAllTypes { + optional int32 extension_int32 = 120; +} \ No newline at end of file From 4e67590e1b42897b674d6bfdae3b7c8f1d4cf5e5 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Fri, 23 Jun 2017 11:44:24 -0700 Subject: [PATCH 26/61] fix readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e456863e8f..653f663276 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ as well as a set of standard .proto files distributed along with protobuf. If you are looking for an old version that is not available in the release page, check out the maven repo here: - [http://repo1.maven.org/maven2/com/google/protobuf/protoc/](http://repo1.maven.org/maven2/com/google/protobuf/protoc/) + [https://repo1.maven.org/maven2/com/google/protobuf/protoc/](https://repo1.maven.org/maven2/com/google/protobuf/protoc/) These pre-built binaries are only provided for released versions. If you want to use the github master version at HEAD, or you need to modify protobuf code, From 2ad74e1606728564cc777aa4917d7e2299317eda Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Mon, 26 Jun 2017 17:46:34 -0700 Subject: [PATCH 27/61] add support for proto2 --- conformance/conformance.proto | 2 + conformance/conformance_ruby.rb | 19 +- conformance/conformance_test.cc | 179 +++++++++++------- conformance/conformance_test.h | 21 +- .../protobuf/test_messages_proto2.proto | 8 +- 5 files changed, 142 insertions(+), 87 deletions(-) diff --git a/conformance/conformance.proto b/conformance/conformance.proto index 18e4b7bca6..a1c42663b0 100644 --- a/conformance/conformance.proto +++ b/conformance/conformance.proto @@ -77,6 +77,8 @@ message ConformanceRequest { // Which format should the testee serialize its message to? WireFormat requested_output_format = 3; + + string message_type = 4; } // Represents a single test case's output. diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index b7b7cf1c6c..a1170e4c34 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -43,12 +43,19 @@ def do_test(request) begin case request.payload when :protobuf_payload - begin - test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( - request.protobuf_payload) - rescue Google::Protobuf::ParseError => err - response.parse_error = err.message.encode('utf-8') - return response + if request.message_type.eql?('proto3') + begin + test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( + request.protobuf_payload) + rescue Google::Protobuf::ParseError => err + response.parse_error = err.message.encode('utf-8') + return response + end + elsif request.message_type.eql?('proto2') + response.skipped = "Ruby doesn't support proto2" + return respons + else + fail "Protobuf request doesn't have specific type" end when :json_payload diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index 67c9039778..9b153fdb52 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -35,6 +35,7 @@ #include "conformance.pb.h" #include "conformance_test.h" #include +#include #include #include @@ -60,6 +61,7 @@ using google::protobuf::util::MessageDifferencer; using google::protobuf::util::NewTypeResolverForDescriptorPool; using google::protobuf::util::Status; using protobuf_test_messages::proto3::TestAllTypes; +using protobuf_test_messages::proto2::TestAllTypesProto2; using std::string; namespace { @@ -163,8 +165,10 @@ string submsg(uint32_t fn, const string& buf) { #define UNKNOWN_FIELD 666 const FieldDescriptor* GetFieldForType(FieldDescriptor::Type type, - bool repeated) { - const Descriptor* d = TestAllTypes().GetDescriptor(); + bool repeated, bool isProto3) { + + const Descriptor* d = isProto3 ? + TestAllTypes().GetDescriptor() : TestAllTypesProto2().GetDescriptor(); for (int i = 0; i < d->field_count(); i++) { const FieldDescriptor* f = d->field(i); if (f->type() == type && f->is_repeated() == repeated) { @@ -271,7 +275,7 @@ void ConformanceTestSuite::RunTest(const string& test_name, void ConformanceTestSuite::RunValidInputTest( const string& test_name, ConformanceLevel level, const string& input, WireFormat input_format, const string& equivalent_text_format, - WireFormat requested_output) { + WireFormat requested_output, bool isProto3) { TestAllTypes reference_message; GOOGLE_CHECK( TextFormat::ParseFromString(equivalent_text_format, &reference_message)) @@ -282,9 +286,15 @@ void ConformanceTestSuite::RunValidInputTest( ConformanceResponse response; switch (input_format) { - case conformance::PROTOBUF: + case conformance::PROTOBUF: { request.set_protobuf_payload(input); + if (isProto3) { + request.set_message_type("proto3"); + } else { + request.set_message_type("proto2"); + } break; + } case conformance::JSON: request.set_json_payload(input); @@ -299,6 +309,7 @@ void ConformanceTestSuite::RunValidInputTest( RunTest(test_name, request, &response); TestAllTypes test_message; + TestAllTypesProto2 test_message_proto2; switch (response.result_case()) { case ConformanceResponse::RESULT_NOT_SET: @@ -334,11 +345,20 @@ void ConformanceTestSuite::RunValidInputTest( return; } - if (!test_message.ParseFromString(binary_protobuf)) { - ReportFailure(test_name, level, request, response, + if (isProto3) { + if (!test_message.ParseFromString(binary_protobuf)) { + ReportFailure(test_name, level, request, response, "INTERNAL ERROR: internal JSON->protobuf transcode " "yielded unparseable proto."); - return; + return; + } + } else { + if (!test_message_proto2.ParseFromString(binary_protobuf)) { + ReportFailure(test_name, level, request, response, + "INTERNAL ERROR: internal JSON->protobuf transcode " + "yielded unparseable proto."); + return; + } } break; @@ -352,10 +372,18 @@ void ConformanceTestSuite::RunValidInputTest( return; } - if (!test_message.ParseFromString(response.protobuf_payload())) { - ReportFailure(test_name, level, request, response, - "Protobuf output we received from test was unparseable."); - return; + if (isProto3) { + if (!test_message.ParseFromString(response.protobuf_payload())) { + ReportFailure(test_name, level, request, response, + "Protobuf output we received from test was unparseable."); + return; + } + } else { + if (!test_message_proto2.ParseFromString(response.protobuf_payload())) { + ReportFailure(test_name, level, request, response, + "Protobuf output we received from test was unparseable."); + return; + } } break; @@ -384,10 +412,16 @@ void ConformanceTestSuite::RunValidInputTest( // Expect that this precise protobuf will cause a parse error. void ConformanceTestSuite::ExpectParseFailureForProto( - const string& proto, const string& test_name, ConformanceLevel level) { + const string& proto, const string& test_name, ConformanceLevel level, + bool isProto3) { ConformanceRequest request; ConformanceResponse response; request.set_protobuf_payload(proto); + if (isProto3) { + request.set_message_type("proto3"); + } else { + request.set_message_type("proto2"); + } string effective_test_name = ConformanceLevelToString(level) + ".ProtobufInput." + test_name; @@ -412,8 +446,9 @@ void ConformanceTestSuite::ExpectParseFailureForProto( // // TODO(haberman): implement the second of these. void ConformanceTestSuite::ExpectHardParseFailureForProto( - const string& proto, const string& test_name, ConformanceLevel level) { - return ExpectParseFailureForProto(proto, test_name, level); + const string& proto, const string& test_name, ConformanceLevel level, + bool isProto3) { + return ExpectParseFailureForProto(proto, test_name, level, isProto3); } void ConformanceTestSuite::RunValidJsonTest( @@ -422,39 +457,40 @@ void ConformanceTestSuite::RunValidJsonTest( RunValidInputTest( ConformanceLevelToString(level) + ".JsonInput." + test_name + ".ProtobufOutput", level, input_json, conformance::JSON, - equivalent_text_format, conformance::PROTOBUF); + equivalent_text_format, conformance::PROTOBUF, true); RunValidInputTest( ConformanceLevelToString(level) + ".JsonInput." + test_name + ".JsonOutput", level, input_json, conformance::JSON, - equivalent_text_format, conformance::JSON); + equivalent_text_format, conformance::JSON, true); } void ConformanceTestSuite::RunValidJsonTestWithProtobufInput( const string& test_name, ConformanceLevel level, const TestAllTypes& input, - const string& equivalent_text_format) { + const string& equivalent_text_format, bool isProto3) { RunValidInputTest( ConformanceLevelToString(level) + ".ProtobufInput." + test_name + ".JsonOutput", level, input.SerializeAsString(), conformance::PROTOBUF, - equivalent_text_format, conformance::JSON); + equivalent_text_format, conformance::JSON, isProto3); } void ConformanceTestSuite::RunValidProtobufTest( const string& test_name, ConformanceLevel level, - const string& input_protobuf, const string& equivalent_text_format) { + const string& input_protobuf, const string& equivalent_text_format, + bool isProto3) { RunValidInputTest( ConformanceLevelToString(level) + ".ProtobufInput." + test_name + ".ProtobufOutput", level, input_protobuf, conformance::PROTOBUF, - equivalent_text_format, conformance::PROTOBUF); + equivalent_text_format, conformance::PROTOBUF, isProto3); RunValidInputTest( ConformanceLevelToString(level) + ".ProtobufInput." + test_name + ".JsonOutput", level, input_protobuf, conformance::PROTOBUF, - equivalent_text_format, conformance::JSON); + equivalent_text_format, conformance::JSON, isProto3); } void ConformanceTestSuite::RunValidProtobufTestWithMessage( const string& test_name, ConformanceLevel level, const TestAllTypes& input, - const string& equivalent_text_format) { - RunValidProtobufTest(test_name, level, input.SerializeAsString(), equivalent_text_format); + const string& equivalent_text_format, bool isProto3) { + RunValidProtobufTest(test_name, level, input.SerializeAsString(), equivalent_text_format, isProto3); } // According to proto3 JSON specification, JSON serializers follow more strict @@ -535,6 +571,7 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson( ConformanceRequest request; ConformanceResponse response; request.set_protobuf_payload(payload_message.SerializeAsString()); + request.set_message_type("proto3"); string effective_test_name = ConformanceLevelToString(level) + "." + test_name + ".JsonOutput"; request.set_requested_output_format(conformance::JSON); @@ -550,6 +587,7 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson( } } +//TODO: proto2? void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { // Incomplete values for each wire type. static const string incompletes[6] = { @@ -561,8 +599,8 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { string("abc") // 32BIT }; - const FieldDescriptor* field = GetFieldForType(type, false); - const FieldDescriptor* rep_field = GetFieldForType(type, true); + const FieldDescriptor* field = GetFieldForType(type, false, true); + const FieldDescriptor* rep_field = GetFieldForType(type, true, true); WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType( static_cast(type)); const string& incomplete = incompletes[wire_type]; @@ -571,43 +609,43 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { ExpectParseFailureForProto( tag(field->number(), wire_type), - "PrematureEofBeforeKnownNonRepeatedValue" + type_name, REQUIRED); + "PrematureEofBeforeKnownNonRepeatedValue" + type_name, REQUIRED, true); ExpectParseFailureForProto( tag(rep_field->number(), wire_type), - "PrematureEofBeforeKnownRepeatedValue" + type_name, REQUIRED); + "PrematureEofBeforeKnownRepeatedValue" + type_name, REQUIRED, true); ExpectParseFailureForProto( tag(UNKNOWN_FIELD, wire_type), - "PrematureEofBeforeUnknownValue" + type_name, REQUIRED); + "PrematureEofBeforeUnknownValue" + type_name, REQUIRED, true); ExpectParseFailureForProto( cat( tag(field->number(), wire_type), incomplete ), - "PrematureEofInsideKnownNonRepeatedValue" + type_name, REQUIRED); + "PrematureEofInsideKnownNonRepeatedValue" + type_name, REQUIRED, true); ExpectParseFailureForProto( cat( tag(rep_field->number(), wire_type), incomplete ), - "PrematureEofInsideKnownRepeatedValue" + type_name, REQUIRED); + "PrematureEofInsideKnownRepeatedValue" + type_name, REQUIRED, true); ExpectParseFailureForProto( cat( tag(UNKNOWN_FIELD, wire_type), incomplete ), - "PrematureEofInsideUnknownValue" + type_name, REQUIRED); + "PrematureEofInsideUnknownValue" + type_name, REQUIRED, true); if (wire_type == WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { ExpectParseFailureForProto( cat( tag(field->number(), wire_type), varint(1) ), "PrematureEofInDelimitedDataForKnownNonRepeatedValue" + type_name, - REQUIRED); + REQUIRED, true); ExpectParseFailureForProto( cat( tag(rep_field->number(), wire_type), varint(1) ), "PrematureEofInDelimitedDataForKnownRepeatedValue" + type_name, - REQUIRED); + REQUIRED, true); // EOF in the middle of delimited data for unknown value. ExpectParseFailureForProto( cat( tag(UNKNOWN_FIELD, wire_type), varint(1) ), - "PrematureEofInDelimitedDataForUnknownValue" + type_name, REQUIRED); + "PrematureEofInDelimitedDataForUnknownValue" + type_name, REQUIRED, true); if (type == FieldDescriptor::TYPE_MESSAGE) { // Submessage ends in the middle of a value. @@ -618,7 +656,7 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { cat( tag(field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED), varint(incomplete_submsg.size()), incomplete_submsg ), - "PrematureEofInSubmessageValue" + type_name, REQUIRED); + "PrematureEofInSubmessageValue" + type_name, REQUIRED, true); } } else if (type != FieldDescriptor::TYPE_GROUP) { // Non-delimited, non-group: eligible for packing. @@ -627,29 +665,29 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { ExpectHardParseFailureForProto( cat(tag(rep_field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED), varint(incomplete.size()), incomplete), - "PrematureEofInPackedFieldValue" + type_name, REQUIRED); + "PrematureEofInPackedFieldValue" + type_name, REQUIRED, true); // EOF in the middle of packed region. ExpectParseFailureForProto( cat(tag(rep_field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED), varint(1)), - "PrematureEofInPackedField" + type_name, REQUIRED); + "PrematureEofInPackedField" + type_name, REQUIRED, true); } } void ConformanceTestSuite::TestValidDataForType( FieldDescriptor::Type type, - std::vector> values) { + std::vector> values, bool isProto3) { const string type_name = UpperCase(string(".") + FieldDescriptor::TypeName(type)); WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType( static_cast(type)); - const FieldDescriptor* field = GetFieldForType(type, false); - const FieldDescriptor* rep_field = GetFieldForType(type, true); + const FieldDescriptor* field = GetFieldForType(type, false, isProto3); + const FieldDescriptor* rep_field = GetFieldForType(type, true, isProto3); RunValidProtobufTest("ValidDataScalar" + type_name, REQUIRED, cat(tag(field->number(), wire_type), values[0].first), - field->name() + ": " + values[0].second); + field->name() + ": " + values[0].second, isProto3); string proto; string text = field->name() + ": " + values.back().second; @@ -657,7 +695,7 @@ void ConformanceTestSuite::TestValidDataForType( proto += cat(tag(field->number(), wire_type), values[i].first); } RunValidProtobufTest("RepeatedScalarSelectsLast" + type_name, REQUIRED, - proto, text); + proto, text, isProto3); proto.clear(); text.clear(); @@ -666,7 +704,7 @@ void ConformanceTestSuite::TestValidDataForType( proto += cat(tag(rep_field->number(), wire_type), values[i].first); text += rep_field->name() + ": " + values[i].second + " "; } - RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED, proto, text); + RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED, proto, text, true); } void ConformanceTestSuite::SetFailureList(const string& filename, @@ -708,6 +746,7 @@ bool ConformanceTestSuite::CheckSetEmpty(const set& set_to_check, } } +// TODO: proto2? void ConformanceTestSuite::TestIllegalTags() { // field num 0 is illegal string nullfield[] = { @@ -719,7 +758,7 @@ void ConformanceTestSuite::TestIllegalTags() { for (int i = 0; i < 4; i++) { string name = "IllegalZeroFieldNum_Case_0"; name.back() += i; - ExpectParseFailureForProto(nullfield[i], name, REQUIRED); + ExpectParseFailureForProto(nullfield[i], name, REQUIRED, true); } } @@ -756,23 +795,23 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {dbl(0.1), "0.1"}, {dbl(1.7976931348623157e+308), "1.7976931348623157e+308"}, {dbl(2.22507385850720138309e-308), "2.22507385850720138309e-308"} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_FLOAT, { {flt(0.1), "0.1"}, {flt(1.00000075e-36), "1.00000075e-36"}, {flt(3.402823e+38), "3.402823e+38"}, // 3.40282347e+38 {flt(1.17549435e-38f), "1.17549435e-38"} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_INT64, { {varint(12345), "12345"}, {varint(kInt64Max), std::to_string(kInt64Max)}, {varint(kInt64Min), std::to_string(kInt64Min)} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_UINT64, { {varint(12345), "12345"}, {varint(kUint64Max), std::to_string(kUint64Max)}, {varint(0), "0"} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_INT32, { {varint(12345), "12345"}, {longvarint(12345, 2), "12345"}, @@ -782,7 +821,7 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {varint(1LL << 33), std::to_string(static_cast(1LL << 33))}, {varint((1LL << 33) - 1), std::to_string(static_cast((1LL << 33) - 1))}, - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_UINT32, { {varint(12345), "12345"}, {longvarint(12345, 2), "12345"}, @@ -792,42 +831,42 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {varint(1LL << 33), std::to_string(static_cast(1LL << 33))}, {varint((1LL << 33) - 1), std::to_string(static_cast((1LL << 33) - 1))}, - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_FIXED64, { {u64(12345), "12345"}, {u64(kUint64Max), std::to_string(kUint64Max)}, {u64(0), "0"} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_FIXED32, { {u32(12345), "12345"}, {u32(kUint32Max), std::to_string(kUint32Max)}, // UINT32_MAX {u32(0), "0"} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_SFIXED64, { {u64(12345), "12345"}, {u64(kInt64Max), std::to_string(kInt64Max)}, {u64(kInt64Min), std::to_string(kInt64Min)} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_SFIXED32, { {u32(12345), "12345"}, {u32(kInt32Max), std::to_string(kInt32Max)}, {u32(kInt32Min), std::to_string(kInt32Min)} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_BOOL, { {varint(1), "true"}, {varint(0), "false"}, {varint(12345678), "true"} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_SINT32, { {zz32(12345), "12345"}, {zz32(kInt32Max), std::to_string(kInt32Max)}, {zz32(kInt32Min), std::to_string(kInt32Min)} - }); + }, true); TestValidDataForType(FieldDescriptor::TYPE_SINT64, { {zz64(12345), "12345"}, {zz64(kInt64Max), std::to_string(kInt64Max)}, {zz64(kInt64Min), std::to_string(kInt64Min)} - }); + }, true); // TODO(haberman): // TestValidDataForType(FieldDescriptor::TYPE_STRING @@ -1337,14 +1376,14 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, WireFormatLite::DecodeFloat(0x7FA12345)); RunValidJsonTestWithProtobufInput( "FloatFieldNormalizeQuietNan", REQUIRED, message, - "optional_float: nan"); + "optional_float: nan", true); // IEEE floating-point standard 64-bit signaling NaN: // 1111 1111 1xxx xxxx xxxx xxxx xxxx xxxx message.set_optional_float( WireFormatLite::DecodeFloat(0xFFB54321)); RunValidJsonTestWithProtobufInput( "FloatFieldNormalizeSignalingNan", REQUIRED, message, - "optional_float: nan"); + "optional_float: nan", true); } // Special values must be quoted. @@ -1407,12 +1446,12 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, WireFormatLite::DecodeDouble(0x7FFA123456789ABCLL)); RunValidJsonTestWithProtobufInput( "DoubleFieldNormalizeQuietNan", REQUIRED, message, - "optional_double: nan"); + "optional_double: nan", true); message.set_optional_double( WireFormatLite::DecodeDouble(0xFFFBCBA987654321LL)); RunValidJsonTestWithProtobufInput( "DoubleFieldNormalizeSignalingNan", REQUIRED, message, - "optional_double: nan"); + "optional_double: nan", true); } // Special values must be quoted. @@ -1536,31 +1575,31 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, TestAllTypes message; message.set_oneof_uint32(0); RunValidProtobufTestWithMessage( - "OneofZeroUint32", RECOMMENDED, message, "oneof_uint32: 0"); + "OneofZeroUint32", RECOMMENDED, message, "oneof_uint32: 0", true); message.mutable_oneof_nested_message()->set_a(0); RunValidProtobufTestWithMessage( - "OneofZeroMessage", RECOMMENDED, message, "oneof_nested_message: {}"); + "OneofZeroMessage", RECOMMENDED, message, "oneof_nested_message: {}", true); message.set_oneof_string(""); RunValidProtobufTestWithMessage( - "OneofZeroString", RECOMMENDED, message, "oneof_string: \"\""); + "OneofZeroString", RECOMMENDED, message, "oneof_string: \"\"", true); message.set_oneof_bytes(""); RunValidProtobufTestWithMessage( - "OneofZeroBytes", RECOMMENDED, message, "oneof_bytes: \"\""); + "OneofZeroBytes", RECOMMENDED, message, "oneof_bytes: \"\"", true); message.set_oneof_bool(false); RunValidProtobufTestWithMessage( - "OneofZeroBool", RECOMMENDED, message, "oneof_bool: false"); + "OneofZeroBool", RECOMMENDED, message, "oneof_bool: false", true); message.set_oneof_uint64(0); RunValidProtobufTestWithMessage( - "OneofZeroUint64", RECOMMENDED, message, "oneof_uint64: 0"); + "OneofZeroUint64", RECOMMENDED, message, "oneof_uint64: 0", true); message.set_oneof_float(0.0f); RunValidProtobufTestWithMessage( - "OneofZeroFloat", RECOMMENDED, message, "oneof_float: 0"); + "OneofZeroFloat", RECOMMENDED, message, "oneof_float: 0", true); message.set_oneof_double(0.0); RunValidProtobufTestWithMessage( - "OneofZeroDouble", RECOMMENDED, message, "oneof_double: 0"); + "OneofZeroDouble", RECOMMENDED, message, "oneof_double: 0", true); message.set_oneof_enum(TestAllTypes::FOO); RunValidProtobufTestWithMessage( - "OneofZeroEnum", RECOMMENDED, message, "oneof_enum: FOO"); + "OneofZeroEnum", RECOMMENDED, message, "oneof_enum: FOO", true); } RunValidJsonTest( "OneofZeroUint32", RECOMMENDED, diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h index 4e40a6acf3..6bfcd72f53 100644 --- a/conformance/conformance_test.h +++ b/conformance/conformance_test.h @@ -165,7 +165,8 @@ class ConformanceTestSuite { const string& input, conformance::WireFormat input_format, const string& equivalent_text_format, - conformance::WireFormat requested_output); + conformance::WireFormat requested_output, + bool isProto3); void RunValidJsonTest(const string& test_name, ConformanceLevel level, const string& input_json, @@ -174,14 +175,17 @@ class ConformanceTestSuite { const string& test_name, ConformanceLevel level, const protobuf_test_messages::proto3::TestAllTypes& input, - const string& equivalent_text_format); + const string& equivalent_text_format, + bool isProto3); void RunValidProtobufTest(const string& test_name, ConformanceLevel level, const string& input_protobuf, - const string& equivalent_text_format); + const string& equivalent_text_format, + bool isProto3); void RunValidProtobufTestWithMessage( const string& test_name, ConformanceLevel level, const protobuf_test_messages::proto3::TestAllTypes& input, - const string& equivalent_text_format); + const string& equivalent_text_format, + bool isProto3); typedef std::function Validator; void RunValidJsonTestWithValidator(const string& test_name, @@ -196,15 +200,18 @@ class ConformanceTestSuite { const string& text_format); void ExpectParseFailureForProto(const std::string& proto, const std::string& test_name, - ConformanceLevel level); + ConformanceLevel level, + bool isProto3); void ExpectHardParseFailureForProto(const std::string& proto, const std::string& test_name, - ConformanceLevel level); + ConformanceLevel level, + bool isProto3); void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type); void TestIllegalTags(); void TestValidDataForType( google::protobuf::FieldDescriptor::Type, - std::vector> values); + std::vector> values, + bool isProto3); bool CheckSetEmpty(const set& set_to_check, const std::string& write_to_file, const std::string& msg); ConformanceTestRunner* runner_; diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto index 0708cbe7ff..85aa137460 100644 --- a/src/google/protobuf/test_messages_proto2.proto +++ b/src/google/protobuf/test_messages_proto2.proto @@ -50,10 +50,10 @@ option cc_enable_arenas = true; // submessages of this message. So for example, a fuzz test of TestAllTypes // could trigger bugs that occur in any message type in this file. We verify // this stays true in a unit test. -message TestAllTypes { +message TestAllTypesProto2 { message NestedMessage { optional int32 a = 1; - optional TestAllTypes corecursive = 2; + optional TestAllTypesProto2 corecursive = 2; } enum NestedEnum { @@ -89,7 +89,7 @@ message TestAllTypes { optional string optional_string_piece = 24 [ctype=STRING_PIECE]; optional string optional_cord = 25 [ctype=CORD]; - optional TestAllTypes recursive_message = 27; + optional TestAllTypesProto2 recursive_message = 27; // Repeated repeated int32 repeated_int32 = 31; @@ -191,6 +191,6 @@ enum ForeignEnum { FOREIGN_BAZ = 2; } -extend TestAllTypes { +extend TestAllTypesProto2 { optional int32 extension_int32 = 120; } \ No newline at end of file From 18a0c2c4d2894e820f96494f33d8ca3ea33dec3a Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Tue, 27 Jun 2017 18:24:15 -0700 Subject: [PATCH 28/61] add proto2 supported for cpp,python,nodejs,ruby,php --- conformance/ConformanceJava$1.class | Bin 0 -> 1535 bytes .../ConformanceJava$BinaryDecoder$1.class | Bin 0 -> 863 bytes .../ConformanceJava$BinaryDecoder$2.class | Bin 0 -> 1014 bytes .../ConformanceJava$BinaryDecoder$3.class | Bin 0 -> 1644 bytes .../ConformanceJava$BinaryDecoder$4.class | Bin 0 -> 1479 bytes .../ConformanceJava$BinaryDecoder$5.class | Bin 0 -> 1650 bytes .../ConformanceJava$BinaryDecoder$6.class | Bin 0 -> 1716 bytes .../ConformanceJava$BinaryDecoder$7.class | Bin 0 -> 1310 bytes .../ConformanceJava$BinaryDecoder.class | Bin 0 -> 2220 bytes conformance/ConformanceJava.class | Bin 0 -> 7832 bytes conformance/conformance_cpp.cc | 43 ++++-- conformance/conformance_nodejs.js | 20 ++- conformance/conformance_php.php | 11 +- conformance/conformance_php.php~ | 119 +++++++++++++++ conformance/conformance_python.py | 33 ++++- conformance/conformance_ruby.rb | 4 +- conformance/conformance_ruby.rb~ | 131 +++++++++++++++++ conformance/conformance_test.cc | 32 ++++- conformance/failure_list_ruby.txt~ | 135 ++++++++++++++++++ python/setup.py | 1 + ruby/lib/google/protobuf/any_pb.rb | 17 +++ ruby/lib/google/protobuf/api_pb.rb | 39 +++++ ruby/lib/google/protobuf/duration_pb.rb | 17 +++ ruby/lib/google/protobuf/empty_pb.rb | 15 ++ ruby/lib/google/protobuf/field_mask_pb.rb | 16 +++ ruby/lib/google/protobuf/source_context_pb.rb | 16 +++ ruby/lib/google/protobuf/struct_pb.rb | 35 +++++ ruby/lib/google/protobuf/timestamp_pb.rb | 17 +++ ruby/lib/google/protobuf/type_pb.rb | 89 ++++++++++++ ruby/lib/google/protobuf/wrappers_pb.rb | 48 +++++++ ruby/tests/generated_code_pb.rb | 74 ++++++++++ ruby/tests/test_import_pb.rb | 13 ++ 32 files changed, 893 insertions(+), 32 deletions(-) create mode 100644 conformance/ConformanceJava$1.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$1.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$2.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$3.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$4.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$5.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$6.class create mode 100644 conformance/ConformanceJava$BinaryDecoder$7.class create mode 100644 conformance/ConformanceJava$BinaryDecoder.class create mode 100644 conformance/ConformanceJava.class create mode 100755 conformance/conformance_php.php~ create mode 100755 conformance/conformance_ruby.rb~ create mode 100644 conformance/failure_list_ruby.txt~ create mode 100644 ruby/lib/google/protobuf/any_pb.rb create mode 100644 ruby/lib/google/protobuf/api_pb.rb create mode 100644 ruby/lib/google/protobuf/duration_pb.rb create mode 100644 ruby/lib/google/protobuf/empty_pb.rb create mode 100644 ruby/lib/google/protobuf/field_mask_pb.rb create mode 100644 ruby/lib/google/protobuf/source_context_pb.rb create mode 100644 ruby/lib/google/protobuf/struct_pb.rb create mode 100644 ruby/lib/google/protobuf/timestamp_pb.rb create mode 100644 ruby/lib/google/protobuf/type_pb.rb create mode 100644 ruby/lib/google/protobuf/wrappers_pb.rb create mode 100644 ruby/tests/generated_code_pb.rb create mode 100644 ruby/tests/test_import_pb.rb diff --git a/conformance/ConformanceJava$1.class b/conformance/ConformanceJava$1.class new file mode 100644 index 0000000000000000000000000000000000000000..823d43744ad9afcc8341d50dd53c3e6d35105b8f GIT binary patch literal 1535 zcmbVM?M@m&6g`8;0)S7~7a-Sz&eAwF}tviTb-X zF{WvJfWAbNK1ka;C_>ew!DPATp5fj*Gw06CkKf-;06a&;i+i~5K^Go)$Q$HzNWd^B zBiu+{jAD!jjC;tN;B<(4liWNMFeTtI!kTy=-W z%pJ=vDW7SERJ^$*`1sSSf1^j;$C&=$gehbX$w^St|_gMb*$vy|Tp6 zHZi%*;0#-Nn!uOPO)XU|XFV^wWci|YLU-lp}(l>=pZ zmkbq(n5towb+eGvDn%YT-k<_eSB)OSUCZ(ufZ7i9y35H|#>kvuo+=U#1$w%1Q_4h-N9p%Zt> eKBC_+`CWwYyXpN7U?$j)SA>fcKT6)~VEYx15PeRQZn`A2g;Ks6TB;nHR$>W7;;;ynq^$@_E2KtTD`(>@TY2rs-c;mY z!3o5HAHa`7j6;QBwL*xM#yj);X2x&qZ{NRs1@IKxKFYZ1!^fJ3TORH(EIvn%gMt4D%ixt}O;I!%Yd4ERtIQkigLg@=0#wSlnNODPAl ziLey*loF;ZxwS5oJN-zfL9BHwMKCcs)5GaF=*%*4)u>fOIM1l)c`B^sv9Le$_5;`H z8XjtapDfW*41jPP0CdyUX$KOPBf`IQjye_ zM4yQ4ogURtL8FETs55NlQktDaaWgv<5e>#P+YI$T5D%LSjlU*&*kX89FqHq&%kfBv{>HYlC+o5|0OY`eKHaewoc4&uCpjow6LeLD4*a?=wmt wa?}vl2`Lk0nM$sZU&1PG%rV!xMz&4+KJMZgSsAyne(2BJYD55Agv1(TmSHQO#0$U)~6k{04J_Cw;iiRK7VZ!V&q5U@ zJA{R5^NlzcUL;h{J4sBadbNi8ijc4CjwFuKGKq&F}+(d}W^^GAui4CH1RoF(k^tS{qO^kjU& z+xF5(N0->k)YW$7*WfjReegDrgCx`{wy?tbi5{9j9)@Ys^L4Gd+Vq7AJF-L5o0dSszWaI=QroJ@VQmcECTtQbFMNhl>c zRrib$BYr+r_tYm`89$aoqx*#8>Z$)FEisBBqM%5{sx7yGc&``arhyhzIyycvA>Ec}y4y)o6@P<2MqiZC z8GZLhsb_;qtM|%5$@cZwzQ?uhkeQ~y{v_eB83zA&iDQZ3PC@|wDYXnI5}=yO=zH8G z1#Xu-$1+1Msk#fT&QImzf)BkHR1NLf91%=8zOP&-BEiwDo!jY=pAAsSb-Jp)RZ?0f zQ6q+}_+Fh{%r=9>i6?+e5;NU+Wn0!85w(eMY7Bd&cxKBm(iO^Z{Wr#vn#pPfBcok$ z11|=Okb~qN{pHqw?bMNktTeqsC0(let%=jp-I6Vad_vIvwz3!ww%}!^W+t(Zo>Kj_ z(dfnjkQ(jM=s-KIsgcp+>@C=9+B5Xf+(|32K=UCSp<7z}C24oinj3wCwr#W*N5|fv zgT|hRW83K527k3O{&D3!j7L3t$KS&INEdt1j{&6Obr4;#1Q;d>VAH%rt}WAPk+fED z467K#U7Wx@93_o@w0)t2c8-3I0Z!+P<2XG5%6BzRZUa#;gW2j5*9} zSO{YgOJUr_J%)v#{F36(a_oGSWKKGXN}<5r-z*pgs(RbfOl~$WH+)z>iuES z@PJ|LpPMu+Gdv3r;6nA&@Q@)E)QhQR7V~k{p5pi5RjhXM*J)P=Srpzl-IKsB;k}{RE_u8q9`DFwkJjJga@D`(g@&PohGATx t|2Fb&Cw^CH-hvTatJ+i^1N2VPdLO3IPwQQXA-bkhM0!?2xTD72&@UDts44&e literal 0 HcmV?d00001 diff --git a/conformance/ConformanceJava$BinaryDecoder$5.class b/conformance/ConformanceJava$BinaryDecoder$5.class new file mode 100644 index 0000000000000000000000000000000000000000..c5dea858554a0becfaf9a729f90925418319a39b GIT binary patch literal 1650 zcmb_cTT|0O6#kYXTVn(TL_v{?Ra_=KkCK5-3>!F!tbtQFt#@biE@vQ*5d*y# zh(>@d{7UasV*x>ZxE<_XIW zRHW7#Rcm%L65kEwlN26D1p2rx!qBdXaQohrr7bOgm)+A)Q`u(Y1%~~rk?lNLw*A=8 znCK;r%iAGfFcw}o!jD`f$u(nDH3CO0x|&e$oRU=))NSdAC5pv_4hS({kdCK93dpjE z)>Xws7p`(#GEu-a0yc3SH%#2bw22waa?F{S$AXDP++sMFM7=1V*`8a8{dbf%+o)DW z@Y64bo;Ve*vWj<`qysw%y5EqITNh1-S9ZdgS+he?$!Nhgawc3?4X=`sD#}FbfqI^4 z!ky53ZZizEu+PrA(hfG~g+uudvKJ_@yCfV%hQU8x;#gw1oe+S3N-e|j1gNGm`Vlut zf!iU^afczFRNbXk=O+ts!H4cks)kf9PXs${&r^;aiFr2=PQ-8|SIlpB%5F1McpZ-N zH_J-vBx=OqRnPUw(Ofe~oPGkxCh^nlS1C%r5mB=UyUwsriswZcM!HTJuK&hZQcGE_ zU}SV}+{TN6BIF>sQ-8VjU;A|=AvaBLQCSzPesSXDbhYG+p^y-?zpXEZgDrU3$?3D$ zPY?a<2at;2x;`A?JFImIQlsTIGr<&WAq>mk_yNhMi40s(Y}q?oQP$bX&;SY bI`72=93q%bOyS(TLB{BtPUDJR52U{VSzFIv literal 0 HcmV?d00001 diff --git a/conformance/ConformanceJava$BinaryDecoder$6.class b/conformance/ConformanceJava$BinaryDecoder$6.class new file mode 100644 index 0000000000000000000000000000000000000000..d617cce5f32eac7e394edda6ba1a5e08945cd4de GIT binary patch literal 1716 zcmb_cTW=Fb6#gbL8E3O0fpRNNzy-Ipb6Y~7ZE7yTxs;`Lf{4|sPiV3pJKL^jtlf3M zwCeRo^l!8;5P<~m{HV5P)|5DATUAw8nwhg_&iT%LUjF{{Ie;s;YheNxE#&c@h4=A+ zp$dj7nr+6yEaohn#5~6Whr@9xi$x1#xXiJ{@gc*=HDCGh4Te*N%2#4fIDt@2XFCpk z)hxNi&lxhSx-J#+M$m1PN(6NyRm#_sF)^jKPJ%oEg40kDWjg=l4C4YU-9l5sHJ?r z@e;%Mb}YQFtD>FwnFPAb@kuWQ4A%NXPqt%UD{{@+)}7Fk8@>tX#Hv;e9kzt>Yz zf=LKPzOKALN0gANjCXb2#w4zBEZew_8w70QCRS|RLfOVD)@-a}gX2>hx8d5jgU=W) zr^WB8JrVfzBnVFjVH3J!cp_ zJ>94#gO58#499s;* z>BS6Z3U0ACE{Dxf_lz|u>rjN;>sl)rFYnTL$oGw3=GGK${~Yc zIDk)d_u3))8Z!S|8< zb#wm3<}-|adEB0Vg7FuL?i8jmN*GgQ(ISqqFhdmZ2w8lCaePa+-x2?NyiMmce!w~W zNYX#yUHnWu&>H%KE`~YIa=gO{i*ZbsISHPp>kPR%O2Ooa9wMa+3C{$5n$`unKZ%cU WieM&i6<5|QN(p@{S(MB6G? zC4m_Oaa`p{aok{t-*u%M-eVX|=bzgLw&mHfYVC%;E34UD<|#w>hAIn&{=6&2!$z$n z{Gwg*$kJ1{{XlSJ7?MR1g!etKcvKewEpt)|f5WqbKrg*?-cdEHs#MhzR^3;jDm5zB z`cWvFg)*H2_CiX!R}(>CS4D8TZ^hD;3QgN%ooXf3T0F~eZa1`@7X`Z>;XGx|U~Ii~ zL_KtsBt*upYWR-Wb~TTY4J9keui4TO4@iOqtpgF>l8&bW(xD*2eN|4P4|5#zN!-Lj z5*8L2mOJsv$phPS%Mmz7dFzczMfks}GYm&MyUNNvYO#)=ssE%QL$@YcoOjN&GD~(K z%4Sa18zHGD?3x+utA~v7zpAL>=l_Arq3G?kJma@7pr#e(_=_!VU6o-*a3}flcX?JVY&y=HP z>5ZCr+gCLPyIH+0=)X4SYzKxd7q6(#PhYQyVt*TRhHMAYe=9e`U|YV_(%K?==})1b z7`=T+f;xd_Cc4o@V`6r0f*pf>q&dTR`o?JlUeUK7!?a6B?=_>x<~||z8C@R=^CyL` zh(8M9Dc46b5iA(?b@WY?NleYx2AyAaBX@jv&0p2w4rpb~rAqbBY?HbvKpN opf1uphD#WaY#RI!y))z+KpKPOF>oE%HVw*1&sqYrdK^gn1cVN8$^ZZW literal 0 HcmV?d00001 diff --git a/conformance/ConformanceJava$BinaryDecoder.class b/conformance/ConformanceJava$BinaryDecoder.class new file mode 100644 index 0000000000000000000000000000000000000000..3dd7ba076f30d58cb876c7d6da20bde51c0dde6e GIT binary patch literal 2220 zcmb_eTT|Oc6#nE3D-;nNLlYpRP~$c>Bsf4w+CVA32;$TjY8hHJXZ9~XLNLSzx{U4Ip1pi_doCc1n?9k34Ux2(&MFs zG+r@0VaP}bV~amF8L}cCN)TPpHp7mHs07*dzhcOVn3WK4eU%|EVot)S>+dq`iFhPo z%=N!!_(sHI36rj`F?=gxUc$8Nzh-zNU?@?s^y*2R#CA)g4TSeoQeyoQtu&f9OI`iVWTwFVwHtzb)P-1su zL&=?ug>p(fwVlmqg=;_)sdP?B<_kR;W=pWuxZKTZ(b&t#02Ar&fYd3oAShakXf6qhC0eJH=`ou3njPQJiahb=7WE zi^fKU*J1RMnCE#dWIV^GGGhFUK9QkgpP?w=!6ocP;mcUY0UeKPLE!}%4-vT$wkRXo z2W&~kY#*?vGUob#Ez5Y+2ke=Q$9=$_%b4e|+h^+L6=I;Qzx=<%Bw(=zRV;1M@v0m+ z>MPo2qERXt)l<<4xO2Hk3v@b)rfqRWM55PxTNvqJR11DE(8k>s?sYJx1;<$% z6D{2DU{VV{5Zm~$g{cmvwctkq!i8Fx39vul*St;KQZ-)_!>Z&CuqZzKA6)#Wrm*eWYDds92HSW^U7=lbLX5 zrfu-CuvT|{?TWjKpaKhM1j?(xq|(~@L`4x4*j1O66;{OuBEH39{hvG2%w)L5{0hJP za?iQveBXEe-}9V%=Hb6ScnrW&IbTOFt`1@Y{waueGs`sC2ftz*YaEp#=+^XZ#_>6jtDCW=VxDB@}gm>sTh&vU>U8;At zj(c!#0EYs&Pf5LB%{-tZkDCG*Rjh}Vkk2Xp2X!35QT6z|8at-pxDK{+VlN$a@VDzL?mff8+GZ`zR;lBkns}m{H9$sVhr{k6_2xhHJwmY3mWd+hhj_mM| zb)hwo$Ykwd4d3I)*0K@7;*I_3!H$7+dLU_a4B6>ydS`A|M=qO4cC62&Q|r?9pqY)8 z^DGzmS0qx2>`H;BvFT!gx0{O#CT&cltlr$ z&{*-bqS5fQpsqWe+NE5P>Zdoa$T{QxCzvvBJTpZ5(d_Sbhu&Y3(NV@1E9)0!yQ|hQ zApr#t)QBlgPX-EF^rW3&q3b<%j*;LUG*v)MZQQ=`a&xcQku*~S9jEL{*XVueoZWA& zOQ1DD_}2Kum7!;cI+gJ(7Tzkwg)CkB3s=QRAxz|YZd;8MKJz)scs z1%9dFdBK}pLjH{W#`JL!)zOpMYbFzM$I<=ih< zC`4p5UP$UpG@f8E*_IWLrc=>6r>3|xdaYf@{-BncTZnGmE-&e9~TXs0sai;>G^i%Pg5~$Q+rg$vg$7 z!H}4oZODA_3+9!~){{(H17>oSJ&+ru4NB&d1&WgEjN!2h`CMGC-9Q|S`MG5jYd5cp z?qU^})&CIdG18PY5*1_rQO8LicjHd(02B10C-5@nyI2Cl^04LJwT z3C^iVrY=T7zm?cag~zYMJmqE+HFstCWH3o5Ymx&YW5^ru0t!{(hT zzyy;kC}WERvnt0bwz7q8sr70b6U$*~+h4zOPAj`g`#Y6k zxhBg5E8URxPq=mq&Oc)Tr#6r>5B3dbveqDtsLFM?P^=SaD#FxYy|&Cjo(BqcA3w|* zuQqFerZ)YaCLTsS&R$*;vW45Ii;%Km));3eXXLTIaob~(H8ySE_^P2pK+9cBFwqLn zHJx%sbsOC`CvVCeRNGQx(<|qR)EpYJQdGRnjr|oI#j;P(fh^BE>SRF~tO;h4+Kz)z z$fo7$0CiEUZ(kzYzne#>7{cBEiTHxCeH~rx;x;Eq|!aB&aiB5OW0Q7Qh$oP8U;7fKz?&r%R=bHBeQ9${M)GJ;q9Wul@UPEG}4(htxK&;$3rgcGc@Rjcr~L zvjtWfq{Yo3ry&=Z?iyCom#5xobgpD6sz5|OM=vL3+^`iBWV3y$;=3LeYU!VGxj2~v zeU_cz2jrEfN_cQc6%2LHAy}hsLR>SlY|H<9pZC1_D1^x>+ct-JQsbG5XXF(V^h&we z${bz8#8_ix`t8I}Hf?LNf*Wb+{q)7OM3ae?`n2#eH@j9k#0?COnr57P(r))KC@nH> zL3guGWIbYCdIq*5o5!-54l{Wl^(qI$LIx#y0C&xT(>Pv}^8~INUq$WKgg1Gv8<)GG z1odu?89U3&ahoj@g(&YddwFeK#XsKPI6Z#fv(@>}YaIx-vp1jfqDGrXAdKUBbbWW>@{FI5zWA5q^g1E1ghi&rpikM zu!BQh0yD|Xo2DX^7+VE0a0tGZJp7g5XG6oBalHKUFY;avkHfo6I~v&7+@g&_yB@x( zgDsvVlX3E0EncSy1@>Rn;wyAR?D`Ac>HDuLsZ~d0Ab2lggnc$9VS%GU0E9nD!>(}% zc!y9#u#FrZaxNf(O|72#Yqqv}>qCJn+4|~3A=UcpL(|zdw~iuEQckG_w3EGq7F|d? zE}{(=V=k7^eoMzK$LpWMa#cG?Pw&h6!w4SxJoHV4wz}8T>GgE_Je~fqUk%-i##W~n z_AjPUjXrvI1hrjSTi74b_~tv{mywfChP~Hed)Rj!EqOX_MzF{#V%>D0nnLCWHY z5*OAM=Ml8nG~}}F=x{V`g#u|+Lp)MJm%%maL-}HIC6IL z{g|J}0@5{dvWfrAB%WVEtejQXqGHMEF@vTaKZG`Nwdc{{tgq@}`T7lfU*u3PRMcF& zHIGGkFd)?8(Zg6$SbHhQ&&i`xjTe_)mdCm3)nV^a>{L01HoCnU=d<8m%JwK7^~6~F zhGNj{#VjuT45@!i`sc{;6DIUe$@M(Cd6nIZ7kD}QYs&a7rM$>O{2L^B-Mbfm!Bsek zTj{X7#EYYJ`Ed#25w?%9eVpwRqSN)&bh&}2*gnnn8Me<#$O(X%Fk&0%>)K1zBX|Nq z4f`8{HQO`{*AgFZHThI!|3aB-yUT<^T zC{}iPBi=mD@A5TAe8)!dMm8*EWqU#=OD1G0!)iKoi9lTfhh#P)G6xMZ4>4&#qr}i5 zXQNXV;5=zWw=_H8xi6g{1NVsWMOM@;X%Y4T!d5 +#include #include #include @@ -48,6 +49,7 @@ using google::protobuf::util::NewTypeResolverForDescriptorPool; using google::protobuf::util::Status; using google::protobuf::util::TypeResolver; using protobuf_test_messages::proto3::TestAllTypes; +using protobuf_test_messages::proto2::TestAllTypesProto2; using std::string; static const char kTypeUrlPrefix[] = "type.googleapis.com"; @@ -88,16 +90,29 @@ void CheckedWrite(int fd, const void *buf, size_t len) { void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { TestAllTypes test_message; + TestAllTypesProto2 test_message_proto2; + bool isProto3 = request.message_type() == "proto3"; + bool isJson = request.payload_case() == ConformanceRequest::kJsonPayload; switch (request.payload_case()) { - case ConformanceRequest::kProtobufPayload: - if (!test_message.ParseFromString(request.protobuf_payload())) { - // Getting parse details would involve something like: - // http://stackoverflow.com/questions/22121922/how-can-i-get-more-details-about-errors-generated-during-protobuf-parsing-c - response->set_parse_error("Parse error (no more details available)."); - return; + case ConformanceRequest::kProtobufPayload: { + if (isProto3) { + if (!test_message.ParseFromString(request.protobuf_payload())) { + // Getting parse details would involve something like: + // http://stackoverflow.com/questions/22121922/how-can-i-get-more-details-about-errors-generated-during-protobuf-parsing-c + response->set_parse_error("Parse error (no more details available)."); + return; + } + } else if (request.message_type() == "proto2") { + if (!test_message_proto2.ParseFromString(request.protobuf_payload())) { + response->set_parse_error("Parse error (no more details available)."); + return; + } + } else { + GOOGLE_LOG(FATAL) << "Protobuf request doesn't have specific payload type"; } break; + } case ConformanceRequest::kJsonPayload: { string proto_binary; @@ -127,14 +142,22 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { GOOGLE_LOG(FATAL) << "Unspecified output format"; break; - case conformance::PROTOBUF: - GOOGLE_CHECK( - test_message.SerializeToString(response->mutable_protobuf_payload())); + case conformance::PROTOBUF: { + (isProto3 || isJson) ? + GOOGLE_CHECK( + test_message.SerializeToString(response->mutable_protobuf_payload())) + : + GOOGLE_CHECK( + test_message_proto2.SerializeToString(response->mutable_protobuf_payload())); break; + } case conformance::JSON: { string proto_binary; - GOOGLE_CHECK(test_message.SerializeToString(&proto_binary)); + (isProto3 || isJson) ? + GOOGLE_CHECK(test_message.SerializeToString(&proto_binary)) + : + GOOGLE_CHECK(test_message_proto2.SerializeToString(&proto_binary)); Status status = BinaryToJsonString(type_resolver, *type_url, proto_binary, response->mutable_json_payload()); if (!status.ok()) { diff --git a/conformance/conformance_nodejs.js b/conformance/conformance_nodejs.js index 5ee3726994..30294bf664 100755 --- a/conformance/conformance_nodejs.js +++ b/conformance/conformance_nodejs.js @@ -49,14 +49,22 @@ function doTest(request) { } switch (request.getPayloadCase()) { - case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: - try { - testMessage = test_messages_proto3.TestAllTypes.deserializeBinary( - request.getProtobufPayload()); - } catch (err) { - response.setParseError(err.toString()); + case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: { + if (request.getMessageType() == "proto3") { + try { + testMessage = test_messages_proto3.TestAllTypes.deserializeBinary( + request.getProtobufPayload()); + } catch (err) { + response.setParseError(err.toString()); + return response; + } + } else if (request.getMessageType() == "proto2"){ + response.setSkipped("NodeJS doesn\'t support proto2"); return response; + } else { + throw "Protobuf request doesn\'t have specific payload type"; } + } case conformance.ConformanceRequest.PayloadCase.JSON_PAYLOAD: response.setSkipped("JSON not supported."); diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php index 20fb508277..848cb4c7a6 100755 --- a/conformance/conformance_php.php +++ b/conformance/conformance_php.php @@ -45,11 +45,18 @@ function doTest($request) $test_message = new \Protobuf_test_messages\Proto3\TestAllTypes(); $response = new \Conformance\ConformanceResponse(); if ($request->getPayload() == "protobuf_payload") { - try { + if ($request->getMessageType() == "proto3") { + try { $test_message->mergeFromString($request->getProtobufPayload()); - } catch (Exception $e) { + } catch (Exception $e) { $response->setParseError($e->getMessage()); return $response; + } + } elseif ($request->getMessageType() == "proto2") { + $response->setSkipped("PHP doesn't support proto2"); + return $response; + } else { + trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR); } } elseif ($request->getPayload() == "json_payload") { try { diff --git a/conformance/conformance_php.php~ b/conformance/conformance_php.php~ new file mode 100755 index 0000000000..848cb4c7a6 --- /dev/null +++ b/conformance/conformance_php.php~ @@ -0,0 +1,119 @@ +getPayload() == "protobuf_payload") { + if ($request->getMessageType() == "proto3") { + try { + $test_message->mergeFromString($request->getProtobufPayload()); + } catch (Exception $e) { + $response->setParseError($e->getMessage()); + return $response; + } + } elseif ($request->getMessageType() == "proto2") { + $response->setSkipped("PHP doesn't support proto2"); + return $response; + } else { + trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR); + } + } elseif ($request->getPayload() == "json_payload") { + try { + $test_message->jsonDecode($request->getJsonPayload()); + } catch (Exception $e) { + $response->setParseError($e->getMessage()); + return $response; + } + } else { + trigger_error("Request didn't have payload.", E_USER_ERROR); + } + + if ($request->getRequestedOutputFormat() == WireFormat::UNSPECIFIED) { + trigger_error("Unspecified output format.", E_USER_ERROR); + } elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) { + $response->setProtobufPayload($test_message->serializeToString()); + } elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) { + $response->setJsonPayload($test_message->jsonEncode()); + } + + return $response; +} + +function doTestIO() +{ + $length_bytes = fread(STDIN, 4); + if (strlen($length_bytes) == 0) { + return false; # EOF + } elseif (strlen($length_bytes) != 4) { + trigger_error("I/O error", E_USER_ERROR); + } + + $length = unpack("V", $length_bytes)[1]; + $serialized_request = fread(STDIN, $length); + if (strlen($serialized_request) != $length) { + trigger_error("I/O error", E_USER_ERROR); + } + + $request = new \Conformance\ConformanceRequest(); + $request->mergeFromString($serialized_request); + + $response = doTest($request); + + $serialized_response = $response->serializeToString(); + fwrite(STDOUT, pack("V", strlen($serialized_response))); + fwrite(STDOUT, $serialized_response); + + $GLOBALS['test_count'] += 1; + + return true; +} + +while(true){ + if (!doTestIO()) { + fprintf(STDERR, + "conformance_php: received EOF from test runner " + + "after %d tests, exiting\n", $test_count); + exit; + } +} diff --git a/conformance/conformance_python.py b/conformance/conformance_python.py index 7ace9b1672..846ccbc646 100755 --- a/conformance/conformance_python.py +++ b/conformance/conformance_python.py @@ -41,6 +41,7 @@ import os from google.protobuf import json_format from google.protobuf import message from google.protobuf import test_messages_proto3_pb2 +from google.protobuf import test_messages_proto2_pb2 import conformance_pb2 sys.stdout = os.fdopen(sys.stdout.fileno(), 'wb', 0) @@ -56,14 +57,26 @@ def do_test(request): test_message = test_messages_proto3_pb2.TestAllTypes() response = conformance_pb2.ConformanceResponse() test_message = test_messages_proto3_pb2.TestAllTypes() + test_message_proto2 = test_messages_proto2_pb2.TestAllTypesProto2() + isProto3 = (request.message_type == "proto3") + isJson = (request.WhichOneof('payload') == 'json_payload') try: if request.WhichOneof('payload') == 'protobuf_payload': - try: - test_message.ParseFromString(request.protobuf_payload) - except message.DecodeError as e: - response.parse_error = str(e) - return response + if isProto3: + try: + test_message.ParseFromString(request.protobuf_payload) + except message.DecodeError as e: + response.parse_error = str(e) + return response + elif request.message_type == "proto2": + try: + test_message_proto2.ParseFromString(request.protobuf_payload) + except message.DecodeError as e: + response.parse_error = str(e) + return response + else: + raise ProtocolError("Protobuf request doesn't have specific payload type") elif request.WhichOneof('payload') == 'json_payload': try: @@ -79,11 +92,17 @@ def do_test(request): raise ProtocolError("Unspecified output format") elif request.requested_output_format == conformance_pb2.PROTOBUF: - response.protobuf_payload = test_message.SerializeToString() + if isProto3 or isJson: + response.protobuf_payload = test_message.SerializeToString() + else: + response.protobuf_payload = test_message_proto2.SerializeToString() elif request.requested_output_format == conformance_pb2.JSON: try: - response.json_payload = json_format.MessageToJson(test_message) + if isProto3 or isJson: + response.json_payload = json_format.MessageToJson(test_message) + else: + response.json_payload = json_format.MessageToJson(test_message_proto2) except Exception as e: response.serialize_error = str(e) return response diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index a1170e4c34..552344b46b 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -53,9 +53,9 @@ def do_test(request) end elsif request.message_type.eql?('proto2') response.skipped = "Ruby doesn't support proto2" - return respons + return response else - fail "Protobuf request doesn't have specific type" + fail "Protobuf request doesn't have specific payload type" end when :json_payload diff --git a/conformance/conformance_ruby.rb~ b/conformance/conformance_ruby.rb~ new file mode 100755 index 0000000000..7e756d18a6 --- /dev/null +++ b/conformance/conformance_ruby.rb~ @@ -0,0 +1,131 @@ +#!/usr/bin/env ruby +# +# Protocol Buffers - Google's data interchange format +# Copyright 2008 Google Inc. All rights reserved. +# https://developers.google.com/protocol-buffers/ +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +require 'conformance_pb' +require 'google/protobuf/test_messages_proto3_pb' + +$test_count = 0 +$verbose = false + +def do_test(request) + test_message = ProtobufTestMessages::Proto3::TestAllTypes.new + response = Conformance::ConformanceResponse.new + + begin + case request.payload + when :protobuf_payload + if request.message_type.eql?('proto3') + begin + test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( + request.protobuf_payload) + rescue Google::Protobuf::ParseError => err + response.parse_error = err.message.encode('utf-8') + return response + end + elsif request.message_type.eql?('proto2') + response.skipped = "Ruby doesn't support proto2" + return response + else + fail "Protobuf request doesn't have specific type" + end + + when :json_payload + begin + test_message = ProtobufTestMessages::Proto3::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" + end + + case request.requested_output_format + when :UNSPECIFIED + fail 'Unspecified output format' + + when :PROTOBUF + response.protobuf_payload = test_message.to_proto + + 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') + end + + response +end + +# Returns true if the test ran successfully, false on legitimate EOF. +# If EOF is encountered in an unexpected place, raises IOError. +def do_test_io + length_bytes = STDIN.read(4) + return false if length_bytes.nil? + + length = length_bytes.unpack('V').first + serialized_request = STDIN.read(length) + if serialized_request.nil? || serialized_request.length != length + fail IOError + end + + request = Conformance::ConformanceRequest.decode(serialized_request) + + response = do_test(request) + + serialized_response = Conformance::ConformanceResponse.encode(response) + STDOUT.write([serialized_response.length].pack('V')) + STDOUT.write(serialized_response) + STDOUT.flush + + if $verbose + STDERR.puts("conformance_ruby: request=#{request.to_json}, " \ + "response=#{response.to_json}\n") + end + + $test_count += 1 + + true +end + +loop do + unless do_test_io + STDERR.puts('conformance_ruby: received EOF from test runner ' \ + "after #{$test_count} tests, exiting") + break + end +end diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index 9b153fdb52..f44fe8a10c 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -277,8 +277,13 @@ void ConformanceTestSuite::RunValidInputTest( WireFormat input_format, const string& equivalent_text_format, WireFormat requested_output, bool isProto3) { TestAllTypes reference_message; + TestAllTypesProto2 reference_message_proto2; GOOGLE_CHECK( - TextFormat::ParseFromString(equivalent_text_format, &reference_message)) + isProto3 ? + TextFormat::ParseFromString(equivalent_text_format, &reference_message) + : + TextFormat::ParseFromString(equivalent_text_format, &reference_message_proto2) + ) << "Failed to parse data for test case: " << test_name << ", data: " << equivalent_text_format; @@ -401,7 +406,13 @@ void ConformanceTestSuite::RunValidInputTest( string differences; differencer.ReportDifferencesToString(&differences); - if (differencer.Compare(reference_message, test_message)) { + bool check; + if (isProto3) { + check = differencer.Compare(reference_message, test_message); + } else { + check = differencer.Compare(reference_message_proto2, test_message_proto2); + } + if (check) { ReportSuccess(test_name); } else { ReportFailure(test_name, level, request, response, @@ -477,12 +488,16 @@ void ConformanceTestSuite::RunValidProtobufTest( const string& test_name, ConformanceLevel level, const string& input_protobuf, const string& equivalent_text_format, bool isProto3) { + string rname = ".ProtobufInput."; + if (!isProto3) { + rname = ".Protobuf2Input."; + } RunValidInputTest( - ConformanceLevelToString(level) + ".ProtobufInput." + test_name + + ConformanceLevelToString(level) + rname + test_name + ".ProtobufOutput", level, input_protobuf, conformance::PROTOBUF, equivalent_text_format, conformance::PROTOBUF, isProto3); RunValidInputTest( - ConformanceLevelToString(level) + ".ProtobufInput." + test_name + + ConformanceLevelToString(level) + rname + test_name + ".JsonOutput", level, input_protobuf, conformance::PROTOBUF, equivalent_text_format, conformance::JSON, isProto3); } @@ -704,7 +719,8 @@ void ConformanceTestSuite::TestValidDataForType( proto += cat(tag(rep_field->number(), wire_type), values[i].first); text += rep_field->name() + ": " + values[i].second + " "; } - RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED, proto, text, true); + RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED, + proto, text, isProto3); } void ConformanceTestSuite::SetFailureList(const string& filename, @@ -796,6 +812,12 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {dbl(1.7976931348623157e+308), "1.7976931348623157e+308"}, {dbl(2.22507385850720138309e-308), "2.22507385850720138309e-308"} }, true); + TestValidDataForType(FieldDescriptor::TYPE_DOUBLE, { + {dbl(0.1), "0.1"}, + {dbl(1.7976931348623157e+308), "1.7976931348623157e+308"}, + {dbl(2.22507385850720138309e-308), "2.22507385850720138309e-308"} + }, false); + TestValidDataForType(FieldDescriptor::TYPE_FLOAT, { {flt(0.1), "0.1"}, {flt(1.00000075e-36), "1.00000075e-36"}, diff --git a/conformance/failure_list_ruby.txt~ b/conformance/failure_list_ruby.txt~ new file mode 100644 index 0000000000..b0d2fe58c8 --- /dev/null +++ b/conformance/failure_list_ruby.txt~ @@ -0,0 +1,135 @@ +Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput +Recommended.FieldMaskPathsDontRoundTrip.JsonOutput +Recommended.FieldMaskTooManyUnderscore.JsonOutput +Recommended.JsonInput.DurationHas3FractionalDigits.Validator +Recommended.JsonInput.DurationHas6FractionalDigits.Validator +Recommended.JsonInput.DurationHas9FractionalDigits.Validator +Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator +Recommended.JsonInput.Int64FieldBeString.Validator +Recommended.JsonInput.MapFieldValueIsNull +Recommended.JsonInput.RepeatedFieldMessageElementIsNull +Recommended.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.JsonInput.StringEndsWithEscapeChar +Recommended.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.JsonInput.TimestampHas3FractionalDigits.Validator +Recommended.JsonInput.TimestampHas6FractionalDigits.Validator +Recommended.JsonInput.TimestampHas9FractionalDigits.Validator +Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator +Recommended.JsonInput.TimestampZeroNormalized.Validator +Recommended.JsonInput.Uint64FieldBeString.Validator +Required.DurationProtoInputTooLarge.JsonOutput +Required.DurationProtoInputTooSmall.JsonOutput +Required.JsonInput.Any.JsonOutput +Required.JsonInput.Any.ProtobufOutput +Required.JsonInput.AnyNested.JsonOutput +Required.JsonInput.AnyNested.ProtobufOutput +Required.JsonInput.AnyUnorderedTypeTag.JsonOutput +Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput +Required.JsonInput.AnyWithDuration.JsonOutput +Required.JsonInput.AnyWithDuration.ProtobufOutput +Required.JsonInput.AnyWithFieldMask.JsonOutput +Required.JsonInput.AnyWithFieldMask.ProtobufOutput +Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput +Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput +Required.JsonInput.AnyWithStruct.JsonOutput +Required.JsonInput.AnyWithStruct.ProtobufOutput +Required.JsonInput.AnyWithTimestamp.JsonOutput +Required.JsonInput.AnyWithTimestamp.ProtobufOutput +Required.JsonInput.AnyWithValueForInteger.JsonOutput +Required.JsonInput.AnyWithValueForInteger.ProtobufOutput +Required.JsonInput.AnyWithValueForJsonObject.JsonOutput +Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput +Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput +Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput +Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput +Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput +Required.JsonInput.DoubleFieldNan.JsonOutput +Required.JsonInput.DurationMaxValue.JsonOutput +Required.JsonInput.DurationMaxValue.ProtobufOutput +Required.JsonInput.DurationMinValue.JsonOutput +Required.JsonInput.DurationMinValue.ProtobufOutput +Required.JsonInput.DurationRepeatedValue.JsonOutput +Required.JsonInput.DurationRepeatedValue.ProtobufOutput +Required.JsonInput.FieldMask.JsonOutput +Required.JsonInput.FieldMask.ProtobufOutput +Required.JsonInput.FloatFieldInfinity.JsonOutput +Required.JsonInput.FloatFieldNan.JsonOutput +Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput +Required.JsonInput.FloatFieldTooLarge +Required.JsonInput.FloatFieldTooSmall +Required.JsonInput.OneofFieldDuplicate +Required.JsonInput.OptionalBoolWrapper.JsonOutput +Required.JsonInput.OptionalBoolWrapper.ProtobufOutput +Required.JsonInput.OptionalBytesWrapper.JsonOutput +Required.JsonInput.OptionalBytesWrapper.ProtobufOutput +Required.JsonInput.OptionalDoubleWrapper.JsonOutput +Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput +Required.JsonInput.OptionalFloatWrapper.JsonOutput +Required.JsonInput.OptionalFloatWrapper.ProtobufOutput +Required.JsonInput.OptionalInt32Wrapper.JsonOutput +Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput +Required.JsonInput.OptionalInt64Wrapper.JsonOutput +Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput +Required.JsonInput.OptionalStringWrapper.JsonOutput +Required.JsonInput.OptionalStringWrapper.ProtobufOutput +Required.JsonInput.OptionalUint32Wrapper.JsonOutput +Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput +Required.JsonInput.OptionalUint64Wrapper.JsonOutput +Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput +Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput +Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput +Required.JsonInput.RepeatedBoolWrapper.JsonOutput +Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput +Required.JsonInput.RepeatedBytesWrapper.JsonOutput +Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput +Required.JsonInput.RepeatedDoubleWrapper.JsonOutput +Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput +Required.JsonInput.RepeatedFloatWrapper.JsonOutput +Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput +Required.JsonInput.RepeatedInt32Wrapper.JsonOutput +Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput +Required.JsonInput.RepeatedInt64Wrapper.JsonOutput +Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput +Required.JsonInput.RepeatedStringWrapper.JsonOutput +Required.JsonInput.RepeatedStringWrapper.ProtobufOutput +Required.JsonInput.RepeatedUint32Wrapper.JsonOutput +Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput +Required.JsonInput.RepeatedUint64Wrapper.JsonOutput +Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput +Required.JsonInput.StringFieldSurrogatePair.JsonOutput +Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput +Required.JsonInput.Struct.JsonOutput +Required.JsonInput.Struct.ProtobufOutput +Required.JsonInput.TimestampMaxValue.JsonOutput +Required.JsonInput.TimestampMaxValue.ProtobufOutput +Required.JsonInput.TimestampMinValue.JsonOutput +Required.JsonInput.TimestampMinValue.ProtobufOutput +Required.JsonInput.TimestampRepeatedValue.JsonOutput +Required.JsonInput.TimestampRepeatedValue.ProtobufOutput +Required.JsonInput.TimestampWithNegativeOffset.JsonOutput +Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput +Required.JsonInput.TimestampWithPositiveOffset.JsonOutput +Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput +Required.JsonInput.ValueAcceptBool.JsonOutput +Required.JsonInput.ValueAcceptBool.ProtobufOutput +Required.JsonInput.ValueAcceptFloat.JsonOutput +Required.JsonInput.ValueAcceptFloat.ProtobufOutput +Required.JsonInput.ValueAcceptInteger.JsonOutput +Required.JsonInput.ValueAcceptInteger.ProtobufOutput +Required.JsonInput.ValueAcceptList.JsonOutput +Required.JsonInput.ValueAcceptList.ProtobufOutput +Required.JsonInput.ValueAcceptNull.JsonOutput +Required.JsonInput.ValueAcceptNull.ProtobufOutput +Required.JsonInput.ValueAcceptObject.JsonOutput +Required.JsonInput.ValueAcceptObject.ProtobufOutput +Required.JsonInput.ValueAcceptString.JsonOutput +Required.JsonInput.ValueAcceptString.ProtobufOutput +Required.Protobuf3Input.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Protobuf3Input.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Protobuf3Input.FloatFieldNormalizeQuietNan.JsonOutput +Required.Protobuf3Input.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Protobuf3Input.ValidDataRepeated.FLOAT.JsonOutput +Required.TimestampProtoInputTooLarge.JsonOutput +Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/python/setup.py b/python/setup.py index a2026706e4..70b7de5c2e 100755 --- a/python/setup.py +++ b/python/setup.py @@ -80,6 +80,7 @@ def GenerateUnittestProtos(): generate_proto("../src/google/protobuf/any_test.proto", False) generate_proto("../src/google/protobuf/map_unittest.proto", False) generate_proto("../src/google/protobuf/test_messages_proto3.proto", False) + generate_proto("../src/google/protobuf/test_messages_proto2.proto", False) generate_proto("../src/google/protobuf/unittest_arena.proto", False) generate_proto("../src/google/protobuf/unittest_no_arena.proto", False) generate_proto("../src/google/protobuf/unittest_no_arena_import.proto", False) diff --git a/ruby/lib/google/protobuf/any_pb.rb b/ruby/lib/google/protobuf/any_pb.rb new file mode 100644 index 0000000000..88d2c12b8a --- /dev/null +++ b/ruby/lib/google/protobuf/any_pb.rb @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/any.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Any" do + optional :type_url, :string, 1 + optional :value, :bytes, 2 + end +end + +module Google + module Protobuf + Any = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Any").msgclass + end +end diff --git a/ruby/lib/google/protobuf/api_pb.rb b/ruby/lib/google/protobuf/api_pb.rb new file mode 100644 index 0000000000..1676b58750 --- /dev/null +++ b/ruby/lib/google/protobuf/api_pb.rb @@ -0,0 +1,39 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/api.proto + +require 'google/protobuf' + +require 'google/protobuf/source_context_pb' +require 'google/protobuf/type_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Api" do + optional :name, :string, 1 + repeated :methods, :message, 2, "google.protobuf.Method" + repeated :options, :message, 3, "google.protobuf.Option" + optional :version, :string, 4 + optional :source_context, :message, 5, "google.protobuf.SourceContext" + repeated :mixins, :message, 6, "google.protobuf.Mixin" + optional :syntax, :enum, 7, "google.protobuf.Syntax" + end + add_message "google.protobuf.Method" do + optional :name, :string, 1 + optional :request_type_url, :string, 2 + optional :request_streaming, :bool, 3 + optional :response_type_url, :string, 4 + optional :response_streaming, :bool, 5 + repeated :options, :message, 6, "google.protobuf.Option" + optional :syntax, :enum, 7, "google.protobuf.Syntax" + end + add_message "google.protobuf.Mixin" do + optional :name, :string, 1 + optional :root, :string, 2 + end +end + +module Google + module Protobuf + Api = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Api").msgclass + Method = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Method").msgclass + Mixin = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Mixin").msgclass + end +end diff --git a/ruby/lib/google/protobuf/duration_pb.rb b/ruby/lib/google/protobuf/duration_pb.rb new file mode 100644 index 0000000000..c93f5987d2 --- /dev/null +++ b/ruby/lib/google/protobuf/duration_pb.rb @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/duration.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Duration" do + optional :seconds, :int64, 1 + optional :nanos, :int32, 2 + end +end + +module Google + module Protobuf + Duration = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass + end +end diff --git a/ruby/lib/google/protobuf/empty_pb.rb b/ruby/lib/google/protobuf/empty_pb.rb new file mode 100644 index 0000000000..580db6ddbf --- /dev/null +++ b/ruby/lib/google/protobuf/empty_pb.rb @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/empty.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Empty" do + end +end + +module Google + module Protobuf + Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass + end +end diff --git a/ruby/lib/google/protobuf/field_mask_pb.rb b/ruby/lib/google/protobuf/field_mask_pb.rb new file mode 100644 index 0000000000..ea2811abd6 --- /dev/null +++ b/ruby/lib/google/protobuf/field_mask_pb.rb @@ -0,0 +1,16 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/field_mask.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.FieldMask" do + repeated :paths, :string, 1 + end +end + +module Google + module Protobuf + FieldMask = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass + end +end diff --git a/ruby/lib/google/protobuf/source_context_pb.rb b/ruby/lib/google/protobuf/source_context_pb.rb new file mode 100644 index 0000000000..d099d0ea98 --- /dev/null +++ b/ruby/lib/google/protobuf/source_context_pb.rb @@ -0,0 +1,16 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/source_context.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.SourceContext" do + optional :file_name, :string, 1 + end +end + +module Google + module Protobuf + SourceContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass + end +end diff --git a/ruby/lib/google/protobuf/struct_pb.rb b/ruby/lib/google/protobuf/struct_pb.rb new file mode 100644 index 0000000000..af53c6e161 --- /dev/null +++ b/ruby/lib/google/protobuf/struct_pb.rb @@ -0,0 +1,35 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/struct.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Struct" do + map :fields, :string, :message, 1, "google.protobuf.Value" + end + add_message "google.protobuf.Value" do + oneof :kind do + optional :null_value, :enum, 1, "google.protobuf.NullValue" + optional :number_value, :double, 2 + optional :string_value, :string, 3 + optional :bool_value, :bool, 4 + optional :struct_value, :message, 5, "google.protobuf.Struct" + optional :list_value, :message, 6, "google.protobuf.ListValue" + end + end + add_message "google.protobuf.ListValue" do + repeated :values, :message, 1, "google.protobuf.Value" + end + add_enum "google.protobuf.NullValue" do + value :NULL_VALUE, 0 + end +end + +module Google + module Protobuf + Struct = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Struct").msgclass + Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Value").msgclass + ListValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ListValue").msgclass + NullValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.NullValue").enummodule + end +end diff --git a/ruby/lib/google/protobuf/timestamp_pb.rb b/ruby/lib/google/protobuf/timestamp_pb.rb new file mode 100644 index 0000000000..7af3333980 --- /dev/null +++ b/ruby/lib/google/protobuf/timestamp_pb.rb @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/timestamp.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Timestamp" do + optional :seconds, :int64, 1 + optional :nanos, :int32, 2 + end +end + +module Google + module Protobuf + Timestamp = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass + end +end diff --git a/ruby/lib/google/protobuf/type_pb.rb b/ruby/lib/google/protobuf/type_pb.rb new file mode 100644 index 0000000000..ffcbb9deb6 --- /dev/null +++ b/ruby/lib/google/protobuf/type_pb.rb @@ -0,0 +1,89 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/type.proto + +require 'google/protobuf' + +require 'google/protobuf/any_pb' +require 'google/protobuf/source_context_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.Type" do + optional :name, :string, 1 + repeated :fields, :message, 2, "google.protobuf.Field" + repeated :oneofs, :string, 3 + repeated :options, :message, 4, "google.protobuf.Option" + optional :source_context, :message, 5, "google.protobuf.SourceContext" + optional :syntax, :enum, 6, "google.protobuf.Syntax" + end + add_message "google.protobuf.Field" do + optional :kind, :enum, 1, "google.protobuf.Field.Kind" + optional :cardinality, :enum, 2, "google.protobuf.Field.Cardinality" + optional :number, :int32, 3 + optional :name, :string, 4 + optional :type_url, :string, 6 + optional :oneof_index, :int32, 7 + optional :packed, :bool, 8 + repeated :options, :message, 9, "google.protobuf.Option" + optional :json_name, :string, 10 + optional :default_value, :string, 11 + end + add_enum "google.protobuf.Field.Kind" do + value :TYPE_UNKNOWN, 0 + value :TYPE_DOUBLE, 1 + value :TYPE_FLOAT, 2 + value :TYPE_INT64, 3 + value :TYPE_UINT64, 4 + value :TYPE_INT32, 5 + value :TYPE_FIXED64, 6 + value :TYPE_FIXED32, 7 + value :TYPE_BOOL, 8 + value :TYPE_STRING, 9 + value :TYPE_GROUP, 10 + value :TYPE_MESSAGE, 11 + value :TYPE_BYTES, 12 + value :TYPE_UINT32, 13 + value :TYPE_ENUM, 14 + value :TYPE_SFIXED32, 15 + value :TYPE_SFIXED64, 16 + value :TYPE_SINT32, 17 + value :TYPE_SINT64, 18 + end + add_enum "google.protobuf.Field.Cardinality" do + value :CARDINALITY_UNKNOWN, 0 + value :CARDINALITY_OPTIONAL, 1 + value :CARDINALITY_REQUIRED, 2 + value :CARDINALITY_REPEATED, 3 + end + add_message "google.protobuf.Enum" do + optional :name, :string, 1 + repeated :enumvalue, :message, 2, "google.protobuf.EnumValue" + repeated :options, :message, 3, "google.protobuf.Option" + optional :source_context, :message, 4, "google.protobuf.SourceContext" + optional :syntax, :enum, 5, "google.protobuf.Syntax" + end + add_message "google.protobuf.EnumValue" do + optional :name, :string, 1 + optional :number, :int32, 2 + repeated :options, :message, 3, "google.protobuf.Option" + end + add_message "google.protobuf.Option" do + optional :name, :string, 1 + optional :value, :message, 2, "google.protobuf.Any" + end + add_enum "google.protobuf.Syntax" do + value :SYNTAX_PROTO2, 0 + value :SYNTAX_PROTO3, 1 + end +end + +module Google + module Protobuf + Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Type").msgclass + Field = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field").msgclass + Field::Kind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Kind").enummodule + Field::Cardinality = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Cardinality").enummodule + Enum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Enum").msgclass + EnumValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValue").msgclass + Option = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Option").msgclass + Syntax = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Syntax").enummodule + end +end diff --git a/ruby/lib/google/protobuf/wrappers_pb.rb b/ruby/lib/google/protobuf/wrappers_pb.rb new file mode 100644 index 0000000000..e26a4d23c6 --- /dev/null +++ b/ruby/lib/google/protobuf/wrappers_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/wrappers.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.protobuf.DoubleValue" do + optional :value, :double, 1 + end + add_message "google.protobuf.FloatValue" do + optional :value, :float, 1 + end + add_message "google.protobuf.Int64Value" do + optional :value, :int64, 1 + end + add_message "google.protobuf.UInt64Value" do + optional :value, :uint64, 1 + end + add_message "google.protobuf.Int32Value" do + optional :value, :int32, 1 + end + add_message "google.protobuf.UInt32Value" do + optional :value, :uint32, 1 + end + add_message "google.protobuf.BoolValue" do + optional :value, :bool, 1 + end + add_message "google.protobuf.StringValue" do + optional :value, :string, 1 + end + add_message "google.protobuf.BytesValue" do + optional :value, :bytes, 1 + end +end + +module Google + module Protobuf + DoubleValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DoubleValue").msgclass + FloatValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FloatValue").msgclass + Int64Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int64Value").msgclass + UInt64Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt64Value").msgclass + Int32Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int32Value").msgclass + UInt32Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt32Value").msgclass + BoolValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BoolValue").msgclass + StringValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.StringValue").msgclass + BytesValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BytesValue").msgclass + end +end diff --git a/ruby/tests/generated_code_pb.rb b/ruby/tests/generated_code_pb.rb new file mode 100644 index 0000000000..0358ada781 --- /dev/null +++ b/ruby/tests/generated_code_pb.rb @@ -0,0 +1,74 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tests/generated_code.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "a.b.c.TestMessage" do + optional :optional_int32, :int32, 1 + optional :optional_int64, :int64, 2 + optional :optional_uint32, :uint32, 3 + optional :optional_uint64, :uint64, 4 + optional :optional_bool, :bool, 5 + optional :optional_double, :double, 6 + optional :optional_float, :float, 7 + optional :optional_string, :string, 8 + optional :optional_bytes, :bytes, 9 + optional :optional_enum, :enum, 10, "a.b.c.TestEnum" + optional :optional_msg, :message, 11, "a.b.c.TestMessage" + repeated :repeated_int32, :int32, 21 + repeated :repeated_int64, :int64, 22 + repeated :repeated_uint32, :uint32, 23 + repeated :repeated_uint64, :uint64, 24 + repeated :repeated_bool, :bool, 25 + repeated :repeated_double, :double, 26 + repeated :repeated_float, :float, 27 + repeated :repeated_string, :string, 28 + repeated :repeated_bytes, :bytes, 29 + repeated :repeated_enum, :enum, 30, "a.b.c.TestEnum" + repeated :repeated_msg, :message, 31, "a.b.c.TestMessage" + map :map_int32_string, :int32, :string, 61 + map :map_int64_string, :int64, :string, 62 + map :map_uint32_string, :uint32, :string, 63 + map :map_uint64_string, :uint64, :string, 64 + map :map_bool_string, :bool, :string, 65 + map :map_string_string, :string, :string, 66 + map :map_string_msg, :string, :message, 67, "a.b.c.TestMessage" + map :map_string_enum, :string, :enum, 68, "a.b.c.TestEnum" + map :map_string_int32, :string, :int32, 69 + map :map_string_bool, :string, :bool, 70 + optional :nested_message, :message, 80, "a.b.c.TestMessage.NestedMessage" + oneof :my_oneof do + optional :oneof_int32, :int32, 41 + optional :oneof_int64, :int64, 42 + optional :oneof_uint32, :uint32, 43 + optional :oneof_uint64, :uint64, 44 + optional :oneof_bool, :bool, 45 + optional :oneof_double, :double, 46 + optional :oneof_float, :float, 47 + optional :oneof_string, :string, 48 + optional :oneof_bytes, :bytes, 49 + optional :oneof_enum, :enum, 50, "a.b.c.TestEnum" + optional :oneof_msg, :message, 51, "a.b.c.TestMessage" + end + end + add_message "a.b.c.TestMessage.NestedMessage" do + optional :foo, :int32, 1 + end + add_enum "a.b.c.TestEnum" do + value :Default, 0 + value :A, 1 + value :B, 2 + value :C, 3 + end +end + +module A + module B + module C + TestMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("a.b.c.TestMessage").msgclass + TestMessage::NestedMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("a.b.c.TestMessage.NestedMessage").msgclass + TestEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("a.b.c.TestEnum").enummodule + end + end +end diff --git a/ruby/tests/test_import_pb.rb b/ruby/tests/test_import_pb.rb new file mode 100644 index 0000000000..83f04d6053 --- /dev/null +++ b/ruby/tests/test_import_pb.rb @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tests/test_import.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "foo_bar.TestImportedMessage" do + end +end + +module FooBar + TestImportedMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("foo_bar.TestImportedMessage").msgclass +end From 0fa4e58525445b0b735aae048575f33cfd41aa83 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Tue, 27 Jun 2017 18:31:44 -0700 Subject: [PATCH 29/61] change ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 798559d7c7..884ab97ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ # autogen.sh-generated files Makefile.in src/Makefile.in From 696cf779d457c89184ea1d4aa18702f7cca63fd1 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 11:32:01 -0700 Subject: [PATCH 30/61] add java supported --- conformance/ConformanceJava$1.class | Bin 1535 -> 1535 bytes .../ConformanceJava$BinaryDecoder$1.class | Bin 863 -> 1241 bytes .../ConformanceJava$BinaryDecoder$2.class | Bin 1014 -> 1482 bytes .../ConformanceJava$BinaryDecoder$3.class | Bin 1644 -> 2256 bytes .../ConformanceJava$BinaryDecoder$4.class | Bin 1479 -> 2057 bytes .../ConformanceJava$BinaryDecoder$5.class | Bin 1650 -> 2270 bytes .../ConformanceJava$BinaryDecoder$6.class | Bin 1716 -> 2339 bytes .../ConformanceJava$BinaryDecoder$7.class | Bin 1310 -> 1860 bytes .../ConformanceJava$BinaryDecoder.class | Bin 2220 -> 2553 bytes conformance/ConformanceJava.class | Bin 7832 -> 9250 bytes conformance/ConformanceJava.java | 201 ++++++++++++++++-- 11 files changed, 184 insertions(+), 17 deletions(-) diff --git a/conformance/ConformanceJava$1.class b/conformance/ConformanceJava$1.class index 823d43744ad9afcc8341d50dd53c3e6d35105b8f..ab225e5710171dc5627e09f7b0315190053e4958 100644 GIT binary patch delta 18 acmey*{hxcobXGRTB@AYawUg(vCIJ9LX9iaQ delta 18 acmey*{hxcobXGQo{|sgfk0#G$O#%Q&g9jA= diff --git a/conformance/ConformanceJava$BinaryDecoder$1.class b/conformance/ConformanceJava$BinaryDecoder$1.class index 940e39f0dd7cec4f30816c636807c6afae2a71c5..b54414b4a12add35e2e812d3b94a6c6d8c73bc75 100644 GIT binary patch delta 501 zcma)3yG{a85IwWIaF^vNuJVu-R21ATOpt;ENg%N@(OB>SQmi&4kX;%pqov(uV`5?9 zCupUy@B{n>3k93n!VGJ7>T z9i$min37?igZ@Kw{H2m-RlO;dj0K(`VG+4-Qm}B6-Q?BdC?kOaf88qPIY(fiw5#!b LY+V)AAZOH1()Cy1 delta 265 zcmZ9FF;2rk5Jlgt?bzNV5FjBCV(hpJX^}ueNGZ4o1r-f~10Ye-McdMG0jNL}93VHK z%1sd8E*WWN|NMC~`;%`vllAY{H*iYriP`gbhAE?zgH?H%CwJHP4>u{3)$NNNg;zW8 zCKNr6=^JIJToE!iv@#T~wkj;$lg+|7dJdat^cd-26Hb}X!APYlxsl%NWHGf5>|NT( zR2u@$RCD^;YUn~;yTACvz5PQk*pd?q+1AN{v}1?e){B`#PqG%^Ii#zM8MA-o+y7Z+ JOf_ea{Q-478ovMl diff --git a/conformance/ConformanceJava$BinaryDecoder$2.class b/conformance/ConformanceJava$BinaryDecoder$2.class index 64553b6f4fcd446ebe6fe241730ac80528d0a651..1d3c0862b52673922e65ff91f699a643b8023f1a 100644 GIT binary patch delta 557 zcma)3OG`pQ6#i!J&9STHBdzRZnWm}b6AGj-Y9W#l{xy>U$>W! zWm6WRVwk3W^-Bo<)f6OWyMBR~z@`&%B%DZM%R07YndMnZc34PFGnC{5FUb$Kqh=UR zsEEeL93haE5&p)i@}4K7V~XTEKVt=J%>I802G3!me%WYU>-7txtl#M2OfiiKdRfa9 zasfLSCgr&j@M~1tr~;1Ybif5p$ej}C43QGtgsX&m$i47e9O|r6#VOhoPvFl`A1P-T w>MA2T1+#>5%we9QI@o5KvN&z#LBqiCa>gWe;JAhMzzQ7gLbKU=tT1ONa4 delta 287 zcmYLC%TB^j5Iu8gxtH6jAVnc3 z%EW~qzz4Y`OxZBW%$zxAX3pICm%)7T`v>40Ee#u4t6E>Bx-4VU9cy~^ld27 zNGBh(Z$9awoJS~e;3C4Iix^EpU^=2{P6(~E>zT{km$|YYo=W}k z=w&>8O-9edyW~BI&w5>0Y@CJQ%tL~p7=_H|xU2SQoqj;yj0uI+4spHVNn?|*lnHJB sajo29i*<|jB7Z0`7T894#br(#oDu5|>Tuz+dlmjbGsDqS2(n&OOF2^_{r~^~ diff --git a/conformance/ConformanceJava$BinaryDecoder$3.class b/conformance/ConformanceJava$BinaryDecoder$3.class index 104336d566d90afa0fcafd164e8aa2e004f6c01d..ad8bf31d73ae50864bf3b62ae65791d3a9a01c3d 100644 GIT binary patch delta 776 zcma))K~ED=6otPxo$@B*00oLzpa@#D6f0V)q6oH76c9>_g($iqI6;)qhIWA~_ijux ziCh1HiE&|~#Kf&De~9rXsCOzx6J2zYd*7XV&O7J5JM-1~(y{RQ`}>bTnsu9Y&f3Ho zu}LuMSLggHX>*=2n{F;>E^1Pmaf`H#%_W;5E^Dr6uGMo>?Z+yc`&GBFU#^wMHP`FU zUu6WE(oFx_sj%k`w%kf>r@U8H{6!bhjH0vTR%_Ya-O|&FTW!dsyd^VI|CElW#(Zqq ztyVX;e`B$K>66~9nn;G25nG2@a^meU$4!S@%sVWwsJZR1#Ii%46-CM`nqluyy|6+Q z{9e(^8)E#}MY!Kx>13Vxij0naL0Roy{O`oP8rHRVS2RJFPDbkk2 zAg7PyW2)8r5FCE?$7D+w55>e4lWoy@Bqlpz@>n#UG;b0hCWZ#XoM{;QljxC15R@Nw dlH(#Z#0|MwM5fezm5H29n-IuYWc@W{{RBjpj_Uvb delta 425 zcmXAk&rX^_6vcnTC(P&MLxkcVs8mF2t^ZN9SZj+4Do`yx0yQ+zL@;WMJ2&o)nYi{L z+_`Y)#+9#O;xnlCtCQR_=iYO2X6|G3*(*N0+};5>ej7T-7zPB^a}WN-z`f)z=q5@VAjTYTgXDQbLTn_h7w2)v5mXcC&F7F}ujWRa9u rpiQD(9QuU^NHg$%=6|SLDkFNFIl3gKgIQ*ZMji``QgB(2i%$0qPPjNP diff --git a/conformance/ConformanceJava$BinaryDecoder$4.class b/conformance/ConformanceJava$BinaryDecoder$4.class index 2bfeda922ce6af8be181642717840a6ca0d23ca7..16a4ce4e6019066f950001203037935185cf7954 100644 GIT binary patch delta 741 zcma)(O;1xn6o#LFk9(U7ZAv2A(_7FpEb zS4`YAcWdI#y)jYZ!mWw%Pw+>K=QbKm5W^&A&YU^#ndi*R*Wjy2?%R*gUw~;AEkc~K z80NG^oDqvCqna^ILX!-Tve2Y0`Z=Q+*JRo=bKSvOx$fA@^=hL!rOCFp-sZdlg|*mR zwQG%g)rzC|OO@43E21m5(}7 zFy}PqL(FnPlM9jOVu(2|xm)U8FwA8yC@6;9TgISUGGeOe-ZX~IdBqj?iJ5mZX1GhU zptvsK*!Th2nvx>fF2+9W8n2aVy5D`v2k-lVdBbg)iPpbhik^jPRKCv)|P;|@cBxYwPkV+4zPpJ2@r-;bhB_3)r_izNGqrU%3-IxA|v4hVY z^(St7;uG?#urA^aS*;7~k>Hww*_6V^9F?qvaaD6{Uen8QiA_=a#rhcB=lC5gH|ZZ~ z{UL0N{;3eQh44%W&xPUF%l&mZCIG8kavu?`-iE@x>uSSD^U3)QV diff --git a/conformance/ConformanceJava$BinaryDecoder$5.class b/conformance/ConformanceJava$BinaryDecoder$5.class index c5dea858554a0becfaf9a729f90925418319a39b..e6d0f7bbbb62d61519e17aa575c3f01a582f1f33 100644 GIT binary patch delta 801 zcma))O;1xn6o#LgjUvQ=P4aLBgS(&c|lY%q8L8~@M+pL z9h&_pO-!2K$pL{)p$^FG;*du#J8SNSze_c{+y0*Wo>0I1Bv_ZM4H0@JIh(ZcT8KA= z_l*d?6~TAH_r7sKA8{cy=%H7Qz@+Dc FfnPO{oVWl0 delta 453 zcmXAkIZs)c#fD zy%8qG;4#ItxIAW<^_U~)G0%c#(Id~2$1*F5LHiW0wSMS29AQ<_Y_m?%#+{g2vwcol zt=nzqQf=I2DqfT=hqrd3i>2aT>Ey^S?iSYlbH6Q{8=y)~3tmVfLJf+juoM+IlHE*q zqq;}^7Owaz7?unL!CJmcSKz*~|8&Y;==Pt1BaJJ#FL)r+52fpf1VtJsk)%u$$JC1> zPUuYpM-$g1wCGCHC`Ts6f-In9ghR9NkSx^lQ45x>lSqpmV}x%qrkWuJ^F}_a5+&y{ IA&DCI9nrfzeE!nJ!7^-hfmiJJ5!_r5#to_o%jH}k6LnRj;k$L1RV1GuTf zjgXEWgmpv^wX0scI%cPsjz0A3XhU4!xWItG2`5hKaN(4W00sq43!JG;k2Jdq*`j66 z74xM$1J70-Jxy|JR3PztlAuqP7tBKGPCjQ5cEFi>oZ!uvR%vW;F>}9QT6LN@p;)P= zLh+d0N}HCIz5S;Z{2M(ir)V(d!33)sn8Z1jHgFzO2BwiRFoO#Q(wG&vXkZSP49w%Q zd`Zt;9%Sr?D+IrMtoUSEX{D?3p%S2LvZ_2#uM=ivLhJ5r(22keLXRY^Wp&2!g{WMq zwn@M0mMdzw@wbU+^Kw)RE&WTB;7R6lxAMii+1!Ge%HGQc`xAX==5J{)2Zsk<5L&o8 z47GmZ3`g2&9kk46gjUYGcn4l^-irfJ>gXqoR{1m|~3bd|<^bR{6+IKC#4SrrvJci345iO2JWd*WKAS kxt}8pjeq|U>|^=>d}BDmg&V^dn$Y>ec_o}k+PmBN3!EjVCjbBd delta 447 zcmXAkxlWrw6otR>Z#-u56B~me5FD`C_sxI_o7wlJp`@^oktnbcAcO$1mQ-ju8VV$M z08&x#0C@%8A$2N}`@@ya-OibrGY^qpMf1PkUtWPEYlaZDhC1pE4K#XPlh-wSsm0Jr zn;}ZOrbE-I=?c>9%NS{waVA_QnR1zCMl0iy8)8Ce?N%fIf!Aj4 zdi3PMn5gl<$&(53;;*Bqe~0l+Bhf@-nB=`T^X9$J_su*C-lS*W{&>9&RHy}{7!4R> zJRr+)&4gxBGv#w4poc=h5GOT7&FRj}LSL%6)=J{#R-@fGr`s+6v5Ji+i|mf zr?HtR{-`Qz&MNv>-r3uGpJF4v2q`&j)(>DBMp%{LCTA1~}I>gI6^<4$Ik-errbyj6s!!bs>QucuZVnrD+%NhDbc8D2{ UN=$Kz(zQSaly$|YY-7g%34S+&cmMzZ delta 340 zcmW+wyGjE=6g@Nhn9XDpcXgx2Bt~P@_}*v&+X(Rm5)k}_B}A|=iHV4?5P!yOFn6^-oFfk)g z7MPFfn+c;A_6Kc&h3N9Zja3YC@1oW2ogH^O1NFuNCy6D2Wg9D4wXp_YdHm5#qRLQI zKfItmxX0Gj7ca35mD3LN8l$u=PrYm3DliT!?oPLJ)a{>yomRUUo`>aX!$*RC7#F8b z!UjW1eHz(Jny^U-xS~0P5mKa7-V9D-W)ud^Ygo9Ugj;gnkvD=zTM51|kl7Zb8Y8Te nUx$Wqx^rYP@xO~-9i}c3=b!?Y7>PN|?n+9eYFJo|PsjQL*uIIa4LwoplCwgf*k298 zcA?RzzHA0z*Pd0h?7P^^aCWpan+?LSzVK(3`P-fso>@Qswr7Fo!lEK=3yHMX$2dzL zzsEBw@j_9wUt&dD^Tv}xLs53<`~SJXzV<%H75Pr4|6dtfNtTq@_2j6^*{|KYlN=e# zamL*!#zew}Ig4V-al-X;PAPD4w~~S!m+iC+dO3HkE4D2g`P1xiuESLDX}W8#y3_~C rd}H3ZSX_7u delta 358 zcmXAlJuib%6vuy0+o$(FH*Hd3pwYz8v_Yvs+lU}uTS`&XTfG!D3yIZW5ebRhwXxYO zjR}caEaDsZ3PuZVJ!klz^E)rY`F}UxH=VuxJiP$@94c(Gj**;Vni)Z#U{(=jt|3`L zK@wL;cWGX*An8;DTwW9uC0&Y;%S(b~Nw=cKu>+(yc)0OJEnn3lr$0P7 zZTVCB(*LZ_Mc(r3cagNx`uAUxGGXen4EsZnVN74kn4LDSjq68QAIuPBm@t#XDH&_3 ojB-kW3(BPNGGGkzFk$A6JVngpA`SoY`py{%ZZSlgxiJxve@JjT$N&HU diff --git a/conformance/ConformanceJava.class b/conformance/ConformanceJava.class index 74fc5e84088b2940707612687a0b4a9d294fc234..9c1f08c6eaf13638568c4e65e46895799c010042 100644 GIT binary patch delta 3518 zcmbVPd3;pW75>g-lKbY(3mLMI#0U%|Az@eoBm}~mu*ix&5h()Xx z^&tvHSqdT)DWZZ?qjd~;jh2^a?ic@+_Qc6oO9ni z-goP;$nmcZ90pJzvrJ6E8V^eGkOvRr5fe7n>e-_v*5NUejK}q`-o$ilP}r#Ogq}XB zu*tw?6Y z*n_7%n2No6r`ALr_UYMvZ98gW1?o+B(O}}|IG~4v2ARmzcleY zex-$9(6bj!9K){-yky|GHt@3ML|!rRD)t#TVd5lyqZPiU75vu3DZH+SH}u|{3U8TM zbkXc-1HaQ2e{bMzt>YcNcvrjj2R(bw#4UJVyK=_F2l%5N{-hay)@c64z+W{8e>3oR z0-J+>D14~7YxM9>g^v{eC9sB9R)(qvRs_T0P*~w(J0e}>6ML_0le6|@SAY4pz0Q@J zoU|lZ9S#jBuMAc%E3Fz=T~$++Zy$Fp@Bg8~rwad3_>9-Y8xq{$Xg5J(X((J%Qc+R5 zY)L5W$aAwg*FI~d*hdW0Zgd64cFWU;Mu)=T;DXDCvc4(TTj9TgxOr8YrEreQ2Ub@oWgm9v$o$otJhqVS(u4g3SU}i#07<~EHn`V5pgMr zvBZrE3-htS!eY)OR^pT>!7#gPa+1B<%(WkC7H>DX3*BO%#x9DT5kFTvmYCwT#FBV> zOY8)XG}EgD@!5^B9Vy>jFy@kca^zcvXh|aOv?NKq40MTuwvuE^Qly0?sgkbbCQC9< zY01sf(n2+AENLZvOWKH6Nn1-YCCid*X?Iz?n}s`Yr_4oxgZw}<@UC84tN`Q>H)CBbDCRl#}w8s1lDtvp9bt|jfIgN4}$D(PrRCm|KeZ1YZpM}y>Ns)abu4NW4!IEBdReDPwOZrNGCB<4ni6sMMpe2JO%eGWb z%wW<&)jH-@RN7NjyZj+C)ItO+Eg2@mEiA!p+LsZQjFd4-##%B?#%r?^EZm3HmP{0v zy;l{r=WUcSc7F|1A#BMc@dy&G$&wMl+k+PFM_FBx(MQ~Z@iUl;$-Lv_&foHmdMlYM z=x5)S(!pNtnPP8ANoiIxH(XO4EW4D$b+3C|VtJj?xl}Umm`_OW%h@peMwSHE2(U() zEeKsM30*q^-y-^+R}rjSkTCFD2ixqJ9s!Y=UyV>ki=OsQjvmmj;)Y}OwQV|?=Ix2c*HcqC5>ny=c%xq zTW*?KL}8YjR?D3%Qf<(vMQn#C;`VYbxavr2DEJ-Ogv-KA7AN?ZRDM$KrYR?{8x)luod6e$L*t#;JZj2!xZBRg6-LI2n;c3~r zp=o8}z_AMf3V#X%pTURE3CKCLz!zwXFR88(`2rN;0(#;r^g|O$$Qvp#7|+%-Q{u2t z6u!gea+i3pTD*9edyh#oY?J2LDam+7(y>Qw!U0zQF}WGXr6peF`joVd;Iw4ojAY>> z$;Nrsz9Bi1Cb^QqvTZK`mRq*uOO_N#XBi@09Zbd`sfpn!g{2C&)40NS*$#o33d_v% zh`oSRh3`pw#W`=yxPVxZbcf;7j7Bt*BF*dQ@UOt*B`|C`8XjiaT*7JcB1bg9bNCQ4 z?CEJaaZ8cgK@p&4HN?Y-zb3{s7Nq)gycK4m{Y) z-GFxK?kIAi$c>`?9!Ft-3L{rfcHqf*-#B>?$x8xi^+A(6Ww}?s`^>LQ3|CqNfu;1eimQuZmH6kkrwC}MXxKGdu!(zO9T2` zbfYiX{i5iv_ph8PiDH1>aFh(xN(f^C`l6WaZWbF_Iq6Dl#dbuzd^h-X;xa8}`s$vr zft3%r1E$=`9E|WQ_HOi*l_-`K7$EmB_wL0kS%vv>Kg#7kESA+QjR&w&9$^mh`&QOs zqdbbO@;J83I_!|g5S5KMDw~;q+wh4z#dO;l5y&pO@GL(c_DD-oKWQdumh5Fg*GdPe zWAWDV8?8Y+9u-hpqha|aC=GA7We9z%P%^>q*H z6&py8JzS6BB=s=dyNTFE+zQ!$A&1y9ju5+}{L*@!HT?q85oJ9AnnQ7nrsW zF87@MaP4UNxE5m%B7Ryu(h|o-(VRKsieh}?1kR&KiDF_zKQ`{F6N=O% z^~qaEmDBY4Z48!o9Vgvz`I4?Qy+uU(hj`$Ub2+5iIqyM~((0rrCjZZCCht@6nJeNE z{S-dv`0yi4BVEBqWGX3q27mFCV#Xl-&3}|t;$b`eF~V%!8Lay6lP>3Tb2sS<(tAkj zuw2rL)A^%fg|z1S7)@#VJhLtU4^wE0w2t%eSIOtngXd1+XtMO9;ty~O4|-&jOk)d8 F{~D&J_)P!+ delta 2562 zcmZ8j3tW}u8UH_r!+F2+ofpI-0!I`S5by{hLMViqqNZa|v)d@0F{RB(Sm0&Vwxe6S zv|G7vTh^AEu}CvZ&<_$OYwI?fNn$QHt7)s;#Z2ASW*Gh7kNsTk$M1We=Y8()bK`8C zzj1nO|3`cG0VtK3Hfpgxh-!R2h;QI-8{fpY4EAjs-@!dL8Q(R>_iTIy-&gpd!o3E) zPho?FAK6HNW9~mT*iS6{)WZD=8_n$j8_9-g<3V#>Z{cSaejdbCcqnG01)FSa#ukG; zY&>kWu^Nxq2%*)+FYu^2+Kl#NHnw5A3Gs0oJMe_j*lDmQZ9Iit7TPUz7_++#XO9gR zTP$=M)h=V?X`{c_MmKuQ@k`QT*r(8IqkhQOuPi)cLin|X-xwRun#*%0p63nrf{p9( zqOtc|8~gE+Ieupt2TY<~ws6qAug}6OCTE8f`VDivISwnls&GW07c@0BG*>m&x3o00 zC?9_Bv`VqO<{Xh$IqKZyn<;;Ax_$XNbX$FMOT+BtP4&%pI3M`dmG&$AQQ?@v>&!fp zE(k1Jd2K_>Dup)%;i{EQx2$ZwwZ3U-!@`E!S9|n7Iko;xepc$JbI!lGq7FA|T!U*B zj%%F2TMB>HcpL9%yo-|xf6@3WmTD}<=QKWVu)pE&3a13~9Z`8suTFM)!wJrz_%em} zutJdPJd>L0n#O1xqwOz`r&AgAWx3G%lb) z<0A}eEXN8h5TBMfoKfP}5-$NQN-RSTDzUYMBthdkd{#-KmSK{lWjJk1Sdx{DG_om9 z(5eij(u1VQC?)C6)z+ACT1L}@jFAj2nKDjEmeJ1Ek|X1_4WBEY-LZcWJo{C!Mljc^GG>~K=niGR8v+f%u3q)N=0y?S}$vW8|QGXznOyg4o8EJ>@)uIB6lKK`-1 z9>#PL+Wc5`2ySxv($XV~JerSZ2!3eFv)DXua{Q6W?ckTVHZPb$69pYYuJr@xOz5_c0Zn`R1Yf|B0c7)D>`6~H()3>7 zqS(chA@5_mP%`Aal=RD7lo`6`Hs)fQi*j@K^ec?M*Mo&DeF!r-LW>D|SggYr;Z&x{ zG|n1~;dz1``!))3k{a)@@7|@>DO7P$*5Wj`*ZZ__j#kca;Lf6v`*00D#5xS3Rbqmj z;ztk5-YY>IAnYUTCp;`R%O7IdHI5O!NqBR=qn)_CGTpZY@o_uSd#svhK`gx!>OmxUkFPY3FX+Pb+Gt@X zW>okieit(<;-iuHeVw?1pc9sV2Q3Xfzl?(lNnvlL!IlWj+D(!SL?jd0l7$?}M!w{r zNXDZ~@-SWUQ6*6?dTyWrD#W-#E}d-w7w3Nizng)ZI?s!CVOAGryQp$8XAg4ukhu>a zDO$H1KL5>o;AD+C`1=AYNzKWP&qm zOT{PDeTaE6ti#oWcXG$Ay^08uEbfwOESzJ0Wo*L@^kd@(_!6h91#e&#;cCJ)gquk@ ze?^49X;yRKBit*t2X|l_`y(hLq+BErnRSW diff --git a/conformance/ConformanceJava.java b/conformance/ConformanceJava.java index 7badf2a5f5..3a944b51c9 100644 --- a/conformance/ConformanceJava.java +++ b/conformance/ConformanceJava.java @@ -3,6 +3,7 @@ import com.google.protobuf.CodedInputStream; import com.google.protobuf.conformance.Conformance; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf_test_messages.proto3.TestMessagesProto3; +import com.google.protobuf_test_messages.proto2.TestMessagesProto2; import com.google.protobuf.util.JsonFormat; import com.google.protobuf.util.JsonFormat.TypeRegistry; import java.io.IOException; @@ -54,21 +55,31 @@ class ConformanceJava { private enum BinaryDecoder { BYTE_STRING_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { return TestMessagesProto3.TestAllTypes.parseFrom(bytes); } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + return TestMessagesProto2.TestAllTypesProto2.parseFrom(bytes); + } }, BYTE_ARRAY_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { return TestMessagesProto3.TestAllTypes.parseFrom(bytes.toByteArray()); } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + return TestMessagesProto2.TestAllTypesProto2.parseFrom(bytes.toByteArray()); + } }, ARRAY_BYTE_BUFFER_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); bytes.copyTo(buffer); @@ -82,10 +93,25 @@ class ConformanceJava { "ByteString based ByteBuffer should not throw IOException.", e); } } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + try { + return TestMessagesProto2.TestAllTypesProto2.parseFrom(CodedInputStream.newInstance(buffer)); + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "ByteString based ByteBuffer should not throw IOException.", e); + } + } }, READONLY_ARRAY_BYTE_BUFFER_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { try { return TestMessagesProto3.TestAllTypes.parseFrom( @@ -97,10 +123,23 @@ class ConformanceJava { "ByteString based ByteBuffer should not throw IOException.", e); } } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + try { + return TestMessagesProto2.TestAllTypesProto2.parseFrom( + CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer())); + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "ByteString based ByteBuffer should not throw IOException.", e); + } + } }, DIRECT_BYTE_BUFFER_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); bytes.copyTo(buffer); @@ -114,10 +153,26 @@ class ConformanceJava { "ByteString based ByteBuffer should not throw IOException.", e); } } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + try { + return TestMessagesProto2.TestAllTypesProto2 + .parseFrom(CodedInputStream.newInstance(buffer)); + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "ByteString based ByteBuffer should not throw IOException.", e); + } + } }, READONLY_DIRECT_BYTE_BUFFER_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); bytes.copyTo(buffer); @@ -132,10 +187,26 @@ class ConformanceJava { "ByteString based ByteBuffer should not throw IOException.", e); } } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + try { + return TestMessagesProto2.TestAllTypesProto2.parseFrom( + CodedInputStream.newInstance(buffer.asReadOnlyBuffer())); + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "ByteString based ByteBuffer should not throw IOException.", e); + } + } }, INPUT_STREAM_DECODER() { @Override - public TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) throws InvalidProtocolBufferException { try { return TestMessagesProto3.TestAllTypes.parseFrom(bytes.newInput()); @@ -146,13 +217,27 @@ class ConformanceJava { "ByteString based InputStream should not throw IOException.", e); } } + @Override + public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) + throws InvalidProtocolBufferException { + try { + return TestMessagesProto2.TestAllTypesProto2.parseFrom(bytes.newInput()); + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "ByteString based InputStream should not throw IOException.", e); + } + } }; - public abstract TestMessagesProto3.TestAllTypes parse(ByteString bytes) + public abstract TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) + throws InvalidProtocolBufferException; + public abstract TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) throws InvalidProtocolBufferException; } - private TestMessagesProto3.TestAllTypes parseBinary(ByteString bytes) + private TestMessagesProto3.TestAllTypes parseBinaryToProto3(ByteString bytes) throws InvalidProtocolBufferException { TestMessagesProto3.TestAllTypes[] messages = new TestMessagesProto3.TestAllTypes[BinaryDecoder.values().length]; @@ -163,7 +248,7 @@ class ConformanceJava { boolean hasException = false; for (int i = 0; i < BinaryDecoder.values().length; ++i) { try { - messages[i] = BinaryDecoder.values()[i].parse(bytes); + messages[i] = BinaryDecoder.values()[i].parseProto3(bytes); hasMessage = true; } catch (InvalidProtocolBufferException e) { exceptions[i] = e; @@ -219,16 +304,96 @@ class ConformanceJava { return messages[0]; } + + private TestMessagesProto2.TestAllTypesProto2 parseBinaryToProto2(ByteString bytes) + throws InvalidProtocolBufferException { + TestMessagesProto2.TestAllTypesProto2[] messages = + new TestMessagesProto2.TestAllTypesProto2[BinaryDecoder.values().length]; + InvalidProtocolBufferException[] exceptions = + new InvalidProtocolBufferException[BinaryDecoder.values().length]; + + boolean hasMessage = false; + boolean hasException = false; + for (int i = 0; i < BinaryDecoder.values().length; ++i) { + try { + messages[i] = BinaryDecoder.values()[i].parseProto2(bytes); + hasMessage = true; + } catch (InvalidProtocolBufferException e) { + exceptions[i] = e; + hasException = true; + } + } + + if (hasMessage && hasException) { + StringBuilder sb = + new StringBuilder("Binary decoders disagreed on whether the payload was valid.\n"); + for (int i = 0; i < BinaryDecoder.values().length; ++i) { + sb.append(BinaryDecoder.values()[i].name()); + if (messages[i] != null) { + sb.append(" accepted the payload.\n"); + } else { + sb.append(" rejected the payload.\n"); + } + } + throw new RuntimeException(sb.toString()); + } + + if (hasException) { + // We do not check if exceptions are equal. Different implementations may return different + // exception messages. Throw an arbitrary one out instead. + throw exceptions[0]; + } + + // Fast path comparing all the messages with the first message, assuming equality being + // symmetric and transitive. + boolean allEqual = true; + for (int i = 1; i < messages.length; ++i) { + if (!messages[0].equals(messages[i])) { + allEqual = false; + break; + } + } + + // Slow path: compare and find out all unequal pairs. + if (!allEqual) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < messages.length - 1; ++i) { + for (int j = i + 1; j < messages.length; ++j) { + if (!messages[i].equals(messages[j])) { + sb.append(BinaryDecoder.values()[i].name()) + .append(" and ") + .append(BinaryDecoder.values()[j].name()) + .append(" parsed the payload differently.\n"); + } + } + } + throw new RuntimeException(sb.toString()); + } + + return messages[0]; + } + private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { - TestMessagesProto3.TestAllTypes testMessage; + com.google.protobuf.AbstractMessage testMessage; + boolean isProto3 = request.getMessageType().equals("proto3"); switch (request.getPayloadCase()) { case PROTOBUF_PAYLOAD: { - try { - testMessage = parseBinary(request.getProtobufPayload()); - } catch (InvalidProtocolBufferException e) { - return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); + if (isProto3) { + try { + testMessage = parseBinaryToProto3(request.getProtobufPayload()); + } catch (InvalidProtocolBufferException e) { + return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); + } + } else if (request.getMessageType().equals("proto2")) { + try { + testMessage = parseBinaryToProto2(request.getProtobufPayload()); + } catch (InvalidProtocolBufferException e) { + return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); + } + } else { + throw new RuntimeException("Protobuf request doesn't have specific payload type."); } break; } @@ -256,8 +421,10 @@ class ConformanceJava { case UNSPECIFIED: throw new RuntimeException("Unspecified output format."); - case PROTOBUF: - return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(testMessage.toByteString()).build(); + case PROTOBUF: { + ByteString MessageString = testMessage.toByteString(); + return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(MessageString).build(); + } case JSON: try { From 0255431ca7f03e4b77cd2fee38d9ff78a751e562 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 11:35:11 -0700 Subject: [PATCH 31/61] revert .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 884ab97ef5..798559d7c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -*~ # autogen.sh-generated files Makefile.in src/Makefile.in From 91da852c50b5b5ec6a26a2ce7c8590e9af7fb4ba Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 11:39:05 -0700 Subject: [PATCH 32/61] update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 798559d7c7..fdc52bf746 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,7 @@ conformance/Google/ conformance/Protobuf_test_messages/ conformance/conformance-php conformance/conformance-php-c +conformance/*.class # php test output composer.lock From 6c59c257351060b49096140df3571f07a0ffd814 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 11:41:43 -0700 Subject: [PATCH 33/61] delete binary --- conformance/ConformanceJava$1.class | Bin 1535 -> 0 bytes .../ConformanceJava$BinaryDecoder$1.class | Bin 1241 -> 0 bytes .../ConformanceJava$BinaryDecoder$2.class | Bin 1482 -> 0 bytes .../ConformanceJava$BinaryDecoder$3.class | Bin 2256 -> 0 bytes .../ConformanceJava$BinaryDecoder$4.class | Bin 2057 -> 0 bytes .../ConformanceJava$BinaryDecoder$5.class | Bin 2270 -> 0 bytes .../ConformanceJava$BinaryDecoder$6.class | Bin 2339 -> 0 bytes .../ConformanceJava$BinaryDecoder$7.class | Bin 1860 -> 0 bytes conformance/ConformanceJava$BinaryDecoder.class | Bin 2553 -> 0 bytes conformance/ConformanceJava.class | Bin 9250 -> 0 bytes 10 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 conformance/ConformanceJava$1.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$1.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$2.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$3.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$4.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$5.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$6.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder$7.class delete mode 100644 conformance/ConformanceJava$BinaryDecoder.class delete mode 100644 conformance/ConformanceJava.class diff --git a/conformance/ConformanceJava$1.class b/conformance/ConformanceJava$1.class deleted file mode 100644 index ab225e5710171dc5627e09f7b0315190053e4958..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1535 zcmbVM?M@m&6g`8;0)S7~7a-Sz&eAwF}tvN8hGN zf7d3)G>s3?m*|@`y@MiDO&Uy=d+r(Ty)$#}%>4TE;{?ESM7+3%`yO=Rfrq?7PKN{x zb27q>-nU8u!Ehd$HNwrE+!Lka5Chgl+#mZH8 zXw2NP?2=-tniRg;U)4TTwQ@yDE1wKY$%mD)#^BhBF@&yJd_%XjD4(^$;9gV>-P9{f z3~dvW>kQ7Ym8S`O3Ek9E)lyEgvr5jOkJQ48}&qVZ~TO_q-MaZd4q^wL;Eku)wpIMEH63GJ+yP+^itT(0ySQ(hP$bGfmA78%nvXl^OhvS>)WV zrjiQ23t0lf40F`5z-hw*^@au1Mw0?fNm8?>-e%%DPz>rH!@|VmR^oak7Z^I$Qkirl z9E-*xZy4sUUr4a*ylyH+t>1Kr-04+0E3d3YsrB)UoDx9w+(0kkO=7>%MjlW)20Qub{SL<=|Jsh=bjn}h zd|RU~qU{YT5Ovk)G2FE*&mrjZ9-*V2MN}kO&m!7M^fc=mT=38mZlfK27{M6fI9=jd z!ezvfBurrw?+D+ch&@6FZqYKmgkWDV$39awFbHu&pc=_@vwrT?#%O!}6z9MI?hrb0 gm+T|@4U^wR2)~=&?*L|k{dh&VNb#fOy$<&O1rGJ2+yDRo diff --git a/conformance/ConformanceJava$BinaryDecoder$1.class b/conformance/ConformanceJava$BinaryDecoder$1.class deleted file mode 100644 index b54414b4a12add35e2e812d3b94a6c6d8c73bc75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1241 zcmb_cU2hUW6g|V&BG6Bo`L%esRKti z{ws#9Qs;wpWtpxehUSH@95HOP%kLNxE!pP`YaK`M^U0{kRoCjd( zket=jR4?R2+5FVeUCpj=^QNfU;8L@Ki_t}NH-2hFgh+nfvr zT>aM0K$+n@0vAPL$&MSSFqEUNdneqET0_5p8^J|CRdPf+ghCh^OR|f)w9BKT&c?72 zVpFUgK1YIHx*ltJ;Y5~lPF;4 PI78)V9Hvp!>w5YZr2=3x diff --git a/conformance/ConformanceJava$BinaryDecoder$2.class b/conformance/ConformanceJava$BinaryDecoder$2.class deleted file mode 100644 index 1d3c0862b52673922e65ff91f699a643b8023f1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1482 zcmb_cU2hUW6g>mT;+9HVYqi=BKT!G5ZUNsgrUlv*1C2?EFMVj1WxzGd4w+pV`B(a) z#s`0ZKgxI)h=Fxt&~%fT*}XgG-ZSUkJ3oGY`wrj*N;=}$)NvR0bR@B*<0iH>>}Ytv z5PxaAw*QJ@Bhz?qUYdqux;^8}m$ut0*RyXKVpY-M45^0g^3!3z&1K7MJ7ifJn9}2K zr0_*a!y|@di+lc|c=PViwhV8$CH0(2+D3bSIxnU?OTp4xu z(sb<3SQJY*m0`EbdX=q4*gr>Lqh>b0YTz-pv0sBNYYA~APv;sAnmykkax|`7(kjQ^V?>e>gGP={ki$0)M( diff --git a/conformance/ConformanceJava$BinaryDecoder$3.class b/conformance/ConformanceJava$BinaryDecoder$3.class deleted file mode 100644 index ad8bf31d73ae50864bf3b62ae65791d3a9a01c3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2256 zcmb_eYje{^6g?Z8tPx5RD5WHjV5r;Ld5JjmK}~4L3k0@FiAhV_8Ag%UjzHe^NHUQA zhW?oL3uM}v@|_<=dsn87V?@U=XlC`ed-v?Q_ny7>ih344UFP*19=n-Ok+mB z&FZ%~1M{#9e1wY}3mip`#SAVPFz|(e^Z1hED~@j%hOc@-9%9kHFj~vT)WYgM; z0#7zec43<#y{hVhVYKW?QSG#LL{M{fe6k#CJ3%Nm0~M)7jw=jiO@z@k->>bpMM$5v zlpK*2-QaUTs%Ma=0H6=>3)mL#HXi?z%-w?^JnZ z>oUmoZeC&-*@_(ZVZ~|3Y~yg3IIecH!Cr;Qa+q zd_92Tp#ZvjQW(aT>IAOX@N~vct}5A3LCcY@xJkvD*A=7EtV`EdAyup*qFq%tF@_b6 zB@?SyqnJ&sW5dLC+%RF|CdVxkWmHU5ahsu-R25r3a(u5I({Po)(rGkA@L$RpK8&^E zDa*dyW1Toq(4CHqyq4&hynImU?2Z$PdR7~{$k}jLb^Ll(swf-n2I_IP2X|h_v#HsB z$8fGM1-TVZI>FwWa7m>>ZjlOq$ii`lVe)?$acnW%NXWuFNsnPF0jfvl|0YjT_6{<@ zQDdkktV|*?pnN#)G8B@|b-6zw3#Is|hu$wFvsAudGh`g!SFRJ0;dI_Ebi2c0(xlH} zSGD(QO8X>w#IOzDYg5?yUXWN(1dvOJ+0reiZp(HjqShds79CM39@{dEwDcL4-mqCx z19=UMHa!}*u8lwu@*9qIKZVkJ?M~APRq5%!HGKwjmyOHvB)RdtJHr9>Lx~#g6AD8q zpI{t4sWiDPrmU_Or* zj$;BD0vN|6j*>;gUmy!mqx)TqV4G%tAg_BkgCEK3CrsgI@&}EfziA@HF~M<$<184* zB(?1+oTKS9@ypQ2;*&u+j=UvDmo}&qM?oB$L}iyadc^SoQFu5w#}snJcL<;2vzWK8 n#>X_KafJSUlyHim&f{B3%s5r*GQM6jsAhC6XK+nF$1?u_NE(6j diff --git a/conformance/ConformanceJava$BinaryDecoder$4.class b/conformance/ConformanceJava$BinaryDecoder$4.class deleted file mode 100644 index 16a4ce4e6019066f950001203037935185cf7954..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2057 zcmb`ITTc@~7>3^|;MBE%f{LPG)v6Sbm4e5jVgX~7ssUo+m08-MEN*9-JplF6QU z@i3??3wOy{c4*{4)p9-Y*j2uo;K(o}mW1cuah#=ERe1E8mr}Shj^%m!)ft*Es)|`w zs_Y1}s+TPXD`u|di*0l1s0q(}5`9(?o@bSXS6??_YDPC5z%d#b`_iiXt*6i;nUrPzB+ys!{@-xWaKYfor(VaU+2&rV_Xbif$&#^?A8& zId&;DT2xLhSXmM7F9$L7h6!OSGykYzw0|c}76R$p718kV`c62L%a$ifNj*?kPI{{< za7sz3{G`9?s*PlW?wF>(t!bwjPBm>fm9wSg)@DVKQqfIOq&jzvaNJ=S`0FB$9K*c` zFYGD5IA$0gwy4%()H!Au(ot17-@LQ&tS-#K2>T7?M0sO*3&JWrl1^3XS4 z3hmAZ%DPmPqAveZURDF2%2Zetsv9Xb^3wBlJ~G_gMs8AzEM~J=jEwFNkCD5sBIQ5S z+Hb2O#rG6R0vL|)dBa(_q*GO&c%jobqfdjq6SkNg#M#}H1`OGVc(v+<)>lUnG8}56 zNsUim!U6jK=&OxdC%Qn;^pr$( zVxQ6W8SU>2qg#cq;7@zvqo1&Ui)I1_S?dVB5sY!J~Vk<>{0 z1&)UEV-Gm`avaBSoZj1Mb_cb74E&M6_(y`5r1y#lUJ}7;B6vdtZ;9aDUkKVTNHj5= oB7bQr?a9N`hKa5RJuAa69FGsMF0Q* diff --git a/conformance/ConformanceJava$BinaryDecoder$5.class b/conformance/ConformanceJava$BinaryDecoder$5.class deleted file mode 100644 index e6d0f7bbbb62d61519e17aa575c3f01a582f1f33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2270 zcmb_eTXWM!6#h0gStA@0D5WHjU|Lgb=OW@jTWUf>Zbe`lN?ba9VibApsFk%INe0s2 zz(d=im$$Yj~4`4jV& zsXM0I)Yk&fcAF(5e}f^pBHF%{$(1eH(wkB?9ig|?w)IX!U)&7Dwz+(q!p(p{Z?=T*n@!<& z_s!|bQe|7#Wsr>;FEI?Q1*Y|B#cYRcLwDynE_9>8psn1oL_4shOVlEsP@onV4o1O3 z{33(*@*F5W?Lcvt16`ZshPEaf}OF2zLQg-VZMA_gi_ z=KluIrReQMfTPAxjoBGTqR;Z-_>dtVcdpC50huj@N8PtSqcTh6@&?0x({ZF_24dOv zgcUFx$r<@>kJwF}s&vqj?ai80I#4lZ;A`?t}CM?$Z4bj$k0vzDwFklIABLU|gAx_^Nod`YYKNb4&c#n+_u4JPm{ z>4V0=-?Wh67~?p~aSV)OoSOFpj?;3I_@!uM@WwXBd(Y!I)HlZh{R{x#k%8}t;}68~ zK5_q%INc{oKM~iTiR&*!<=6hXCXgl20i48}A%B&X*Ju>5hkiy%I80C{@E!$dlrnY> S?<{MSJGvH9xTu~Zseb@ld5PNq diff --git a/conformance/ConformanceJava$BinaryDecoder$6.class b/conformance/ConformanceJava$BinaryDecoder$6.class deleted file mode 100644 index 2b03a1257826c45a767b98268fec2796d9ed0c68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2339 zcmb_e`*Raj6#i~gx?#Je4;2tg2^cj=A4>zG7?6@aWHCvxjUxWSY&SRQ>gL|e?gohe zh<}AMqC;D8Mn)Zc@JFfVZjh#7aSFrE+{d0h_nhyX^WBp?`uqOR0M6nI9b?Go$Rej> z8Z&A)t9Em0GIgBBypF@jYdE9ftcG`!IHzM6@98*&_cff?aDidyf-BtcLx#hd(wFuv z+w^SFFxNxh6^(+G{fuF7QPw!aXvr14(r#{WziMxIBpGhme!#E!GL+B@LGhEMtXYHt-Ry7_e~Fz{e;VD5Iib)xb4;VqgvH4EeaySmKuLxwQz3BfVm~ zUg!RkyfM5I5yq9Kwb~;+wo9Y6wg}xO@A-Isx7?`>JK(jH5_B!6f=$`>YAGSZRJiHO z+o>MAb1JB+Li;JhiM~9fi>|Q!&JuTss($($Rez5}1M&Fy{~pqCo#9GM7G8*d3{x?t zdbs{y@&sjXHv<|zXQ;%Sj03Sx4r#c-kd3?CrT&D>7oz(fxL*_35}B;UaLD#N>DVD( za((WE3`a9ow%aK7LMN&YIkMHMN~II45gD(0Zi|A?^csnHMFz&~V2#_gRpE8Ij9@sj zNAU?&NI4yoCR4Slnk8E8kXj12n{>4Wzio*iR9A-K;xmxNHJ+!8k<)`w%Ukg!S$;-4 z=!Z~vsa-7>Q^=maT~*gcb?2y(cj6n?izD18+GK}}3 zNzX5w#wh)MswY8X91|c`(k_L;NRrG=PqJ;WyCkE=OY;z|z_&ENhSxC=X@5i7gCw1q z-on5R66NWcEez5)aGj>19cVj9epi`&Q27bNHzthPZHzpivlE!aaU6`+6m*g(4>{Ta zcag;R7{L$p^&WZIB5(IddmB^OA$&jLB<|xFX%dQm=tDxo8yY4x+Amfn;gWIQ}C4kM<8Yfwu_y0N%zsQ3$F= lM``46fd0%}#1S%o3YYOFtz#(QgC(6RNzXzOi)tN9{tL5epb7v0 diff --git a/conformance/ConformanceJava$BinaryDecoder$7.class b/conformance/ConformanceJava$BinaryDecoder$7.class deleted file mode 100644 index ba0aaebbaf6c6f22e4822cbfdd447ba2ea70e9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1860 zcmb_cTTc@~6#fRVTb3eML6J+?BFlCttJ|GscMI~b^hJy& z^6rZ--X6XE4&#|Ek)>`(RW_NO-7_=i`_6aHnYTY*y#X+Z+bWt6RdEjIRkY!Pf|!Df z3ND3lSw#qgDtZuCFr?rLLul5p4EGj8*I?$cwxuOZ%_<~TUE8nnP7Qqy*GbDo~Pg`4>Y2-aH zU6`rz#s;^43&YUi6@noW>3cqF&p~-SC|j;kEW>hu z4F6PE3T`s2)ab3obSt3tiwCt|raH3m8QGEj0r3C{K@1t% zs@TNF=f)r}botcNh@cq^C+RDS2G0^68t!GgV9&`$;m|uoGw_byt>{FZw|i}WclYoM z)V)Ogv+T%T_BBF}+Le)Ag!gD0pdd`!mZ4RW))hv$rn1DycBcG? zKJ<@trnP6{PCf19p-+A3Kk9U^DXM70g4;;vl6AL$l(#TB&Fi z4x=$8m(0t#Y%23KpGd}c63Hxw>2%yQj!dhp8U^jS`bG_OMOowExBa5oY*aaSn{ae{ zDYmz@mCT;6&1RF)#7-uy& zq|9OF)wPEkc%$kyR-M^k=z6p#PL<^_k}erqrdB@CtekqFlZCg#>>P1e4yKQ(ieX(f zieb5Gm5kzA==wC)OGc@>!Qoa9_f%+~!=PL$8fvv>(QfV_vkaZ6Rz=&j%&NJ} zb-vW5r8QP)VZETY+q2Zs+@w(}uU~TMo}LX>7}=~@1#PRuh%$Cz+7=mEB&_0731RjS zc_^WX?|GCs+`WM9o=gcVIHvi%5)@dHa1X(2VG#+TK48ld=KFv>lCaPRY(>KTK46a} zJm>?qDq)eqZk&%F>kyA0I6Qk_Jm(PU5h|QAX#PuwHo*#}9;+Q4Y1Y|1@X$GAdieDk zwLV$Q;pWB0FLCe|bkkrg3x+y~x^r->6{^IL{ut95IknSP5NtP%QofaP`@D^EE;w-R-q!XCC99Y0p zJZXdfwxPh!EeMK#(A|XCz)%a4;ve=jaif8e7JQ2Trnd=y1EVdBDgF-znz+@#?H0xr z{{-K}WCM3vm{RBy7Vr5>M94}PK&{DKVr#cMjc8&0vFAw^gh zp5qgeFEK>i*ulpM_F+WVra&J|jvQ~xv9_cN+UrtVvOO7o9V$M@1Y$TuoMe*OeZv2# C2%7o; diff --git a/conformance/ConformanceJava.class b/conformance/ConformanceJava.class deleted file mode 100644 index 9c1f08c6eaf13638568c4e65e46895799c010042..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9250 zcmd5?4R}-6d44}j)|IX=U{T_7UcRhFjAJ_4F_=M_xQpcz8 zpw5X;tH&uF@4;ye4{7)V)%}cy&${ujj&b;$dOxFjf9S>|Zak{t^XhFt$7D6B;|uEb zem5R-<8cj7sP$jcQKrU^Q#wvyP)8BY>-Zx) zs~*p}@l`eVyc-wP4i|O2fIn8p_!Av3;!hRv*HrH%9WUe0-1xd1uc!@PRWskv@l8DK z#@98+0-t`SP{z`55*KT}YvG^PH@&hH=->TjZ zb?n2Blq7HJ_%VK>9)G7M{$A%D+Keo;c#zJOX;7OW^WNWNHniNPIDU!$f%pGQTIFXDW)9@c0 z>C71s)VBv?y>;EOSa-y%>x;*du><{Gb^Xb3q;69p7Tpkw_Xd*wT$+^v*Q#(doNN*} zDk^UkI9s{7U_yI1YHscCJz&N=0|z1;85cJLp$+j^Z$~l|j*_loPfJ_ndpOaN3g$gN&Awzf7Ui-2lk-R7;iTCaBVDYYM=2zs+NoSIY!4@s5p#Vs6b?k&qRAZo z6sJwYe{r2fKVo5)owK4%ahuc^h$qan20LTh)!~;Y1yO~~k%&5TLJ+C2)lkc^q}h>- zhojvqEA1BSQ-;{rYbFwbZZnbA?2IB!6Uq-;cW|d?({+0VivRsR7bp@xOMgh6nv*t z>}fw3I2@>p1ftz_L)Isd^p046JZNqRE6`8Q5pok(*D4YN2M{!HJN9b$wSh~xtl=F4 zR|q!|DbU1Wh!YV5UFbG&h&?G3mnNFvW*Y~+CUnu+ZCKT{MGpre;gDs|U@X$o-_>Qt zhyBqIH|T&cwl3HEO#La_d&}L?OR<<1seBoX*NBZ%K z^#mzq4Dkh`A)jD21)xGD(W)E`3(0 z(PXkAUYTOZR4LVDx*=tV8d5GZ48)N%WTyBGnJq<{%rRuH_zjsS^M}am4ZIh33zk}j zW6-94EN}CLVrC+`AnEG~95#K4J~J5Z3I~U^uM$G7;=MqV3PUQT+Q1zMXi{UyLg7rE z(%2%Y*JO#>a4Dl{#@DE&&@khSHERXac1F#k+(wyZ$i~4yLhZ6lovuNaYqCNxeP=Wy zjlxEMvadhsvm!;Zmi}i*BM&YsWtAbTWsN3ll|0Rcv`DKV>%=dZlQnc(Bw}_4BF*vc z{$5%w$KdPLN^UhQ(vVuxJJuTL1$}vT&WiQhHu$=jrF=;SD<6&19S`(U`VF$t!2590 zkej8=Kp*Z@dfQ~kX4$IAHbb_{ElNc@415Up8PXvIf@LGzzmawcn&HDdbN)VzEKKIU zKv$Aa1^-T())FCM$WHMvp^ji>;KK+CinD6ic0jp=VB(0C{>6eBBgaOR3X5z2{;r9i zF+98Tu*L-ids+lD?YL!=q+s)&8`osXa}pD* zxn>4KnRKolhvoyU`vSqCnj;T89mf($vzO*msm+^CY~dJHNWWxmGXuTUSK8wF!_0@O z3=?RooNKFOndz{qv@DbDER1ZJWkb=dG|$=gw%LS0(a_%B$xoZ=kQwjPm#k?Z~g9$RtXN?oP6vRTU$7FjNO3 zJae81X>VSs3godK(=Pku9g|hz_-=Cu0IH_V2SG-lo&Js^;bgFfCAps(_NPAx{8pl3 zZsFK)QI}hU<@Pg4!oNM8=3AKoRBRwRlmL07MR{*qsb?Fjj;)5XQeN(!RP?4B$BiJ5 z#rf?Lh_JF%$H;skWe#A0)>imz=%YY-)I2g=FlocR&DV4AwBP%)@Y1tp7Hqs`73A~f zr&vN6j|J2Ecsv#t?6pPx4cd;nDmeJTnupvc_9qx!a=+CD`|UrlMzY8y8s(E}B+0Oh z%DvTH!LUyh_L}i-Q1nu?)xF)VNPxCc~&0XQR znZ8YMtjjm4U<_~3ff?!$}v!?3#3>!lraXXXfQGc9iMXSRb;I<2S*oF8ZNmY8nTL+C&P)X3;l5-nt_jN`J^Ma-FwL$> z__KWqx!g{#?`FdxVOZb>Ld;1$_Atn9lDDC~TF0^YqCdRoA^e=ZcT0FBJm<(6JEW6npR`BtTd>4PKDBwTduvtA` zX|OHge_p&n5MpmW=Y_3aH3+G4JcEKK`6e*c80P>3PF}(ns9QKb6-|O8g={MvP351# z+;ebL&nQp9+2Hg#3m!(H`&xd30#=O-egRL z7o~j8#5BxhZ$5wG=;5kya9l!xT*4H2n?i&+?isDE=&W&;6}#_Z zTUb_HtXfxD@iewoHG^yy?0_sST{U9yVR9}cMwx9D!$r6NBu=-gUhLS)=;kU8b`h2lET!}@KE3Zcr4nV zcwMJ)rxIfj(;78LgWKz_x!??)!8Whkxxc~V^(gvPHC{Ivc+w0iN|m4-Ny}GKN>S8+ znpOgrOt)n7P_`FOy7~OFC83s)kg}X5Am>o;4fLus!XHN!E%S4@@e35=m&Ev6n1Ww% z)vsx*OW-FqS6{|*yn`lOK{MwziUYUss{3|vp+__v;r;SG;=z4Vga0#t4eef>U9(iSBL|*xCBJyTjFY?IX{|$L^6Wp=_#j+BUWEDf_ zYRr)}SR`wSyme@hW-ON$G)XI(Ik!1k++4&+eYMVBJy?+c{_=` z+laiqMBW`l-aaC4Kam$8^6nt=x`@1PBCm(Y3ln(BH3RdJnv5c9SS;A4%>^O#@iOkqI^6)9AnwHQ{BVRm6P7ly7{sDefbb`@x)c_X!(zp;UOkqOw!)rvsiL*GEK|L6XdvZHDJ;*(zn}8v%0G|qH(Bdf zsP#1|G!8RfsYK^V&SO%(n6xS;RN_*s###oty(|U7Y)|40 z9z_vv>G?a%aJx1W2v0K+LEZ~p?k4=+$3L2QKUT|0td$dJk$VZd4`8o+5MAbG25kVm&u?7zr~nvnGspGG0qk5QV-95>v@G4 z)oF#p4`}#p>UExHBIiF?%!BbKjdVoAXNeXU^}L>S)4Ek<>9VJcX}qeY%qk?tS-M+q z8Q?rNY^_>2h>eX-W$K$73#&>CFASoM4fA?Vfz-hI0rEU!>_uws1^yEHBAxkbD3zBm zSH2Fvyn+gO6?O6rI`g-v(Ql(wzGI!pK*1#vuwcrsI7IzKk`enP#a2++P<0+G12(77 zp2C)AP{(6zJ%!?`-A|*yxu0d=z?Gk!!?sLDE!oaYNW2uJa7)P!_L%}x=uiboI_=G2 z!h^gHr+gP0Tb*sOd=FFQ4a)p|td}2HGCEOEJZU&d9Hgp0f{$ioTfkPyR`eV?nZ|df zaBH^Wv1(EI5gEUkLtcQ7St9%ncC$UfjC&hf6ubGiGM(77PW^q!3)s(Xbo@T+)>8WS z7x7zck25#FpX~{@_p*Ho$7R~uQvLzU37N(Bm${Q_UnJnF;30f=$t;(Le*yDLxrysu V<9HMK{uukX&Li!zn{l)Be*w@BWAXq1 From cf7b6a46b25048e9d3e193c7809f9e881dc36bc4 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 11:44:41 -0700 Subject: [PATCH 34/61] delete backup files --- conformance/conformance_php.php~ | 119 ------------------------- conformance/conformance_ruby.rb~ | 131 ---------------------------- conformance/failure_list_ruby.txt~ | 135 ----------------------------- 3 files changed, 385 deletions(-) delete mode 100755 conformance/conformance_php.php~ delete mode 100755 conformance/conformance_ruby.rb~ delete mode 100644 conformance/failure_list_ruby.txt~ diff --git a/conformance/conformance_php.php~ b/conformance/conformance_php.php~ deleted file mode 100755 index 848cb4c7a6..0000000000 --- a/conformance/conformance_php.php~ +++ /dev/null @@ -1,119 +0,0 @@ -getPayload() == "protobuf_payload") { - if ($request->getMessageType() == "proto3") { - try { - $test_message->mergeFromString($request->getProtobufPayload()); - } catch (Exception $e) { - $response->setParseError($e->getMessage()); - return $response; - } - } elseif ($request->getMessageType() == "proto2") { - $response->setSkipped("PHP doesn't support proto2"); - return $response; - } else { - trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR); - } - } elseif ($request->getPayload() == "json_payload") { - try { - $test_message->jsonDecode($request->getJsonPayload()); - } catch (Exception $e) { - $response->setParseError($e->getMessage()); - return $response; - } - } else { - trigger_error("Request didn't have payload.", E_USER_ERROR); - } - - if ($request->getRequestedOutputFormat() == WireFormat::UNSPECIFIED) { - trigger_error("Unspecified output format.", E_USER_ERROR); - } elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) { - $response->setProtobufPayload($test_message->serializeToString()); - } elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) { - $response->setJsonPayload($test_message->jsonEncode()); - } - - return $response; -} - -function doTestIO() -{ - $length_bytes = fread(STDIN, 4); - if (strlen($length_bytes) == 0) { - return false; # EOF - } elseif (strlen($length_bytes) != 4) { - trigger_error("I/O error", E_USER_ERROR); - } - - $length = unpack("V", $length_bytes)[1]; - $serialized_request = fread(STDIN, $length); - if (strlen($serialized_request) != $length) { - trigger_error("I/O error", E_USER_ERROR); - } - - $request = new \Conformance\ConformanceRequest(); - $request->mergeFromString($serialized_request); - - $response = doTest($request); - - $serialized_response = $response->serializeToString(); - fwrite(STDOUT, pack("V", strlen($serialized_response))); - fwrite(STDOUT, $serialized_response); - - $GLOBALS['test_count'] += 1; - - return true; -} - -while(true){ - if (!doTestIO()) { - fprintf(STDERR, - "conformance_php: received EOF from test runner " + - "after %d tests, exiting\n", $test_count); - exit; - } -} diff --git a/conformance/conformance_ruby.rb~ b/conformance/conformance_ruby.rb~ deleted file mode 100755 index 7e756d18a6..0000000000 --- a/conformance/conformance_ruby.rb~ +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env ruby -# -# Protocol Buffers - Google's data interchange format -# Copyright 2008 Google Inc. All rights reserved. -# https://developers.google.com/protocol-buffers/ -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -require 'conformance_pb' -require 'google/protobuf/test_messages_proto3_pb' - -$test_count = 0 -$verbose = false - -def do_test(request) - test_message = ProtobufTestMessages::Proto3::TestAllTypes.new - response = Conformance::ConformanceResponse.new - - begin - case request.payload - when :protobuf_payload - if request.message_type.eql?('proto3') - begin - test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( - request.protobuf_payload) - rescue Google::Protobuf::ParseError => err - response.parse_error = err.message.encode('utf-8') - return response - end - elsif request.message_type.eql?('proto2') - response.skipped = "Ruby doesn't support proto2" - return response - else - fail "Protobuf request doesn't have specific type" - end - - when :json_payload - begin - test_message = ProtobufTestMessages::Proto3::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" - end - - case request.requested_output_format - when :UNSPECIFIED - fail 'Unspecified output format' - - when :PROTOBUF - response.protobuf_payload = test_message.to_proto - - 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') - end - - response -end - -# Returns true if the test ran successfully, false on legitimate EOF. -# If EOF is encountered in an unexpected place, raises IOError. -def do_test_io - length_bytes = STDIN.read(4) - return false if length_bytes.nil? - - length = length_bytes.unpack('V').first - serialized_request = STDIN.read(length) - if serialized_request.nil? || serialized_request.length != length - fail IOError - end - - request = Conformance::ConformanceRequest.decode(serialized_request) - - response = do_test(request) - - serialized_response = Conformance::ConformanceResponse.encode(response) - STDOUT.write([serialized_response.length].pack('V')) - STDOUT.write(serialized_response) - STDOUT.flush - - if $verbose - STDERR.puts("conformance_ruby: request=#{request.to_json}, " \ - "response=#{response.to_json}\n") - end - - $test_count += 1 - - true -end - -loop do - unless do_test_io - STDERR.puts('conformance_ruby: received EOF from test runner ' \ - "after #{$test_count} tests, exiting") - break - end -end diff --git a/conformance/failure_list_ruby.txt~ b/conformance/failure_list_ruby.txt~ deleted file mode 100644 index b0d2fe58c8..0000000000 --- a/conformance/failure_list_ruby.txt~ +++ /dev/null @@ -1,135 +0,0 @@ -Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput -Recommended.FieldMaskPathsDontRoundTrip.JsonOutput -Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.JsonInput.DurationHas9FractionalDigits.Validator -Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.JsonInput.Int64FieldBeString.Validator -Recommended.JsonInput.MapFieldValueIsNull -Recommended.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.JsonInput.StringEndsWithEscapeChar -Recommended.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.JsonInput.TimestampHas9FractionalDigits.Validator -Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator -Recommended.JsonInput.TimestampZeroNormalized.Validator -Recommended.JsonInput.Uint64FieldBeString.Validator -Required.DurationProtoInputTooLarge.JsonOutput -Required.DurationProtoInputTooSmall.JsonOutput -Required.JsonInput.Any.JsonOutput -Required.JsonInput.Any.ProtobufOutput -Required.JsonInput.AnyNested.JsonOutput -Required.JsonInput.AnyNested.ProtobufOutput -Required.JsonInput.AnyUnorderedTypeTag.JsonOutput -Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput -Required.JsonInput.AnyWithDuration.JsonOutput -Required.JsonInput.AnyWithDuration.ProtobufOutput -Required.JsonInput.AnyWithFieldMask.JsonOutput -Required.JsonInput.AnyWithFieldMask.ProtobufOutput -Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput -Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput -Required.JsonInput.AnyWithStruct.JsonOutput -Required.JsonInput.AnyWithStruct.ProtobufOutput -Required.JsonInput.AnyWithTimestamp.JsonOutput -Required.JsonInput.AnyWithTimestamp.ProtobufOutput -Required.JsonInput.AnyWithValueForInteger.JsonOutput -Required.JsonInput.AnyWithValueForInteger.ProtobufOutput -Required.JsonInput.AnyWithValueForJsonObject.JsonOutput -Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldNan.JsonOutput -Required.JsonInput.DurationMaxValue.JsonOutput -Required.JsonInput.DurationMaxValue.ProtobufOutput -Required.JsonInput.DurationMinValue.JsonOutput -Required.JsonInput.DurationMinValue.ProtobufOutput -Required.JsonInput.DurationRepeatedValue.JsonOutput -Required.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.JsonInput.FieldMask.JsonOutput -Required.JsonInput.FieldMask.ProtobufOutput -Required.JsonInput.FloatFieldInfinity.JsonOutput -Required.JsonInput.FloatFieldNan.JsonOutput -Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.OneofFieldDuplicate -Required.JsonInput.OptionalBoolWrapper.JsonOutput -Required.JsonInput.OptionalBoolWrapper.ProtobufOutput -Required.JsonInput.OptionalBytesWrapper.JsonOutput -Required.JsonInput.OptionalBytesWrapper.ProtobufOutput -Required.JsonInput.OptionalDoubleWrapper.JsonOutput -Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput -Required.JsonInput.OptionalFloatWrapper.JsonOutput -Required.JsonInput.OptionalFloatWrapper.ProtobufOutput -Required.JsonInput.OptionalInt32Wrapper.JsonOutput -Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput -Required.JsonInput.OptionalInt64Wrapper.JsonOutput -Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput -Required.JsonInput.OptionalStringWrapper.JsonOutput -Required.JsonInput.OptionalStringWrapper.ProtobufOutput -Required.JsonInput.OptionalUint32Wrapper.JsonOutput -Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput -Required.JsonInput.OptionalUint64Wrapper.JsonOutput -Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput -Required.JsonInput.RepeatedBoolWrapper.JsonOutput -Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput -Required.JsonInput.RepeatedBytesWrapper.JsonOutput -Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput -Required.JsonInput.RepeatedDoubleWrapper.JsonOutput -Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput -Required.JsonInput.RepeatedFloatWrapper.JsonOutput -Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput -Required.JsonInput.RepeatedInt32Wrapper.JsonOutput -Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedInt64Wrapper.JsonOutput -Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput -Required.JsonInput.RepeatedStringWrapper.JsonOutput -Required.JsonInput.RepeatedStringWrapper.ProtobufOutput -Required.JsonInput.RepeatedUint32Wrapper.JsonOutput -Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedUint64Wrapper.JsonOutput -Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput -Required.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.JsonInput.Struct.JsonOutput -Required.JsonInput.Struct.ProtobufOutput -Required.JsonInput.TimestampMaxValue.JsonOutput -Required.JsonInput.TimestampMaxValue.ProtobufOutput -Required.JsonInput.TimestampMinValue.JsonOutput -Required.JsonInput.TimestampMinValue.ProtobufOutput -Required.JsonInput.TimestampRepeatedValue.JsonOutput -Required.JsonInput.TimestampRepeatedValue.ProtobufOutput -Required.JsonInput.TimestampWithNegativeOffset.JsonOutput -Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput -Required.JsonInput.TimestampWithPositiveOffset.JsonOutput -Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.JsonInput.ValueAcceptBool.JsonOutput -Required.JsonInput.ValueAcceptBool.ProtobufOutput -Required.JsonInput.ValueAcceptFloat.JsonOutput -Required.JsonInput.ValueAcceptFloat.ProtobufOutput -Required.JsonInput.ValueAcceptInteger.JsonOutput -Required.JsonInput.ValueAcceptInteger.ProtobufOutput -Required.JsonInput.ValueAcceptList.JsonOutput -Required.JsonInput.ValueAcceptList.ProtobufOutput -Required.JsonInput.ValueAcceptNull.JsonOutput -Required.JsonInput.ValueAcceptNull.ProtobufOutput -Required.JsonInput.ValueAcceptObject.JsonOutput -Required.JsonInput.ValueAcceptObject.ProtobufOutput -Required.JsonInput.ValueAcceptString.JsonOutput -Required.JsonInput.ValueAcceptString.ProtobufOutput -Required.Protobuf3Input.DoubleFieldNormalizeQuietNan.JsonOutput -Required.Protobuf3Input.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.Protobuf3Input.FloatFieldNormalizeQuietNan.JsonOutput -Required.Protobuf3Input.FloatFieldNormalizeSignalingNan.JsonOutput -Required.Protobuf3Input.ValidDataRepeated.FLOAT.JsonOutput -Required.TimestampProtoInputTooLarge.JsonOutput -Required.TimestampProtoInputTooSmall.JsonOutput From 5e7e2d3bb8435e4ea20649a9baf9f7420f5f0cce Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 11:52:26 -0700 Subject: [PATCH 35/61] revert ruby proto built files --- ruby/lib/google/protobuf/any_pb.rb | 17 ---- ruby/lib/google/protobuf/api_pb.rb | 39 -------- ruby/lib/google/protobuf/duration_pb.rb | 17 ---- ruby/lib/google/protobuf/empty_pb.rb | 15 ---- ruby/lib/google/protobuf/field_mask_pb.rb | 16 ---- ruby/lib/google/protobuf/source_context_pb.rb | 16 ---- ruby/lib/google/protobuf/struct_pb.rb | 35 -------- ruby/lib/google/protobuf/timestamp_pb.rb | 17 ---- ruby/lib/google/protobuf/type_pb.rb | 89 ------------------- ruby/lib/google/protobuf/wrappers_pb.rb | 48 ---------- ruby/tests/generated_code_pb.rb | 74 --------------- ruby/tests/test_import_pb.rb | 13 --- 12 files changed, 396 deletions(-) delete mode 100644 ruby/lib/google/protobuf/any_pb.rb delete mode 100644 ruby/lib/google/protobuf/api_pb.rb delete mode 100644 ruby/lib/google/protobuf/duration_pb.rb delete mode 100644 ruby/lib/google/protobuf/empty_pb.rb delete mode 100644 ruby/lib/google/protobuf/field_mask_pb.rb delete mode 100644 ruby/lib/google/protobuf/source_context_pb.rb delete mode 100644 ruby/lib/google/protobuf/struct_pb.rb delete mode 100644 ruby/lib/google/protobuf/timestamp_pb.rb delete mode 100644 ruby/lib/google/protobuf/type_pb.rb delete mode 100644 ruby/lib/google/protobuf/wrappers_pb.rb delete mode 100644 ruby/tests/generated_code_pb.rb delete mode 100644 ruby/tests/test_import_pb.rb diff --git a/ruby/lib/google/protobuf/any_pb.rb b/ruby/lib/google/protobuf/any_pb.rb deleted file mode 100644 index 88d2c12b8a..0000000000 --- a/ruby/lib/google/protobuf/any_pb.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/any.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Any" do - optional :type_url, :string, 1 - optional :value, :bytes, 2 - end -end - -module Google - module Protobuf - Any = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Any").msgclass - end -end diff --git a/ruby/lib/google/protobuf/api_pb.rb b/ruby/lib/google/protobuf/api_pb.rb deleted file mode 100644 index 1676b58750..0000000000 --- a/ruby/lib/google/protobuf/api_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/api.proto - -require 'google/protobuf' - -require 'google/protobuf/source_context_pb' -require 'google/protobuf/type_pb' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Api" do - optional :name, :string, 1 - repeated :methods, :message, 2, "google.protobuf.Method" - repeated :options, :message, 3, "google.protobuf.Option" - optional :version, :string, 4 - optional :source_context, :message, 5, "google.protobuf.SourceContext" - repeated :mixins, :message, 6, "google.protobuf.Mixin" - optional :syntax, :enum, 7, "google.protobuf.Syntax" - end - add_message "google.protobuf.Method" do - optional :name, :string, 1 - optional :request_type_url, :string, 2 - optional :request_streaming, :bool, 3 - optional :response_type_url, :string, 4 - optional :response_streaming, :bool, 5 - repeated :options, :message, 6, "google.protobuf.Option" - optional :syntax, :enum, 7, "google.protobuf.Syntax" - end - add_message "google.protobuf.Mixin" do - optional :name, :string, 1 - optional :root, :string, 2 - end -end - -module Google - module Protobuf - Api = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Api").msgclass - Method = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Method").msgclass - Mixin = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Mixin").msgclass - end -end diff --git a/ruby/lib/google/protobuf/duration_pb.rb b/ruby/lib/google/protobuf/duration_pb.rb deleted file mode 100644 index c93f5987d2..0000000000 --- a/ruby/lib/google/protobuf/duration_pb.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/duration.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Duration" do - optional :seconds, :int64, 1 - optional :nanos, :int32, 2 - end -end - -module Google - module Protobuf - Duration = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass - end -end diff --git a/ruby/lib/google/protobuf/empty_pb.rb b/ruby/lib/google/protobuf/empty_pb.rb deleted file mode 100644 index 580db6ddbf..0000000000 --- a/ruby/lib/google/protobuf/empty_pb.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/empty.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Empty" do - end -end - -module Google - module Protobuf - Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass - end -end diff --git a/ruby/lib/google/protobuf/field_mask_pb.rb b/ruby/lib/google/protobuf/field_mask_pb.rb deleted file mode 100644 index ea2811abd6..0000000000 --- a/ruby/lib/google/protobuf/field_mask_pb.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/field_mask.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.FieldMask" do - repeated :paths, :string, 1 - end -end - -module Google - module Protobuf - FieldMask = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass - end -end diff --git a/ruby/lib/google/protobuf/source_context_pb.rb b/ruby/lib/google/protobuf/source_context_pb.rb deleted file mode 100644 index d099d0ea98..0000000000 --- a/ruby/lib/google/protobuf/source_context_pb.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/source_context.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.SourceContext" do - optional :file_name, :string, 1 - end -end - -module Google - module Protobuf - SourceContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass - end -end diff --git a/ruby/lib/google/protobuf/struct_pb.rb b/ruby/lib/google/protobuf/struct_pb.rb deleted file mode 100644 index af53c6e161..0000000000 --- a/ruby/lib/google/protobuf/struct_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/struct.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Struct" do - map :fields, :string, :message, 1, "google.protobuf.Value" - end - add_message "google.protobuf.Value" do - oneof :kind do - optional :null_value, :enum, 1, "google.protobuf.NullValue" - optional :number_value, :double, 2 - optional :string_value, :string, 3 - optional :bool_value, :bool, 4 - optional :struct_value, :message, 5, "google.protobuf.Struct" - optional :list_value, :message, 6, "google.protobuf.ListValue" - end - end - add_message "google.protobuf.ListValue" do - repeated :values, :message, 1, "google.protobuf.Value" - end - add_enum "google.protobuf.NullValue" do - value :NULL_VALUE, 0 - end -end - -module Google - module Protobuf - Struct = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Struct").msgclass - Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Value").msgclass - ListValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ListValue").msgclass - NullValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.NullValue").enummodule - end -end diff --git a/ruby/lib/google/protobuf/timestamp_pb.rb b/ruby/lib/google/protobuf/timestamp_pb.rb deleted file mode 100644 index 7af3333980..0000000000 --- a/ruby/lib/google/protobuf/timestamp_pb.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/timestamp.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Timestamp" do - optional :seconds, :int64, 1 - optional :nanos, :int32, 2 - end -end - -module Google - module Protobuf - Timestamp = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass - end -end diff --git a/ruby/lib/google/protobuf/type_pb.rb b/ruby/lib/google/protobuf/type_pb.rb deleted file mode 100644 index ffcbb9deb6..0000000000 --- a/ruby/lib/google/protobuf/type_pb.rb +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/type.proto - -require 'google/protobuf' - -require 'google/protobuf/any_pb' -require 'google/protobuf/source_context_pb' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.Type" do - optional :name, :string, 1 - repeated :fields, :message, 2, "google.protobuf.Field" - repeated :oneofs, :string, 3 - repeated :options, :message, 4, "google.protobuf.Option" - optional :source_context, :message, 5, "google.protobuf.SourceContext" - optional :syntax, :enum, 6, "google.protobuf.Syntax" - end - add_message "google.protobuf.Field" do - optional :kind, :enum, 1, "google.protobuf.Field.Kind" - optional :cardinality, :enum, 2, "google.protobuf.Field.Cardinality" - optional :number, :int32, 3 - optional :name, :string, 4 - optional :type_url, :string, 6 - optional :oneof_index, :int32, 7 - optional :packed, :bool, 8 - repeated :options, :message, 9, "google.protobuf.Option" - optional :json_name, :string, 10 - optional :default_value, :string, 11 - end - add_enum "google.protobuf.Field.Kind" do - value :TYPE_UNKNOWN, 0 - value :TYPE_DOUBLE, 1 - value :TYPE_FLOAT, 2 - value :TYPE_INT64, 3 - value :TYPE_UINT64, 4 - value :TYPE_INT32, 5 - value :TYPE_FIXED64, 6 - value :TYPE_FIXED32, 7 - value :TYPE_BOOL, 8 - value :TYPE_STRING, 9 - value :TYPE_GROUP, 10 - value :TYPE_MESSAGE, 11 - value :TYPE_BYTES, 12 - value :TYPE_UINT32, 13 - value :TYPE_ENUM, 14 - value :TYPE_SFIXED32, 15 - value :TYPE_SFIXED64, 16 - value :TYPE_SINT32, 17 - value :TYPE_SINT64, 18 - end - add_enum "google.protobuf.Field.Cardinality" do - value :CARDINALITY_UNKNOWN, 0 - value :CARDINALITY_OPTIONAL, 1 - value :CARDINALITY_REQUIRED, 2 - value :CARDINALITY_REPEATED, 3 - end - add_message "google.protobuf.Enum" do - optional :name, :string, 1 - repeated :enumvalue, :message, 2, "google.protobuf.EnumValue" - repeated :options, :message, 3, "google.protobuf.Option" - optional :source_context, :message, 4, "google.protobuf.SourceContext" - optional :syntax, :enum, 5, "google.protobuf.Syntax" - end - add_message "google.protobuf.EnumValue" do - optional :name, :string, 1 - optional :number, :int32, 2 - repeated :options, :message, 3, "google.protobuf.Option" - end - add_message "google.protobuf.Option" do - optional :name, :string, 1 - optional :value, :message, 2, "google.protobuf.Any" - end - add_enum "google.protobuf.Syntax" do - value :SYNTAX_PROTO2, 0 - value :SYNTAX_PROTO3, 1 - end -end - -module Google - module Protobuf - Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Type").msgclass - Field = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field").msgclass - Field::Kind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Kind").enummodule - Field::Cardinality = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field.Cardinality").enummodule - Enum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Enum").msgclass - EnumValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValue").msgclass - Option = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Option").msgclass - Syntax = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Syntax").enummodule - end -end diff --git a/ruby/lib/google/protobuf/wrappers_pb.rb b/ruby/lib/google/protobuf/wrappers_pb.rb deleted file mode 100644 index e26a4d23c6..0000000000 --- a/ruby/lib/google/protobuf/wrappers_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/wrappers.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.protobuf.DoubleValue" do - optional :value, :double, 1 - end - add_message "google.protobuf.FloatValue" do - optional :value, :float, 1 - end - add_message "google.protobuf.Int64Value" do - optional :value, :int64, 1 - end - add_message "google.protobuf.UInt64Value" do - optional :value, :uint64, 1 - end - add_message "google.protobuf.Int32Value" do - optional :value, :int32, 1 - end - add_message "google.protobuf.UInt32Value" do - optional :value, :uint32, 1 - end - add_message "google.protobuf.BoolValue" do - optional :value, :bool, 1 - end - add_message "google.protobuf.StringValue" do - optional :value, :string, 1 - end - add_message "google.protobuf.BytesValue" do - optional :value, :bytes, 1 - end -end - -module Google - module Protobuf - DoubleValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DoubleValue").msgclass - FloatValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FloatValue").msgclass - Int64Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int64Value").msgclass - UInt64Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt64Value").msgclass - Int32Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int32Value").msgclass - UInt32Value = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt32Value").msgclass - BoolValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BoolValue").msgclass - StringValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.StringValue").msgclass - BytesValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BytesValue").msgclass - end -end diff --git a/ruby/tests/generated_code_pb.rb b/ruby/tests/generated_code_pb.rb deleted file mode 100644 index 0358ada781..0000000000 --- a/ruby/tests/generated_code_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: tests/generated_code.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "a.b.c.TestMessage" do - optional :optional_int32, :int32, 1 - optional :optional_int64, :int64, 2 - optional :optional_uint32, :uint32, 3 - optional :optional_uint64, :uint64, 4 - optional :optional_bool, :bool, 5 - optional :optional_double, :double, 6 - optional :optional_float, :float, 7 - optional :optional_string, :string, 8 - optional :optional_bytes, :bytes, 9 - optional :optional_enum, :enum, 10, "a.b.c.TestEnum" - optional :optional_msg, :message, 11, "a.b.c.TestMessage" - repeated :repeated_int32, :int32, 21 - repeated :repeated_int64, :int64, 22 - repeated :repeated_uint32, :uint32, 23 - repeated :repeated_uint64, :uint64, 24 - repeated :repeated_bool, :bool, 25 - repeated :repeated_double, :double, 26 - repeated :repeated_float, :float, 27 - repeated :repeated_string, :string, 28 - repeated :repeated_bytes, :bytes, 29 - repeated :repeated_enum, :enum, 30, "a.b.c.TestEnum" - repeated :repeated_msg, :message, 31, "a.b.c.TestMessage" - map :map_int32_string, :int32, :string, 61 - map :map_int64_string, :int64, :string, 62 - map :map_uint32_string, :uint32, :string, 63 - map :map_uint64_string, :uint64, :string, 64 - map :map_bool_string, :bool, :string, 65 - map :map_string_string, :string, :string, 66 - map :map_string_msg, :string, :message, 67, "a.b.c.TestMessage" - map :map_string_enum, :string, :enum, 68, "a.b.c.TestEnum" - map :map_string_int32, :string, :int32, 69 - map :map_string_bool, :string, :bool, 70 - optional :nested_message, :message, 80, "a.b.c.TestMessage.NestedMessage" - oneof :my_oneof do - optional :oneof_int32, :int32, 41 - optional :oneof_int64, :int64, 42 - optional :oneof_uint32, :uint32, 43 - optional :oneof_uint64, :uint64, 44 - optional :oneof_bool, :bool, 45 - optional :oneof_double, :double, 46 - optional :oneof_float, :float, 47 - optional :oneof_string, :string, 48 - optional :oneof_bytes, :bytes, 49 - optional :oneof_enum, :enum, 50, "a.b.c.TestEnum" - optional :oneof_msg, :message, 51, "a.b.c.TestMessage" - end - end - add_message "a.b.c.TestMessage.NestedMessage" do - optional :foo, :int32, 1 - end - add_enum "a.b.c.TestEnum" do - value :Default, 0 - value :A, 1 - value :B, 2 - value :C, 3 - end -end - -module A - module B - module C - TestMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("a.b.c.TestMessage").msgclass - TestMessage::NestedMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("a.b.c.TestMessage.NestedMessage").msgclass - TestEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("a.b.c.TestEnum").enummodule - end - end -end diff --git a/ruby/tests/test_import_pb.rb b/ruby/tests/test_import_pb.rb deleted file mode 100644 index 83f04d6053..0000000000 --- a/ruby/tests/test_import_pb.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: tests/test_import.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "foo_bar.TestImportedMessage" do - end -end - -module FooBar - TestImportedMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("foo_bar.TestImportedMessage").msgclass -end From 06c9057cc32f0155f277dd0842f83b5ac362c386 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 12:17:24 -0700 Subject: [PATCH 36/61] add objec support --- conformance/conformance_objc.m | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/conformance/conformance_objc.m b/conformance/conformance_objc.m index ef037f8496..db3cc3e799 100644 --- a/conformance/conformance_objc.m +++ b/conformance/conformance_objc.m @@ -71,12 +71,20 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { break; case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { - NSError *error = nil; - testMessage = [TestAllTypes parseFromData:request.protobufPayload - error:&error]; - if (!testMessage) { - response.parseError = - [NSString stringWithFormat:@"Parse error: %@", error]; + if ([request.messageType isEqualToString:@"proto3"]) { + NSError *error = nil; + testMessage = [TestAllTypes parseFromData:request.protobufPayload + error:&error]; + if (!testMessage) { + response.parseError = + [NSString stringWithFormat:@"Parse error: %@", error]; + } + } else if ([request.messageType isEqualToString:@"proto2"]) { + response.skipped = @"ObjC doesn't support proto2"; + break; + } else { + Die(@"Protobuf request doesn't have specific payload type"); + break; } break; } From 364502102afe62bc0a9068032a177d1827aa4774 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 12:41:11 -0700 Subject: [PATCH 37/61] add message set test case --- conformance/conformance.proto | 1 + .../protobuf/test_messages_proto2.proto | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/conformance/conformance.proto b/conformance/conformance.proto index a1c42663b0..10e5d34eb8 100644 --- a/conformance/conformance.proto +++ b/conformance/conformance.proto @@ -78,6 +78,7 @@ message ConformanceRequest { // Which format should the testee serialize its message to? WireFormat requested_output_format = 3; + // should be set to either "proto2" or "proto3" string message_type = 4; } diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto index 85aa137460..0c072b0c28 100644 --- a/src/google/protobuf/test_messages_proto2.proto +++ b/src/google/protobuf/test_messages_proto2.proto @@ -179,6 +179,26 @@ message TestAllTypesProto2 { optional int32 field__Name16 = 416; optional int32 field_name17__ = 417; optional int32 Field_name18__ = 418; + + // message_set test case. + message mset_correct { + option message_set_wire_format = true; + extensions 4 to max; + } + + message mset_correct_extension1 { + extend mset_correct { + optional mset_correct_extension1 message_set_extension = 1547769; + } + optional string str = 25; + } + + message mset_correct_extension2 { + extend mset_correct { + optional mset_correct_extension1 message_set_extension = 4135312; + } + optional int32 i = 9; + } } message ForeignMessage { From cd1dc3f0dfb853d7b72d8494efb5919901f2589b Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 14:51:56 -0700 Subject: [PATCH 38/61] add csharp support --- .../Conformance.cs | 51 +++++++++++++++---- .../Google.Protobuf.Conformance/Program.cs | 18 ++++++- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs index 1a835aef02..e1fbb350fa 100644 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs +++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs @@ -22,21 +22,21 @@ namespace Conformance { static ConformanceReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UijQEKEkNvbmZvcm1h", + "ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UiowEKEkNvbmZvcm1h", "bmNlUmVxdWVzdBIaChBwcm90b2J1Zl9wYXlsb2FkGAEgASgMSAASFgoManNv", "bl9wYXlsb2FkGAIgASgJSAASOAoXcmVxdWVzdGVkX291dHB1dF9mb3JtYXQY", - "AyABKA4yFy5jb25mb3JtYW5jZS5XaXJlRm9ybWF0QgkKB3BheWxvYWQisQEK", - "E0NvbmZvcm1hbmNlUmVzcG9uc2USFQoLcGFyc2VfZXJyb3IYASABKAlIABIZ", - "Cg9zZXJpYWxpemVfZXJyb3IYBiABKAlIABIXCg1ydW50aW1lX2Vycm9yGAIg", - "ASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgDIAEoDEgAEhYKDGpzb25fcGF5", - "bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSABKAlIAEIICgZyZXN1bHQqNQoK", - "V2lyZUZvcm1hdBIPCgtVTlNQRUNJRklFRBAAEgwKCFBST1RPQlVGEAESCAoE", - "SlNPThACQiEKH2NvbS5nb29nbGUucHJvdG9idWYuY29uZm9ybWFuY2ViBnBy", - "b3RvMw==")); + "AyABKA4yFy5jb25mb3JtYW5jZS5XaXJlRm9ybWF0EhQKDG1lc3NhZ2VfdHlw", + "ZRgEIAEoCUIJCgdwYXlsb2FkIrEBChNDb25mb3JtYW5jZVJlc3BvbnNlEhUK", + "C3BhcnNlX2Vycm9yGAEgASgJSAASGQoPc2VyaWFsaXplX2Vycm9yGAYgASgJ", + "SAASFwoNcnVudGltZV9lcnJvchgCIAEoCUgAEhoKEHByb3RvYnVmX3BheWxv", + "YWQYAyABKAxIABIWCgxqc29uX3BheWxvYWQYBCABKAlIABIRCgdza2lwcGVk", + "GAUgASgJSABCCAoGcmVzdWx0KjUKCldpcmVGb3JtYXQSDwoLVU5TUEVDSUZJ", + "RUQQABIMCghQUk9UT0JVRhABEggKBEpTT04QAkIhCh9jb20uZ29vZ2xlLnBy", + "b3RvYnVmLmNvbmZvcm1hbmNlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), }, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "RequestedOutputFormat" }, new[]{ "Payload" }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "RequestedOutputFormat", "MessageType" }, new[]{ "Payload" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped" }, new[]{ "Result" }, null, null) })); } @@ -85,6 +85,7 @@ namespace Conformance { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ConformanceRequest(ConformanceRequest other) : this() { requestedOutputFormat_ = other.requestedOutputFormat_; + messageType_ = other.messageType_; switch (other.PayloadCase) { case PayloadOneofCase.ProtobufPayload: ProtobufPayload = other.ProtobufPayload; @@ -137,6 +138,20 @@ namespace Conformance { } } + /// Field number for the "message_type" field. + public const int MessageTypeFieldNumber = 4; + private string messageType_ = ""; + /// + /// should be set to either "proto2" or "proto3" + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MessageType { + get { return messageType_; } + set { + messageType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + private object payload_; /// Enum of possible cases for the "payload" oneof. public enum PayloadOneofCase { @@ -172,6 +187,7 @@ namespace Conformance { if (ProtobufPayload != other.ProtobufPayload) return false; if (JsonPayload != other.JsonPayload) return false; if (RequestedOutputFormat != other.RequestedOutputFormat) return false; + if (MessageType != other.MessageType) return false; if (PayloadCase != other.PayloadCase) return false; return true; } @@ -182,6 +198,7 @@ namespace Conformance { if (payloadCase_ == PayloadOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode(); if (payloadCase_ == PayloadOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode(); if (RequestedOutputFormat != 0) hash ^= RequestedOutputFormat.GetHashCode(); + if (MessageType.Length != 0) hash ^= MessageType.GetHashCode(); hash ^= (int) payloadCase_; return hash; } @@ -205,6 +222,10 @@ namespace Conformance { output.WriteRawTag(24); output.WriteEnum((int) RequestedOutputFormat); } + if (MessageType.Length != 0) { + output.WriteRawTag(34); + output.WriteString(MessageType); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -219,6 +240,9 @@ namespace Conformance { if (RequestedOutputFormat != 0) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RequestedOutputFormat); } + if (MessageType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageType); + } return size; } @@ -230,6 +254,9 @@ namespace Conformance { if (other.RequestedOutputFormat != 0) { RequestedOutputFormat = other.RequestedOutputFormat; } + if (other.MessageType.Length != 0) { + MessageType = other.MessageType; + } switch (other.PayloadCase) { case PayloadOneofCase.ProtobufPayload: ProtobufPayload = other.ProtobufPayload; @@ -261,6 +288,10 @@ namespace Conformance { requestedOutputFormat_ = (global::Conformance.WireFormat) input.ReadEnum(); break; } + case 34: { + MessageType = input.ReadString(); + break; + } } } } diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 00ee64f8a5..3d792f794c 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -90,9 +90,23 @@ namespace Google.Protobuf.Conformance var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); message = parser.Parse(request.JsonPayload); break; - case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); + case ConformanceRequest.PayloadOneofCase.ProtobufPayload: + { + if (request.MessageType.Equals("proto3")) + { + message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); + } + else if (request.MessageType.Equals("proto2")) + { + response.Skipped = "Ruby doesn't support proto2"; + return response; + } + else + { + throw new Exception(" Protobuf request doesn't have specific payload type"); + } break; + } default: throw new Exception("Unsupported request payload: " + request.PayloadCase); } From ff773c1aaf8a9cb8617f894f0d179329ba56f146 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 14:55:30 -0700 Subject: [PATCH 39/61] fix csharp --- .../Google.Protobuf.Conformance/Program.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 3d792f794c..8359caf7d6 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -91,22 +91,22 @@ namespace Google.Protobuf.Conformance message = parser.Parse(request.JsonPayload); break; case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - { - if (request.MessageType.Equals("proto3")) - { - message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); - } - else if (request.MessageType.Equals("proto2")) - { - response.Skipped = "Ruby doesn't support proto2"; - return response; - } - else - { - throw new Exception(" Protobuf request doesn't have specific payload type"); - } + { + if (request.MessageType.Equals("proto3")) + { + message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); + } + else if (request.MessageType.Equals("proto2")) + { + response.Skipped = "CSharp doesn't support proto2"; + return response; + } + else + { + throw new Exception(" Protobuf request doesn't have specific payload type"); + } break; - } + } default: throw new Exception("Unsupported request payload: " + request.PayloadCase); } From db379e6e69196993f1c1e54512afe06b39cb97eb Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 15:32:59 -0700 Subject: [PATCH 40/61] fix csharp conformance test --- .../Google.Protobuf.Conformance/Program.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 8359caf7d6..437fa3a237 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -91,22 +91,22 @@ namespace Google.Protobuf.Conformance message = parser.Parse(request.JsonPayload); break; case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - { - if (request.MessageType.Equals("proto3")) - { - message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); - } - else if (request.MessageType.Equals("proto2")) - { - response.Skipped = "CSharp doesn't support proto2"; - return response; - } - else - { - throw new Exception(" Protobuf request doesn't have specific payload type"); - } - break; - } + { + if (request.MessageType.Equals("proto3")) + { + message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); + } + else if (request.MessageType.Equals("proto2")) + { + + return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" } + } + else + { + throw new Exception(" Protobuf request doesn't have specific payload type"); + } + break; + } default: throw new Exception("Unsupported request payload: " + request.PayloadCase); } From 467c1ccd25023d19cd25680081ed0e4c95d0cb41 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 28 Jun 2017 15:44:14 -0700 Subject: [PATCH 41/61] fix csharp conformance test --- csharp/src/Google.Protobuf.Conformance/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 437fa3a237..76b21e3986 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -99,7 +99,7 @@ namespace Google.Protobuf.Conformance else if (request.MessageType.Equals("proto2")) { - return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" } + return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" }; } else { From 020a24dfdc2de06678f3f7f3547ba748fb5e5d42 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Thu, 29 Jun 2017 11:33:22 -0700 Subject: [PATCH 42/61] change cpp and python to uniform message --- conformance/conformance_cpp.cc | 50 ++++++++++----------- conformance/conformance_python.py | 47 ++++++++------------ conformance/conformance_test.cc | 72 ++++++++++++------------------- 3 files changed, 67 insertions(+), 102 deletions(-) diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc index 9c5907027c..8d204dd2ef 100644 --- a/conformance/conformance_cpp.cc +++ b/conformance/conformance_cpp.cc @@ -35,6 +35,7 @@ #include "conformance.pb.h" #include #include +#include #include #include @@ -42,6 +43,7 @@ using conformance::ConformanceRequest; using conformance::ConformanceResponse; using google::protobuf::Descriptor; using google::protobuf::DescriptorPool; +using google::protobuf::Message; using google::protobuf::internal::scoped_ptr; using google::protobuf::util::BinaryToJsonString; using google::protobuf::util::JsonToBinaryString; @@ -89,27 +91,27 @@ void CheckedWrite(int fd, const void *buf, size_t len) { } void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { - TestAllTypes test_message; - TestAllTypesProto2 test_message_proto2; - bool isProto3 = request.message_type() == "proto3"; + Message *test_message; + bool isProto3 = + request.message_type() == "protobuf_test_messages.proto3.TestAllTypes"; bool isJson = request.payload_case() == ConformanceRequest::kJsonPayload; + bool isProto2 = + request.message_type() == "protobuf_test_messages.proto2.TestAllTypesProto2"; + if (isJson || isProto3) { + test_message = new TestAllTypes; + } else if (isProto2) { + test_message = new TestAllTypesProto2; + } else { + GOOGLE_LOG(FATAL) << "Protobuf request doesn't have specific payload type"; + } switch (request.payload_case()) { case ConformanceRequest::kProtobufPayload: { - if (isProto3) { - if (!test_message.ParseFromString(request.protobuf_payload())) { - // Getting parse details would involve something like: - // http://stackoverflow.com/questions/22121922/how-can-i-get-more-details-about-errors-generated-during-protobuf-parsing-c - response->set_parse_error("Parse error (no more details available)."); - return; - } - } else if (request.message_type() == "proto2") { - if (!test_message_proto2.ParseFromString(request.protobuf_payload())) { - response->set_parse_error("Parse error (no more details available)."); - return; - } - } else { - GOOGLE_LOG(FATAL) << "Protobuf request doesn't have specific payload type"; + if (!test_message->ParseFromString(request.protobuf_payload())) { + // Getting parse details would involve something like: + // http://stackoverflow.com/questions/22121922/how-can-i-get-more-details-about-errors-generated-during-protobuf-parsing-c + response->set_parse_error("Parse error (no more details available)."); + return; } break; } @@ -124,7 +126,7 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { return; } - if (!test_message.ParseFromString(proto_binary)) { + if (!test_message->ParseFromString(proto_binary)) { response->set_runtime_error( "Parsing JSON generates invalid proto output."); return; @@ -143,21 +145,13 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { break; case conformance::PROTOBUF: { - (isProto3 || isJson) ? - GOOGLE_CHECK( - test_message.SerializeToString(response->mutable_protobuf_payload())) - : - GOOGLE_CHECK( - test_message_proto2.SerializeToString(response->mutable_protobuf_payload())); + GOOGLE_CHECK(test_message->SerializeToString(response->mutable_protobuf_payload())); break; } case conformance::JSON: { string proto_binary; - (isProto3 || isJson) ? - GOOGLE_CHECK(test_message.SerializeToString(&proto_binary)) - : - GOOGLE_CHECK(test_message_proto2.SerializeToString(&proto_binary)); + GOOGLE_CHECK(test_message->SerializeToString(&proto_binary)); Status status = BinaryToJsonString(type_resolver, *type_url, proto_binary, response->mutable_json_payload()); if (!status.ok()) { diff --git a/conformance/conformance_python.py b/conformance/conformance_python.py index 846ccbc646..62cfce87bb 100755 --- a/conformance/conformance_python.py +++ b/conformance/conformance_python.py @@ -54,30 +54,25 @@ class ProtocolError(Exception): pass def do_test(request): - test_message = test_messages_proto3_pb2.TestAllTypes() - response = conformance_pb2.ConformanceResponse() - test_message = test_messages_proto3_pb2.TestAllTypes() - test_message_proto2 = test_messages_proto2_pb2.TestAllTypesProto2() - isProto3 = (request.message_type == "proto3") + isProto3 = (request.message_type == "protobuf_test_messages.proto3.TestAllTypes") isJson = (request.WhichOneof('payload') == 'json_payload') + isProto2 = (request.message_type == "protobuf_test_messages.proto2.TestAllTypesProto2") + + if (not isProto3) and (not isJson) and (not isProto2): + raise ProtocolError("Protobuf request doesn't have specific payload type") + + test_message = test_messages_proto2_pb2.TestAllTypesProto2() if isProto2 else \ + test_messages_proto3_pb2.TestAllTypes() + response = conformance_pb2.ConformanceResponse() try: if request.WhichOneof('payload') == 'protobuf_payload': - if isProto3: - try: - test_message.ParseFromString(request.protobuf_payload) - except message.DecodeError as e: - response.parse_error = str(e) - return response - elif request.message_type == "proto2": - try: - test_message_proto2.ParseFromString(request.protobuf_payload) - except message.DecodeError as e: - response.parse_error = str(e) - return response - else: - raise ProtocolError("Protobuf request doesn't have specific payload type") - + try: + test_message.ParseFromString(request.protobuf_payload) + except message.DecodeError as e: + response.parse_error = str(e) + return response + elif request.WhichOneof('payload') == 'json_payload': try: json_format.Parse(request.json_payload, test_message) @@ -92,17 +87,11 @@ def do_test(request): raise ProtocolError("Unspecified output format") elif request.requested_output_format == conformance_pb2.PROTOBUF: - if isProto3 or isJson: - response.protobuf_payload = test_message.SerializeToString() - else: - response.protobuf_payload = test_message_proto2.SerializeToString() + response.protobuf_payload = test_message.SerializeToString() elif request.requested_output_format == conformance_pb2.JSON: - try: - if isProto3 or isJson: - response.json_payload = json_format.MessageToJson(test_message) - else: - response.json_payload = json_format.MessageToJson(test_message_proto2) + try: + response.json_payload = json_format.MessageToJson(test_message) except Exception as e: response.serialize_error = str(e) return response diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index f44fe8a10c..7583c88dbd 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -276,14 +276,18 @@ void ConformanceTestSuite::RunValidInputTest( const string& test_name, ConformanceLevel level, const string& input, WireFormat input_format, const string& equivalent_text_format, WireFormat requested_output, bool isProto3) { - TestAllTypes reference_message; - TestAllTypesProto2 reference_message_proto2; + auto newTestMessage = [&isProto3]() { + Message* newMessage; + if (isProto3) { + newMessage = new TestAllTypes; + } else { + newMessage = new TestAllTypesProto2; + } + return newMessage; + }; + Message* reference_message = newTestMessage(); GOOGLE_CHECK( - isProto3 ? - TextFormat::ParseFromString(equivalent_text_format, &reference_message) - : - TextFormat::ParseFromString(equivalent_text_format, &reference_message_proto2) - ) + TextFormat::ParseFromString(equivalent_text_format, reference_message)) << "Failed to parse data for test case: " << test_name << ", data: " << equivalent_text_format; @@ -294,9 +298,9 @@ void ConformanceTestSuite::RunValidInputTest( case conformance::PROTOBUF: { request.set_protobuf_payload(input); if (isProto3) { - request.set_message_type("proto3"); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypes"); } else { - request.set_message_type("proto2"); + request.set_message_type("protobuf_test_messages.proto2.TestAllTypesProto2"); } break; } @@ -313,8 +317,7 @@ void ConformanceTestSuite::RunValidInputTest( RunTest(test_name, request, &response); - TestAllTypes test_message; - TestAllTypesProto2 test_message_proto2; + Message *test_message = newTestMessage(); switch (response.result_case()) { case ConformanceResponse::RESULT_NOT_SET: @@ -350,20 +353,11 @@ void ConformanceTestSuite::RunValidInputTest( return; } - if (isProto3) { - if (!test_message.ParseFromString(binary_protobuf)) { - ReportFailure(test_name, level, request, response, - "INTERNAL ERROR: internal JSON->protobuf transcode " - "yielded unparseable proto."); - return; - } - } else { - if (!test_message_proto2.ParseFromString(binary_protobuf)) { - ReportFailure(test_name, level, request, response, - "INTERNAL ERROR: internal JSON->protobuf transcode " - "yielded unparseable proto."); - return; - } + if (!test_message->ParseFromString(binary_protobuf)) { + ReportFailure(test_name, level, request, response, + "INTERNAL ERROR: internal JSON->protobuf transcode " + "yielded unparseable proto."); + return; } break; @@ -377,18 +371,10 @@ void ConformanceTestSuite::RunValidInputTest( return; } - if (isProto3) { - if (!test_message.ParseFromString(response.protobuf_payload())) { - ReportFailure(test_name, level, request, response, - "Protobuf output we received from test was unparseable."); - return; - } - } else { - if (!test_message_proto2.ParseFromString(response.protobuf_payload())) { - ReportFailure(test_name, level, request, response, - "Protobuf output we received from test was unparseable."); - return; - } + if (!test_message->ParseFromString(response.protobuf_payload())) { + ReportFailure(test_name, level, request, response, + "Protobuf output we received from test was unparseable."); + return; } break; @@ -407,11 +393,7 @@ void ConformanceTestSuite::RunValidInputTest( differencer.ReportDifferencesToString(&differences); bool check; - if (isProto3) { - check = differencer.Compare(reference_message, test_message); - } else { - check = differencer.Compare(reference_message_proto2, test_message_proto2); - } + check = differencer.Compare(*reference_message, *test_message); if (check) { ReportSuccess(test_name); } else { @@ -429,9 +411,9 @@ void ConformanceTestSuite::ExpectParseFailureForProto( ConformanceResponse response; request.set_protobuf_payload(proto); if (isProto3) { - request.set_message_type("proto3"); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypes"); } else { - request.set_message_type("proto2"); + request.set_message_type("protobuf_test_messages.proto2.TestAllTypesProto2"); } string effective_test_name = ConformanceLevelToString(level) + ".ProtobufInput." + test_name; @@ -586,7 +568,7 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson( ConformanceRequest request; ConformanceResponse response; request.set_protobuf_payload(payload_message.SerializeAsString()); - request.set_message_type("proto3"); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypes"); string effective_test_name = ConformanceLevelToString(level) + "." + test_name + ".JsonOutput"; request.set_requested_output_format(conformance::JSON); From fcb926825537c214ef7ce40f742aca905345f958 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Thu, 29 Jun 2017 14:40:47 -0700 Subject: [PATCH 43/61] change java to uniform message, revert TestValidDataForType's parameters --- conformance/ConformanceJava.java | 376 +++++++++---------------------- conformance/conformance_test.cc | 86 ++++--- conformance/conformance_test.h | 3 +- 3 files changed, 147 insertions(+), 318 deletions(-) diff --git a/conformance/ConformanceJava.java b/conformance/ConformanceJava.java index 3a944b51c9..15aaed9635 100644 --- a/conformance/ConformanceJava.java +++ b/conformance/ConformanceJava.java @@ -1,13 +1,18 @@ import com.google.protobuf.ByteString; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Parser; import com.google.protobuf.CodedInputStream; import com.google.protobuf.conformance.Conformance; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf_test_messages.proto3.TestMessagesProto3; +import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypes; import com.google.protobuf_test_messages.proto2.TestMessagesProto2; +import com.google.protobuf_test_messages.proto2.TestMessagesProto2.TestAllTypesProto2; +import com.google.protobuf.ExtensionRegistry; import com.google.protobuf.util.JsonFormat; import com.google.protobuf.util.JsonFormat.TypeRegistry; -import java.io.IOException; import java.nio.ByteBuffer; +import java.util.ArrayList; class ConformanceJava { private int testCount = 0; @@ -51,275 +56,100 @@ class ConformanceJava { buf[3] = (byte)(val >> 24); writeToStdout(buf); } - - private enum BinaryDecoder { - BYTE_STRING_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - return TestMessagesProto3.TestAllTypes.parseFrom(bytes); - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - return TestMessagesProto2.TestAllTypesProto2.parseFrom(bytes); - } - }, - BYTE_ARRAY_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - return TestMessagesProto3.TestAllTypes.parseFrom(bytes.toByteArray()); - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - return TestMessagesProto2.TestAllTypesProto2.parseFrom(bytes.toByteArray()); - } - }, - ARRAY_BYTE_BUFFER_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { - return TestMessagesProto3.TestAllTypes.parseFrom(CodedInputStream.newInstance(buffer)); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { - return TestMessagesProto2.TestAllTypesProto2.parseFrom(CodedInputStream.newInstance(buffer)); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - }, - READONLY_ARRAY_BYTE_BUFFER_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - try { - return TestMessagesProto3.TestAllTypes.parseFrom( - CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer())); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - try { - return TestMessagesProto2.TestAllTypesProto2.parseFrom( - CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer())); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - }, - DIRECT_BYTE_BUFFER_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { - return TestMessagesProto3.TestAllTypes.parseFrom(CodedInputStream.newInstance(buffer)); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { - return TestMessagesProto2.TestAllTypesProto2 - .parseFrom(CodedInputStream.newInstance(buffer)); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - }, - READONLY_DIRECT_BYTE_BUFFER_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { - return TestMessagesProto3.TestAllTypes.parseFrom( - CodedInputStream.newInstance(buffer.asReadOnlyBuffer())); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { - return TestMessagesProto2.TestAllTypesProto2.parseFrom( - CodedInputStream.newInstance(buffer.asReadOnlyBuffer())); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based ByteBuffer should not throw IOException.", e); - } - } - }, - INPUT_STREAM_DECODER() { - @Override - public TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException { - try { - return TestMessagesProto3.TestAllTypes.parseFrom(bytes.newInput()); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based InputStream should not throw IOException.", e); - } - } - @Override - public TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException { - try { - return TestMessagesProto2.TestAllTypesProto2.parseFrom(bytes.newInput()); - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "ByteString based InputStream should not throw IOException.", e); - } - } - }; - - public abstract TestMessagesProto3.TestAllTypes parseProto3(ByteString bytes) - throws InvalidProtocolBufferException; - public abstract TestMessagesProto2.TestAllTypesProto2 parseProto2(ByteString bytes) - throws InvalidProtocolBufferException; + + private enum BinaryDecoderType { + BTYE_STRING_DECODER, + BYTE_ARRAY_DECODER, + ARRAY_BYTE_BUFFER_DECODER, + READONLY_ARRAY_BYTE_BUFFER_DECODER, + DIRECT_BYTE_BUFFER_DECODER, + READONLY_DIRECT_BYTE_BUFFER_DECODER, + INPUT_STREAM_DECODER; } - private TestMessagesProto3.TestAllTypes parseBinaryToProto3(ByteString bytes) + private static class BinaryDecoder { + public MessageType decode (ByteString bytes, BinaryDecoderType type, + Parser parser, ExtensionRegistry extensions) throws InvalidProtocolBufferException { - TestMessagesProto3.TestAllTypes[] messages = - new TestMessagesProto3.TestAllTypes[BinaryDecoder.values().length]; - InvalidProtocolBufferException[] exceptions = - new InvalidProtocolBufferException[BinaryDecoder.values().length]; - - boolean hasMessage = false; - boolean hasException = false; - for (int i = 0; i < BinaryDecoder.values().length; ++i) { - try { - messages[i] = BinaryDecoder.values()[i].parseProto3(bytes); - hasMessage = true; - } catch (InvalidProtocolBufferException e) { - exceptions[i] = e; - hasException = true; - } - } - - if (hasMessage && hasException) { - StringBuilder sb = - new StringBuilder("Binary decoders disagreed on whether the payload was valid.\n"); - for (int i = 0; i < BinaryDecoder.values().length; ++i) { - sb.append(BinaryDecoder.values()[i].name()); - if (messages[i] != null) { - sb.append(" accepted the payload.\n"); - } else { - sb.append(" rejected the payload.\n"); + switch (type) { + case BTYE_STRING_DECODER: + return parser.parseFrom(bytes, extensions); + case BYTE_ARRAY_DECODER: + return parser.parseFrom(bytes.toByteArray(), extensions); + case ARRAY_BYTE_BUFFER_DECODER: { + ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + try { + return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions); + } catch (InvalidProtocolBufferException e) { + throw e; + } } - } - throw new RuntimeException(sb.toString()); - } - - if (hasException) { - // We do not check if exceptions are equal. Different implementations may return different - // exception messages. Throw an arbitrary one out instead. - throw exceptions[0]; - } - - // Fast path comparing all the messages with the first message, assuming equality being - // symmetric and transitive. - boolean allEqual = true; - for (int i = 1; i < messages.length; ++i) { - if (!messages[0].equals(messages[i])) { - allEqual = false; - break; - } - } - - // Slow path: compare and find out all unequal pairs. - if (!allEqual) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < messages.length - 1; ++i) { - for (int j = i + 1; j < messages.length; ++j) { - if (!messages[i].equals(messages[j])) { - sb.append(BinaryDecoder.values()[i].name()) - .append(" and ") - .append(BinaryDecoder.values()[j].name()) - .append(" parsed the payload differently.\n"); + case READONLY_ARRAY_BYTE_BUFFER_DECODER: { + try { + return parser.parseFrom( + CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer()), extensions); + } catch (InvalidProtocolBufferException e) { + throw e; + } + } + case DIRECT_BYTE_BUFFER_DECODER: { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + try { + return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions); + } catch (InvalidProtocolBufferException e) { + throw e; + } + } + case READONLY_DIRECT_BYTE_BUFFER_DECODER: { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + try { + return parser.parseFrom( + CodedInputStream.newInstance(buffer.asReadOnlyBuffer()), extensions); + } catch (InvalidProtocolBufferException e) { + throw e; + } + } + case INPUT_STREAM_DECODER: { + try { + return parser.parseFrom(bytes.newInput(), extensions); + } catch (InvalidProtocolBufferException e) { + throw e; } } + default : + return null; } - throw new RuntimeException(sb.toString()); } - - return messages[0]; } - - private TestMessagesProto2.TestAllTypesProto2 parseBinaryToProto2(ByteString bytes) + + private MessageType parseBinary( + ByteString bytes, Parser parser, ExtensionRegistry extensions) throws InvalidProtocolBufferException { - TestMessagesProto2.TestAllTypesProto2[] messages = - new TestMessagesProto2.TestAllTypesProto2[BinaryDecoder.values().length]; - InvalidProtocolBufferException[] exceptions = - new InvalidProtocolBufferException[BinaryDecoder.values().length]; + ArrayList messages = new ArrayList (); + ArrayList exceptions = + new ArrayList (); + + for (int i = 0; i < BinaryDecoderType.values().length; i++) { + messages.add(null); + exceptions.add(null); + } + BinaryDecoder decoder = new BinaryDecoder (); boolean hasMessage = false; boolean hasException = false; - for (int i = 0; i < BinaryDecoder.values().length; ++i) { + for (int i = 0; i < BinaryDecoderType.values().length; ++i) { try { - messages[i] = BinaryDecoder.values()[i].parseProto2(bytes); + //= BinaryDecoderType.values()[i].parseProto3(bytes); + messages.set(i, decoder.decode(bytes, BinaryDecoderType.values()[i], parser, extensions)); hasMessage = true; } catch (InvalidProtocolBufferException e) { - exceptions[i] = e; + exceptions.set(i, e); hasException = true; } } @@ -327,9 +157,9 @@ class ConformanceJava { if (hasMessage && hasException) { StringBuilder sb = new StringBuilder("Binary decoders disagreed on whether the payload was valid.\n"); - for (int i = 0; i < BinaryDecoder.values().length; ++i) { - sb.append(BinaryDecoder.values()[i].name()); - if (messages[i] != null) { + for (int i = 0; i < BinaryDecoderType.values().length; ++i) { + sb.append(BinaryDecoderType.values()[i].name()); + if (messages.get(i) != null) { sb.append(" accepted the payload.\n"); } else { sb.append(" rejected the payload.\n"); @@ -341,14 +171,14 @@ class ConformanceJava { if (hasException) { // We do not check if exceptions are equal. Different implementations may return different // exception messages. Throw an arbitrary one out instead. - throw exceptions[0]; + throw exceptions.get(0); } // Fast path comparing all the messages with the first message, assuming equality being // symmetric and transitive. boolean allEqual = true; - for (int i = 1; i < messages.length; ++i) { - if (!messages[0].equals(messages[i])) { + for (int i = 1; i < messages.size(); ++i) { + if (!messages.get(0).equals(messages.get(i))) { allEqual = false; break; } @@ -357,12 +187,12 @@ class ConformanceJava { // Slow path: compare and find out all unequal pairs. if (!allEqual) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < messages.length - 1; ++i) { - for (int j = i + 1; j < messages.length; ++j) { - if (!messages[i].equals(messages[j])) { - sb.append(BinaryDecoder.values()[i].name()) + for (int i = 0; i < messages.size() - 1; ++i) { + for (int j = i + 1; j < messages.size(); ++j) { + if (!messages.get(i).equals(messages.get(j))) { + sb.append(BinaryDecoderType.values()[i].name()) .append(" and ") - .append(BinaryDecoder.values()[j].name()) + .append(BinaryDecoderType.values()[j].name()) .append(" parsed the payload differently.\n"); } } @@ -370,25 +200,29 @@ class ConformanceJava { throw new RuntimeException(sb.toString()); } - return messages[0]; + return messages.get(0); } - private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { com.google.protobuf.AbstractMessage testMessage; - boolean isProto3 = request.getMessageType().equals("proto3"); + boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypes"); + boolean isProto2 = request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); switch (request.getPayloadCase()) { case PROTOBUF_PAYLOAD: { if (isProto3) { try { - testMessage = parseBinaryToProto3(request.getProtobufPayload()); + ExtensionRegistry extensions = ExtensionRegistry.newInstance(); + TestMessagesProto3.registerAllExtensions(extensions); + testMessage = parseBinary(request.getProtobufPayload(), TestAllTypes.parser(), extensions); } catch (InvalidProtocolBufferException e) { return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); } - } else if (request.getMessageType().equals("proto2")) { + } else if (isProto2) { try { - testMessage = parseBinaryToProto2(request.getProtobufPayload()); + ExtensionRegistry extensions = ExtensionRegistry.newInstance(); + TestMessagesProto2.registerAllExtensions(extensions); + testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto2.parser(), extensions); } catch (InvalidProtocolBufferException e) { return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); } diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index 7583c88dbd..1c251e512a 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -674,35 +674,37 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { void ConformanceTestSuite::TestValidDataForType( FieldDescriptor::Type type, - std::vector> values, bool isProto3) { - const string type_name = - UpperCase(string(".") + FieldDescriptor::TypeName(type)); - WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType( - static_cast(type)); - const FieldDescriptor* field = GetFieldForType(type, false, isProto3); - const FieldDescriptor* rep_field = GetFieldForType(type, true, isProto3); - - RunValidProtobufTest("ValidDataScalar" + type_name, REQUIRED, - cat(tag(field->number(), wire_type), values[0].first), - field->name() + ": " + values[0].second, isProto3); - - string proto; - string text = field->name() + ": " + values.back().second; - for (size_t i = 0; i < values.size(); i++) { - proto += cat(tag(field->number(), wire_type), values[i].first); - } - RunValidProtobufTest("RepeatedScalarSelectsLast" + type_name, REQUIRED, - proto, text, isProto3); + std::vector> values) { + for (int isProto3 = 0; isProto3 < 2; isProto3++) { + const string type_name = + UpperCase(string(".") + FieldDescriptor::TypeName(type)); + WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType( + static_cast(type)); + const FieldDescriptor* field = GetFieldForType(type, false, isProto3); + const FieldDescriptor* rep_field = GetFieldForType(type, true, isProto3); + + RunValidProtobufTest("ValidDataScalar" + type_name, REQUIRED, + cat(tag(field->number(), wire_type), values[0].first), + field->name() + ": " + values[0].second, isProto3); + + string proto; + string text = field->name() + ": " + values.back().second; + for (size_t i = 0; i < values.size(); i++) { + proto += cat(tag(field->number(), wire_type), values[i].first); + } + RunValidProtobufTest("RepeatedScalarSelectsLast" + type_name, REQUIRED, + proto, text, isProto3); - proto.clear(); - text.clear(); + proto.clear(); + text.clear(); - for (size_t i = 0; i < values.size(); i++) { - proto += cat(tag(rep_field->number(), wire_type), values[i].first); - text += rep_field->name() + ": " + values[i].second + " "; + for (size_t i = 0; i < values.size(); i++) { + proto += cat(tag(rep_field->number(), wire_type), values[i].first); + text += rep_field->name() + ": " + values[i].second + " "; + } + RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED, + proto, text, isProto3); } - RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED, - proto, text, isProto3); } void ConformanceTestSuite::SetFailureList(const string& filename, @@ -793,29 +795,23 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {dbl(0.1), "0.1"}, {dbl(1.7976931348623157e+308), "1.7976931348623157e+308"}, {dbl(2.22507385850720138309e-308), "2.22507385850720138309e-308"} - }, true); - TestValidDataForType(FieldDescriptor::TYPE_DOUBLE, { - {dbl(0.1), "0.1"}, - {dbl(1.7976931348623157e+308), "1.7976931348623157e+308"}, - {dbl(2.22507385850720138309e-308), "2.22507385850720138309e-308"} - }, false); - + }); TestValidDataForType(FieldDescriptor::TYPE_FLOAT, { {flt(0.1), "0.1"}, {flt(1.00000075e-36), "1.00000075e-36"}, {flt(3.402823e+38), "3.402823e+38"}, // 3.40282347e+38 {flt(1.17549435e-38f), "1.17549435e-38"} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_INT64, { {varint(12345), "12345"}, {varint(kInt64Max), std::to_string(kInt64Max)}, {varint(kInt64Min), std::to_string(kInt64Min)} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_UINT64, { {varint(12345), "12345"}, {varint(kUint64Max), std::to_string(kUint64Max)}, {varint(0), "0"} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_INT32, { {varint(12345), "12345"}, {longvarint(12345, 2), "12345"}, @@ -825,7 +821,7 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {varint(1LL << 33), std::to_string(static_cast(1LL << 33))}, {varint((1LL << 33) - 1), std::to_string(static_cast((1LL << 33) - 1))}, - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_UINT32, { {varint(12345), "12345"}, {longvarint(12345, 2), "12345"}, @@ -835,42 +831,42 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, {varint(1LL << 33), std::to_string(static_cast(1LL << 33))}, {varint((1LL << 33) - 1), std::to_string(static_cast((1LL << 33) - 1))}, - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_FIXED64, { {u64(12345), "12345"}, {u64(kUint64Max), std::to_string(kUint64Max)}, {u64(0), "0"} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_FIXED32, { {u32(12345), "12345"}, {u32(kUint32Max), std::to_string(kUint32Max)}, // UINT32_MAX {u32(0), "0"} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_SFIXED64, { {u64(12345), "12345"}, {u64(kInt64Max), std::to_string(kInt64Max)}, {u64(kInt64Min), std::to_string(kInt64Min)} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_SFIXED32, { {u32(12345), "12345"}, {u32(kInt32Max), std::to_string(kInt32Max)}, {u32(kInt32Min), std::to_string(kInt32Min)} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_BOOL, { {varint(1), "true"}, {varint(0), "false"}, {varint(12345678), "true"} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_SINT32, { {zz32(12345), "12345"}, {zz32(kInt32Max), std::to_string(kInt32Max)}, {zz32(kInt32Min), std::to_string(kInt32Min)} - }, true); + }); TestValidDataForType(FieldDescriptor::TYPE_SINT64, { {zz64(12345), "12345"}, {zz64(kInt64Max), std::to_string(kInt64Max)}, {zz64(kInt64Min), std::to_string(kInt64Min)} - }, true); + }); // TODO(haberman): // TestValidDataForType(FieldDescriptor::TYPE_STRING diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h index 6bfcd72f53..3e3ac6eb5e 100644 --- a/conformance/conformance_test.h +++ b/conformance/conformance_test.h @@ -210,8 +210,7 @@ class ConformanceTestSuite { void TestIllegalTags(); void TestValidDataForType( google::protobuf::FieldDescriptor::Type, - std::vector> values, - bool isProto3); + std::vector> values); bool CheckSetEmpty(const set& set_to_check, const std::string& write_to_file, const std::string& msg); ConformanceTestRunner* runner_; From a7d5be6a910caabc4b26d73bc5c369dbc638c4c3 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Thu, 29 Jun 2017 15:04:50 -0700 Subject: [PATCH 44/61] change php objc nodejs csharp ruby --- conformance/conformance_nodejs.js | 4 +-- conformance/conformance_objc.m | 4 +-- conformance/conformance_php.php | 4 +-- conformance/conformance_ruby.rb | 4 +-- .../Google.Protobuf.Conformance/Program.cs | 31 +++++++++---------- .../protobuf/test_messages_proto2.proto | 14 ++++----- 6 files changed, 30 insertions(+), 31 deletions(-) diff --git a/conformance/conformance_nodejs.js b/conformance/conformance_nodejs.js index 30294bf664..7ea392d1ad 100755 --- a/conformance/conformance_nodejs.js +++ b/conformance/conformance_nodejs.js @@ -50,7 +50,7 @@ function doTest(request) { switch (request.getPayloadCase()) { case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: { - if (request.getMessageType() == "proto3") { + if (request.getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") { try { testMessage = test_messages_proto3.TestAllTypes.deserializeBinary( request.getProtobufPayload()); @@ -58,7 +58,7 @@ function doTest(request) { response.setParseError(err.toString()); return response; } - } else if (request.getMessageType() == "proto2"){ + } else if (request.getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2"){ response.setSkipped("NodeJS doesn\'t support proto2"); return response; } else { diff --git a/conformance/conformance_objc.m b/conformance/conformance_objc.m index db3cc3e799..8bf1d4b83f 100644 --- a/conformance/conformance_objc.m +++ b/conformance/conformance_objc.m @@ -71,7 +71,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { break; case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { - if ([request.messageType isEqualToString:@"proto3"]) { + if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypes"]) { NSError *error = nil; testMessage = [TestAllTypes parseFromData:request.protobufPayload error:&error]; @@ -79,7 +79,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { response.parseError = [NSString stringWithFormat:@"Parse error: %@", error]; } - } else if ([request.messageType isEqualToString:@"proto2"]) { + } else if ([request.messageType isEqualToString:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) { response.skipped = @"ObjC doesn't support proto2"; break; } else { diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php index 848cb4c7a6..ca2292ad46 100755 --- a/conformance/conformance_php.php +++ b/conformance/conformance_php.php @@ -45,14 +45,14 @@ function doTest($request) $test_message = new \Protobuf_test_messages\Proto3\TestAllTypes(); $response = new \Conformance\ConformanceResponse(); if ($request->getPayload() == "protobuf_payload") { - if ($request->getMessageType() == "proto3") { + if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") { try { $test_message->mergeFromString($request->getProtobufPayload()); } catch (Exception $e) { $response->setParseError($e->getMessage()); return $response; } - } elseif ($request->getMessageType() == "proto2") { + } elseif ($request->getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2") { $response->setSkipped("PHP doesn't support proto2"); return $response; } else { diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index 552344b46b..0fd9e3f801 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -43,7 +43,7 @@ def do_test(request) begin case request.payload when :protobuf_payload - if request.message_type.eql?('proto3') + if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypes') begin test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( request.protobuf_payload) @@ -51,7 +51,7 @@ def do_test(request) response.parse_error = err.message.encode('utf-8') return response end - elsif request.message_type.eql?('proto2') + elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2') response.skipped = "Ruby doesn't support proto2" return response else diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 76b21e3986..2f30036cd1 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -91,22 +91,21 @@ namespace Google.Protobuf.Conformance message = parser.Parse(request.JsonPayload); break; case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - { - if (request.MessageType.Equals("proto3")) - { - message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); - } - else if (request.MessageType.Equals("proto2")) - { - - return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" }; - } - else - { - throw new Exception(" Protobuf request doesn't have specific payload type"); - } - break; - } + { + if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypes")) + { + message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); + } + else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) + { + return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" }; + } + else + { + throw new Exception(" Protobuf request doesn't have specific payload type"); + } + break; + } default: throw new Exception("Unsupported request payload: " + request.PayloadCase); } diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto index 0c072b0c28..58fb006022 100644 --- a/src/google/protobuf/test_messages_proto2.proto +++ b/src/google/protobuf/test_messages_proto2.proto @@ -181,21 +181,21 @@ message TestAllTypesProto2 { optional int32 Field_name18__ = 418; // message_set test case. - message mset_correct { + message MessageSetCorrect { option message_set_wire_format = true; extensions 4 to max; } - message mset_correct_extension1 { - extend mset_correct { - optional mset_correct_extension1 message_set_extension = 1547769; + message MessageSetCorrectExtension1 { + extend MessageSetCorrect { + optional MessageSetCorrectExtension1 message_set_extension = 1547769; } optional string str = 25; } - message mset_correct_extension2 { - extend mset_correct { - optional mset_correct_extension1 message_set_extension = 4135312; + message MessageSetCorrectExtension2 { + extend MessageSetCorrect { + optional MessageSetCorrectExtension2 message_set_extension = 4135312; } optional int32 i = 9; } From 3adb054bbfa83530ca5a5fd54a856755fd72af83 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Fri, 30 Jun 2017 17:22:32 -0700 Subject: [PATCH 45/61] add some test proto2 supported, add js proto2 supported, fixed some error --- conformance/ConformanceJava.java | 11 +- conformance/Makefile.am | 4 +- conformance/conformance_cpp.cc | 22 +- conformance/conformance_nodejs.js | 14 +- conformance/conformance_objc.m | 6 +- conformance/conformance_objc.m~ | 188 +++ conformance/conformance_php.php | 10 +- conformance/conformance_php.php~ | 119 ++ conformance/conformance_python.py | 9 +- conformance/conformance_ruby.rb | 8 +- conformance/conformance_ruby.rb~ | 131 ++ conformance/conformance_test.cc | 197 +-- conformance/conformance_test.h | 22 +- conformance/failure_list_cpp.txt | 75 +- conformance/failure_list_csharp.txt | 12 +- conformance/failure_list_java.txt | 74 +- conformance/failure_list_js.txt | 34 +- conformance/failure_list_php.txt | 1209 +++++++++-------- conformance/failure_list_php_c.txt | 441 +++--- conformance/failure_list_python.txt | 38 +- conformance/failure_list_python_cpp.txt | 74 +- conformance/failure_list_ruby.txt | 256 ++-- .../Google.Protobuf.Conformance/Program.cs | 10 +- .../protobuf/test_messages_proto2.proto | 2 +- .../protobuf/test_messages_proto3.proto | 6 +- 25 files changed, 1742 insertions(+), 1230 deletions(-) create mode 100644 conformance/conformance_objc.m~ create mode 100755 conformance/conformance_php.php~ create mode 100755 conformance/conformance_ruby.rb~ diff --git a/conformance/ConformanceJava.java b/conformance/ConformanceJava.java index 15aaed9635..596d113a92 100644 --- a/conformance/ConformanceJava.java +++ b/conformance/ConformanceJava.java @@ -5,7 +5,7 @@ import com.google.protobuf.CodedInputStream; import com.google.protobuf.conformance.Conformance; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf_test_messages.proto3.TestMessagesProto3; -import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypes; +import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypesProto3; import com.google.protobuf_test_messages.proto2.TestMessagesProto2; import com.google.protobuf_test_messages.proto2.TestMessagesProto2.TestAllTypesProto2; import com.google.protobuf.ExtensionRegistry; @@ -205,7 +205,7 @@ class ConformanceJava { private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { com.google.protobuf.AbstractMessage testMessage; - boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypes"); + boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3"); boolean isProto2 = request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); switch (request.getPayloadCase()) { @@ -214,7 +214,7 @@ class ConformanceJava { try { ExtensionRegistry extensions = ExtensionRegistry.newInstance(); TestMessagesProto3.registerAllExtensions(extensions); - testMessage = parseBinary(request.getProtobufPayload(), TestAllTypes.parser(), extensions); + testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto3.parser(), extensions); } catch (InvalidProtocolBufferException e) { return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); } @@ -233,7 +233,8 @@ class ConformanceJava { } case JSON_PAYLOAD: { try { - TestMessagesProto3.TestAllTypes.Builder builder = TestMessagesProto3.TestAllTypes.newBuilder(); + TestMessagesProto3.TestAllTypesProto3.Builder builder = + TestMessagesProto3.TestAllTypesProto3.newBuilder(); JsonFormat.parser().usingTypeRegistry(typeRegistry) .merge(request.getJsonPayload(), builder); testMessage = builder.build(); @@ -301,7 +302,7 @@ class ConformanceJava { public void run() throws Exception { typeRegistry = TypeRegistry.newBuilder().add( - TestMessagesProto3.TestAllTypes.getDescriptor()).build(); + TestMessagesProto3.TestAllTypesProto3.getDescriptor()).build(); while (doTestIo()) { this.testCount++; } diff --git a/conformance/Makefile.am b/conformance/Makefile.am index 268fc7e6b7..58eb7f5936 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -252,7 +252,7 @@ if USE_EXTERNAL_PROTOC # Some implementations include pre-generated versions of well-known types. protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:. $(conformance_protoc_inputs) - $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --python_out=. $(conformance_proto2_protoc_inputs) + $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs) $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:google-protobuf $(well_known_type_protoc_inputs) ## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) touch protoc_middleman @@ -264,7 +264,7 @@ else # building out-of-tree. protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --python_out=$$oldpwd $(conformance_proto2_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_proto2_protoc_inputs) ) oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd/google-protobuf $(well_known_type_protoc_inputs) ) ## @mkdir -p lite ## oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) ) diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc index 8d204dd2ef..bf70309a69 100644 --- a/conformance/conformance_cpp.cc +++ b/conformance/conformance_cpp.cc @@ -44,14 +44,14 @@ using conformance::ConformanceResponse; using google::protobuf::Descriptor; using google::protobuf::DescriptorPool; using google::protobuf::Message; +using google::protobuf::MessageFactory; using google::protobuf::internal::scoped_ptr; using google::protobuf::util::BinaryToJsonString; using google::protobuf::util::JsonToBinaryString; using google::protobuf::util::NewTypeResolverForDescriptorPool; using google::protobuf::util::Status; using google::protobuf::util::TypeResolver; -using protobuf_test_messages::proto3::TestAllTypes; -using protobuf_test_messages::proto2::TestAllTypesProto2; +using protobuf_test_messages::proto3::TestAllTypesProto3; using std::string; static const char kTypeUrlPrefix[] = "type.googleapis.com"; @@ -92,18 +92,12 @@ void CheckedWrite(int fd, const void *buf, size_t len) { void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { Message *test_message; - bool isProto3 = - request.message_type() == "protobuf_test_messages.proto3.TestAllTypes"; - bool isJson = request.payload_case() == ConformanceRequest::kJsonPayload; - bool isProto2 = - request.message_type() == "protobuf_test_messages.proto2.TestAllTypesProto2"; - if (isJson || isProto3) { - test_message = new TestAllTypes; - } else if (isProto2) { - test_message = new TestAllTypesProto2; - } else { - GOOGLE_LOG(FATAL) << "Protobuf request doesn't have specific payload type"; + const Descriptor *descriptor = DescriptorPool::generated_pool()->FindMessageTypeByName( + request.message_type()); + if (!descriptor) { + GOOGLE_LOG(FATAL) << "No such message type: " << request.message_type(); } + test_message = MessageFactory::generated_factory()->GetPrototype(descriptor)->New(); switch (request.payload_case()) { case ConformanceRequest::kProtobufPayload: { @@ -214,7 +208,7 @@ bool DoTestIo() { int main() { type_resolver = NewTypeResolverForDescriptorPool( kTypeUrlPrefix, DescriptorPool::generated_pool()); - type_url = new string(GetTypeUrl(TestAllTypes::descriptor())); + type_url = new string(GetTypeUrl(TestAllTypesProto3::descriptor())); while (1) { if (!DoTestIo()) { fprintf(stderr, "conformance-cpp: received EOF from test runner " diff --git a/conformance/conformance_nodejs.js b/conformance/conformance_nodejs.js index 7ea392d1ad..5d3955f77b 100755 --- a/conformance/conformance_nodejs.js +++ b/conformance/conformance_nodejs.js @@ -34,6 +34,7 @@ var conformance = require('conformance_pb'); var test_messages_proto3 = require('google/protobuf/test_messages_proto3_pb'); +var test_messages_proto2 = require('google/protobuf/test_messages_proto2_pb'); var fs = require('fs'); var testCount = 0; @@ -50,17 +51,22 @@ function doTest(request) { switch (request.getPayloadCase()) { case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: { - if (request.getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") { + if (request.getMessageType() == "protobuf_test_messages.proto3.TestAllTypesProto3") { try { - testMessage = test_messages_proto3.TestAllTypes.deserializeBinary( + testMessage = test_messages_proto3.TestAllTypesProto3.deserializeBinary( request.getProtobufPayload()); } catch (err) { response.setParseError(err.toString()); return response; } } else if (request.getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2"){ - response.setSkipped("NodeJS doesn\'t support proto2"); - return response; + try { + testMessage = test_messages_proto2.TestAllTypesProto2.deserializeBinary( + request.getProtobufPayload()); + } catch (err) { + response.setParseError(err.toString()); + return response; + } } else { throw "Protobuf request doesn\'t have specific payload type"; } diff --git a/conformance/conformance_objc.m b/conformance/conformance_objc.m index 8bf1d4b83f..ba1c946f33 100644 --- a/conformance/conformance_objc.m +++ b/conformance/conformance_objc.m @@ -63,7 +63,7 @@ static NSData *CheckedReadDataOfLength(NSFileHandle *handle, NSUInteger numBytes static ConformanceResponse *DoTest(ConformanceRequest *request) { ConformanceResponse *response = [ConformanceResponse message]; - TestAllTypes *testMessage = nil; + TestAllTypesProto3 *testMessage = nil; switch (request.payloadOneOfCase) { case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: @@ -71,9 +71,9 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { break; case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { - if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypes"]) { + if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) { NSError *error = nil; - testMessage = [TestAllTypes parseFromData:request.protobufPayload + testMessage = [TestAllTypesProto3 parseFromData:request.protobufPayload error:&error]; if (!testMessage) { response.parseError = diff --git a/conformance/conformance_objc.m~ b/conformance/conformance_objc.m~ new file mode 100644 index 0000000000..ba1c946f33 --- /dev/null +++ b/conformance/conformance_objc.m~ @@ -0,0 +1,188 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import + +#import "Conformance.pbobjc.h" +#import "google/protobuf/TestMessagesProto3.pbobjc.h" + +static void Die(NSString *format, ...) __dead2; + +static BOOL verbose = NO; +static int32_t testCount = 0; + +static void Die(NSString *format, ...) { + va_list args; + va_start(args, format); + NSString *msg = [[NSString alloc] initWithFormat:format arguments:args]; + NSLog(@"%@", msg); + va_end(args); + [msg release]; + exit(66); +} + +static NSData *CheckedReadDataOfLength(NSFileHandle *handle, NSUInteger numBytes) { + NSData *data = [handle readDataOfLength:numBytes]; + NSUInteger dataLen = data.length; + if (dataLen == 0) { + return nil; // EOF. + } + if (dataLen != numBytes) { + Die(@"Failed to read the request length (%d), only got: %@", + numBytes, data); + } + return data; +} + +static ConformanceResponse *DoTest(ConformanceRequest *request) { + ConformanceResponse *response = [ConformanceResponse message]; + TestAllTypesProto3 *testMessage = nil; + + switch (request.payloadOneOfCase) { + case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: + Die(@"Request didn't have a payload: %@", request); + break; + + case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { + if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) { + NSError *error = nil; + testMessage = [TestAllTypesProto3 parseFromData:request.protobufPayload + error:&error]; + if (!testMessage) { + response.parseError = + [NSString stringWithFormat:@"Parse error: %@", error]; + } + } else if ([request.messageType isEqualToString:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) { + response.skipped = @"ObjC doesn't support proto2"; + break; + } else { + Die(@"Protobuf request doesn't have specific payload type"); + break; + } + break; + } + + case ConformanceRequest_Payload_OneOfCase_JsonPayload: + response.skipped = @"ObjC doesn't support parsing JSON"; + break; + } + + if (testMessage) { + switch (request.requestedOutputFormat) { + case WireFormat_GPBUnrecognizedEnumeratorValue: + case WireFormat_Unspecified: + Die(@"Unrecognized/unspecified output format: %@", request); + break; + + case WireFormat_Protobuf: + response.protobufPayload = testMessage.data; + if (!response.protobufPayload) { + response.serializeError = + [NSString stringWithFormat:@"Failed to make data from: %@", testMessage]; + } + break; + + case WireFormat_Json: + response.skipped = @"ObjC doesn't support generating JSON"; + break; + } + } + + return response; +} + +static uint32_t UInt32FromLittleEndianData(NSData *data) { + if (data.length != sizeof(uint32_t)) { + Die(@"Data not the right size for uint32_t: %@", data); + } + uint32_t value; + memcpy(&value, data.bytes, sizeof(uint32_t)); + return CFSwapInt32LittleToHost(value); +} + +static NSData *UInt32ToLittleEndianData(uint32_t num) { + uint32_t value = CFSwapInt32HostToLittle(num); + return [NSData dataWithBytes:&value length:sizeof(uint32_t)]; +} + +static BOOL DoTestIo(NSFileHandle *input, NSFileHandle *output) { + // See conformance_test_runner.cc for the wire format. + NSData *data = CheckedReadDataOfLength(input, sizeof(uint32_t)); + if (!data) { + // EOF. + return NO; + } + uint32_t numBytes = UInt32FromLittleEndianData(data); + data = CheckedReadDataOfLength(input, numBytes); + if (!data) { + Die(@"Failed to read request"); + } + + NSError *error = nil; + ConformanceRequest *request = [ConformanceRequest parseFromData:data + error:&error]; + if (!request) { + Die(@"Failed to parse the message data: %@", error); + } + + ConformanceResponse *response = DoTest(request); + if (!response) { + Die(@"Failed to make a reply from %@", request); + } + + data = response.data; + [output writeData:UInt32ToLittleEndianData((int32_t)data.length)]; + [output writeData:data]; + + if (verbose) { + NSLog(@"Request: %@", request); + NSLog(@"Response: %@", response); + } + + ++testCount; + return YES; +} + +int main(int argc, const char *argv[]) { + @autoreleasepool { + NSFileHandle *input = [[NSFileHandle fileHandleWithStandardInput] retain]; + NSFileHandle *output = [[NSFileHandle fileHandleWithStandardOutput] retain]; + + BOOL notDone = YES; + while (notDone) { + @autoreleasepool { + notDone = DoTestIo(input, output); + } + } + + NSLog(@"Received EOF from test runner after %d tests, exiting.", testCount); + } + return 0; +} diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php index ca2292ad46..c1bd9bedec 100755 --- a/conformance/conformance_php.php +++ b/conformance/conformance_php.php @@ -23,9 +23,9 @@ require_once("Google/Protobuf/StringValue.php"); require_once("Google/Protobuf/UInt64Value.php"); require_once("Protobuf_test_messages/Proto3/ForeignMessage.php"); require_once("Protobuf_test_messages/Proto3/ForeignEnum.php"); -require_once("Protobuf_test_messages/Proto3/TestAllTypes.php"); -require_once("Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php"); -require_once("Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php"); +require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3.php"); +require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3_NestedMessage.php"); +require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3_NestedEnum.php"); require_once("GPBMetadata/Conformance.php"); require_once("GPBMetadata/Google/Protobuf/Any.php"); @@ -42,10 +42,10 @@ $test_count = 0; function doTest($request) { - $test_message = new \Protobuf_test_messages\Proto3\TestAllTypes(); + $test_message = new \Protobuf_test_messages\Proto3\TestAllTypesProto3(); $response = new \Conformance\ConformanceResponse(); if ($request->getPayload() == "protobuf_payload") { - if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") { + if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypesProto3") { try { $test_message->mergeFromString($request->getProtobufPayload()); } catch (Exception $e) { diff --git a/conformance/conformance_php.php~ b/conformance/conformance_php.php~ new file mode 100755 index 0000000000..ca2292ad46 --- /dev/null +++ b/conformance/conformance_php.php~ @@ -0,0 +1,119 @@ +getPayload() == "protobuf_payload") { + if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") { + try { + $test_message->mergeFromString($request->getProtobufPayload()); + } catch (Exception $e) { + $response->setParseError($e->getMessage()); + return $response; + } + } elseif ($request->getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2") { + $response->setSkipped("PHP doesn't support proto2"); + return $response; + } else { + trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR); + } + } elseif ($request->getPayload() == "json_payload") { + try { + $test_message->jsonDecode($request->getJsonPayload()); + } catch (Exception $e) { + $response->setParseError($e->getMessage()); + return $response; + } + } else { + trigger_error("Request didn't have payload.", E_USER_ERROR); + } + + if ($request->getRequestedOutputFormat() == WireFormat::UNSPECIFIED) { + trigger_error("Unspecified output format.", E_USER_ERROR); + } elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) { + $response->setProtobufPayload($test_message->serializeToString()); + } elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) { + $response->setJsonPayload($test_message->jsonEncode()); + } + + return $response; +} + +function doTestIO() +{ + $length_bytes = fread(STDIN, 4); + if (strlen($length_bytes) == 0) { + return false; # EOF + } elseif (strlen($length_bytes) != 4) { + trigger_error("I/O error", E_USER_ERROR); + } + + $length = unpack("V", $length_bytes)[1]; + $serialized_request = fread(STDIN, $length); + if (strlen($serialized_request) != $length) { + trigger_error("I/O error", E_USER_ERROR); + } + + $request = new \Conformance\ConformanceRequest(); + $request->mergeFromString($serialized_request); + + $response = doTest($request); + + $serialized_response = $response->serializeToString(); + fwrite(STDOUT, pack("V", strlen($serialized_response))); + fwrite(STDOUT, $serialized_response); + + $GLOBALS['test_count'] += 1; + + return true; +} + +while(true){ + if (!doTestIO()) { + fprintf(STDERR, + "conformance_php: received EOF from test runner " + + "after %d tests, exiting\n", $test_count); + exit; + } +} diff --git a/conformance/conformance_python.py b/conformance/conformance_python.py index 62cfce87bb..c5ba2467a6 100755 --- a/conformance/conformance_python.py +++ b/conformance/conformance_python.py @@ -38,6 +38,8 @@ See conformance.proto for more information. import struct import sys import os +from google.protobuf import descriptor +from google.protobuf import descriptor_pool from google.protobuf import json_format from google.protobuf import message from google.protobuf import test_messages_proto3_pb2 @@ -54,15 +56,16 @@ class ProtocolError(Exception): pass def do_test(request): - isProto3 = (request.message_type == "protobuf_test_messages.proto3.TestAllTypes") + isProto3 = (request.message_type == "protobuf_test_messages.proto3.TestAllTypesProto3") isJson = (request.WhichOneof('payload') == 'json_payload') isProto2 = (request.message_type == "protobuf_test_messages.proto2.TestAllTypesProto2") if (not isProto3) and (not isJson) and (not isProto2): raise ProtocolError("Protobuf request doesn't have specific payload type") - + test_message = test_messages_proto2_pb2.TestAllTypesProto2() if isProto2 else \ - test_messages_proto3_pb2.TestAllTypes() + test_messages_proto3_pb2.TestAllTypesProto3() + response = conformance_pb2.ConformanceResponse() try: diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index 0fd9e3f801..df63bf7ced 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -37,15 +37,15 @@ $test_count = 0 $verbose = false def do_test(request) - test_message = ProtobufTestMessages::Proto3::TestAllTypes.new + test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.new response = Conformance::ConformanceResponse.new begin case request.payload when :protobuf_payload - if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypes') + if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypesProto3') begin - test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( + test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode( request.protobuf_payload) rescue Google::Protobuf::ParseError => err response.parse_error = err.message.encode('utf-8') @@ -60,7 +60,7 @@ def do_test(request) when :json_payload begin - test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode_json( + test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode_json( request.json_payload) rescue Google::Protobuf::ParseError => err response.parse_error = err.message.encode('utf-8') diff --git a/conformance/conformance_ruby.rb~ b/conformance/conformance_ruby.rb~ new file mode 100755 index 0000000000..df63bf7ced --- /dev/null +++ b/conformance/conformance_ruby.rb~ @@ -0,0 +1,131 @@ +#!/usr/bin/env ruby +# +# Protocol Buffers - Google's data interchange format +# Copyright 2008 Google Inc. All rights reserved. +# https://developers.google.com/protocol-buffers/ +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +require 'conformance_pb' +require 'google/protobuf/test_messages_proto3_pb' + +$test_count = 0 +$verbose = false + +def do_test(request) + test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.new + response = Conformance::ConformanceResponse.new + + begin + case request.payload + when :protobuf_payload + if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypesProto3') + begin + test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode( + request.protobuf_payload) + rescue Google::Protobuf::ParseError => err + response.parse_error = err.message.encode('utf-8') + return response + end + elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2') + response.skipped = "Ruby doesn't support proto2" + return response + else + fail "Protobuf request doesn't have specific payload type" + end + + when :json_payload + begin + test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.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" + end + + case request.requested_output_format + when :UNSPECIFIED + fail 'Unspecified output format' + + when :PROTOBUF + response.protobuf_payload = test_message.to_proto + + 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') + end + + response +end + +# Returns true if the test ran successfully, false on legitimate EOF. +# If EOF is encountered in an unexpected place, raises IOError. +def do_test_io + length_bytes = STDIN.read(4) + return false if length_bytes.nil? + + length = length_bytes.unpack('V').first + serialized_request = STDIN.read(length) + if serialized_request.nil? || serialized_request.length != length + fail IOError + end + + request = Conformance::ConformanceRequest.decode(serialized_request) + + response = do_test(request) + + serialized_response = Conformance::ConformanceResponse.encode(response) + STDOUT.write([serialized_response.length].pack('V')) + STDOUT.write(serialized_response) + STDOUT.flush + + if $verbose + STDERR.puts("conformance_ruby: request=#{request.to_json}, " \ + "response=#{response.to_json}\n") + end + + $test_count += 1 + + true +end + +loop do + unless do_test_io + STDERR.puts('conformance_ruby: received EOF from test runner ' \ + "after #{$test_count} tests, exiting") + break + end +end diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index 1c251e512a..d7b81a5faa 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -60,7 +60,7 @@ using google::protobuf::util::JsonToBinaryString; using google::protobuf::util::MessageDifferencer; using google::protobuf::util::NewTypeResolverForDescriptorPool; using google::protobuf::util::Status; -using protobuf_test_messages::proto3::TestAllTypes; +using protobuf_test_messages::proto3::TestAllTypesProto3; using protobuf_test_messages::proto2::TestAllTypesProto2; using std::string; @@ -168,7 +168,7 @@ const FieldDescriptor* GetFieldForType(FieldDescriptor::Type type, bool repeated, bool isProto3) { const Descriptor* d = isProto3 ? - TestAllTypes().GetDescriptor() : TestAllTypesProto2().GetDescriptor(); + TestAllTypesProto3().GetDescriptor() : TestAllTypesProto2().GetDescriptor(); for (int i = 0; i < d->field_count(); i++) { const FieldDescriptor* f = d->field(i); if (f->type() == type && f->is_repeated() == repeated) { @@ -279,7 +279,7 @@ void ConformanceTestSuite::RunValidInputTest( auto newTestMessage = [&isProto3]() { Message* newMessage; if (isProto3) { - newMessage = new TestAllTypes; + newMessage = new TestAllTypesProto3; } else { newMessage = new TestAllTypesProto2; } @@ -298,16 +298,18 @@ void ConformanceTestSuite::RunValidInputTest( case conformance::PROTOBUF: { request.set_protobuf_payload(input); if (isProto3) { - request.set_message_type("protobuf_test_messages.proto3.TestAllTypes"); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3"); } else { request.set_message_type("protobuf_test_messages.proto2.TestAllTypesProto2"); } break; } - case conformance::JSON: + case conformance::JSON: { + request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3"); request.set_json_payload(input); break; + } default: GOOGLE_LOG(FATAL) << "Unspecified input format"; @@ -402,20 +404,19 @@ void ConformanceTestSuite::RunValidInputTest( differences.c_str()); } } - -// Expect that this precise protobuf will cause a parse error. -void ConformanceTestSuite::ExpectParseFailureForProto( +void ConformanceTestSuite::ExpectParseFailureForProtoWithProtoVersion ( const string& proto, const string& test_name, ConformanceLevel level, bool isProto3) { ConformanceRequest request; ConformanceResponse response; request.set_protobuf_payload(proto); if (isProto3) { - request.set_message_type("protobuf_test_messages.proto3.TestAllTypes"); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3"); } else { request.set_message_type("protobuf_test_messages.proto2.TestAllTypesProto2"); } string effective_test_name = ConformanceLevelToString(level) + + (isProto3 ? ".Proto3" : ".Proto2") + ".ProtobufInput." + test_name; // We don't expect output, but if the program erroneously accepts the protobuf @@ -433,61 +434,69 @@ void ConformanceTestSuite::ExpectParseFailureForProto( } } +// Expect that this precise protobuf will cause a parse error. +void ConformanceTestSuite::ExpectParseFailureForProto( + const string& proto, const string& test_name, ConformanceLevel level) { + ExpectParseFailureForProtoWithProtoVersion(proto, test_name, level, true); + ExpectParseFailureForProtoWithProtoVersion(proto, test_name, level, false); +} + // Expect that this protobuf will cause a parse error, even if it is followed // by valid protobuf data. We can try running this twice: once with this // data verbatim and once with this data followed by some valid data. // // TODO(haberman): implement the second of these. void ConformanceTestSuite::ExpectHardParseFailureForProto( - const string& proto, const string& test_name, ConformanceLevel level, - bool isProto3) { - return ExpectParseFailureForProto(proto, test_name, level, isProto3); + const string& proto, const string& test_name, ConformanceLevel level) { + return ExpectParseFailureForProto(proto, test_name, level); } void ConformanceTestSuite::RunValidJsonTest( const string& test_name, ConformanceLevel level, const string& input_json, const string& equivalent_text_format) { RunValidInputTest( - ConformanceLevelToString(level) + ".JsonInput." + test_name + + ConformanceLevelToString(level) + ".Proto3.JsonInput." + test_name + ".ProtobufOutput", level, input_json, conformance::JSON, equivalent_text_format, conformance::PROTOBUF, true); RunValidInputTest( - ConformanceLevelToString(level) + ".JsonInput." + test_name + + ConformanceLevelToString(level) + ".Proto3.JsonInput." + test_name + ".JsonOutput", level, input_json, conformance::JSON, equivalent_text_format, conformance::JSON, true); } void ConformanceTestSuite::RunValidJsonTestWithProtobufInput( - const string& test_name, ConformanceLevel level, const TestAllTypes& input, - const string& equivalent_text_format, bool isProto3) { + const string& test_name, ConformanceLevel level, const TestAllTypesProto3& input, + const string& equivalent_text_format) { RunValidInputTest( - ConformanceLevelToString(level) + ".ProtobufInput." + test_name + + ConformanceLevelToString(level) + ".Proto3" + ".ProtobufInput." + test_name + ".JsonOutput", level, input.SerializeAsString(), conformance::PROTOBUF, - equivalent_text_format, conformance::JSON, isProto3); + equivalent_text_format, conformance::JSON, true); } void ConformanceTestSuite::RunValidProtobufTest( const string& test_name, ConformanceLevel level, const string& input_protobuf, const string& equivalent_text_format, bool isProto3) { - string rname = ".ProtobufInput."; + string rname = ".Proto3"; if (!isProto3) { - rname = ".Protobuf2Input."; + rname = ".Proto2"; } RunValidInputTest( - ConformanceLevelToString(level) + rname + test_name + + ConformanceLevelToString(level) + rname + ".ProtobufInput." + test_name + ".ProtobufOutput", level, input_protobuf, conformance::PROTOBUF, equivalent_text_format, conformance::PROTOBUF, isProto3); - RunValidInputTest( - ConformanceLevelToString(level) + rname + test_name + - ".JsonOutput", level, input_protobuf, conformance::PROTOBUF, - equivalent_text_format, conformance::JSON, isProto3); + if (isProto3) { + RunValidInputTest( + ConformanceLevelToString(level) + rname + ".ProtobufInput." + test_name + + ".JsonOutput", level, input_protobuf, conformance::PROTOBUF, + equivalent_text_format, conformance::JSON, isProto3); + } } void ConformanceTestSuite::RunValidProtobufTestWithMessage( - const string& test_name, ConformanceLevel level, const TestAllTypes& input, + const string& test_name, ConformanceLevel level, const Message *input, const string& equivalent_text_format, bool isProto3) { - RunValidProtobufTest(test_name, level, input.SerializeAsString(), equivalent_text_format, isProto3); + RunValidProtobufTest(test_name, level, input->SerializeAsString(), equivalent_text_format, isProto3); } // According to proto3 JSON specification, JSON serializers follow more strict @@ -502,9 +511,10 @@ void ConformanceTestSuite::RunValidJsonTestWithValidator( ConformanceResponse response; request.set_json_payload(input_json); request.set_requested_output_format(conformance::JSON); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3"); string effective_test_name = ConformanceLevelToString(level) + - ".JsonInput." + test_name + ".Validator"; + ".Proto3.JsonInput." + test_name + ".Validator"; RunTest(effective_test_name, request, &response); @@ -540,8 +550,9 @@ void ConformanceTestSuite::ExpectParseFailureForJson( ConformanceRequest request; ConformanceResponse response; request.set_json_payload(input_json); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3"); string effective_test_name = - ConformanceLevelToString(level) + ".JsonInput." + test_name; + ConformanceLevelToString(level) + ".Proto3.JsonInput." + test_name; // 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. @@ -560,7 +571,7 @@ void ConformanceTestSuite::ExpectParseFailureForJson( void ConformanceTestSuite::ExpectSerializeFailureForJson( const string& test_name, ConformanceLevel level, const string& text_format) { - TestAllTypes payload_message; + TestAllTypesProto3 payload_message; GOOGLE_CHECK( TextFormat::ParseFromString(text_format, &payload_message)) << "Failed to parse: " << text_format; @@ -568,7 +579,7 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson( ConformanceRequest request; ConformanceResponse response; request.set_protobuf_payload(payload_message.SerializeAsString()); - request.set_message_type("protobuf_test_messages.proto3.TestAllTypes"); + request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3"); string effective_test_name = ConformanceLevelToString(level) + "." + test_name + ".JsonOutput"; request.set_requested_output_format(conformance::JSON); @@ -606,43 +617,43 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { ExpectParseFailureForProto( tag(field->number(), wire_type), - "PrematureEofBeforeKnownNonRepeatedValue" + type_name, REQUIRED, true); + "PrematureEofBeforeKnownNonRepeatedValue" + type_name, REQUIRED); ExpectParseFailureForProto( tag(rep_field->number(), wire_type), - "PrematureEofBeforeKnownRepeatedValue" + type_name, REQUIRED, true); + "PrematureEofBeforeKnownRepeatedValue" + type_name, REQUIRED); ExpectParseFailureForProto( tag(UNKNOWN_FIELD, wire_type), - "PrematureEofBeforeUnknownValue" + type_name, REQUIRED, true); + "PrematureEofBeforeUnknownValue" + type_name, REQUIRED); ExpectParseFailureForProto( cat( tag(field->number(), wire_type), incomplete ), - "PrematureEofInsideKnownNonRepeatedValue" + type_name, REQUIRED, true); + "PrematureEofInsideKnownNonRepeatedValue" + type_name, REQUIRED); ExpectParseFailureForProto( cat( tag(rep_field->number(), wire_type), incomplete ), - "PrematureEofInsideKnownRepeatedValue" + type_name, REQUIRED, true); + "PrematureEofInsideKnownRepeatedValue" + type_name, REQUIRED); ExpectParseFailureForProto( cat( tag(UNKNOWN_FIELD, wire_type), incomplete ), - "PrematureEofInsideUnknownValue" + type_name, REQUIRED, true); + "PrematureEofInsideUnknownValue" + type_name, REQUIRED); if (wire_type == WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { ExpectParseFailureForProto( cat( tag(field->number(), wire_type), varint(1) ), "PrematureEofInDelimitedDataForKnownNonRepeatedValue" + type_name, - REQUIRED, true); + REQUIRED); ExpectParseFailureForProto( cat( tag(rep_field->number(), wire_type), varint(1) ), "PrematureEofInDelimitedDataForKnownRepeatedValue" + type_name, - REQUIRED, true); + REQUIRED); // EOF in the middle of delimited data for unknown value. ExpectParseFailureForProto( cat( tag(UNKNOWN_FIELD, wire_type), varint(1) ), - "PrematureEofInDelimitedDataForUnknownValue" + type_name, REQUIRED, true); + "PrematureEofInDelimitedDataForUnknownValue" + type_name, REQUIRED); if (type == FieldDescriptor::TYPE_MESSAGE) { // Submessage ends in the middle of a value. @@ -653,7 +664,7 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { cat( tag(field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED), varint(incomplete_submsg.size()), incomplete_submsg ), - "PrematureEofInSubmessageValue" + type_name, REQUIRED, true); + "PrematureEofInSubmessageValue" + type_name, REQUIRED); } } else if (type != FieldDescriptor::TYPE_GROUP) { // Non-delimited, non-group: eligible for packing. @@ -662,13 +673,13 @@ void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) { ExpectHardParseFailureForProto( cat(tag(rep_field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED), varint(incomplete.size()), incomplete), - "PrematureEofInPackedFieldValue" + type_name, REQUIRED, true); + "PrematureEofInPackedFieldValue" + type_name, REQUIRED); // EOF in the middle of packed region. ExpectParseFailureForProto( cat(tag(rep_field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED), varint(1)), - "PrematureEofInPackedField" + type_name, REQUIRED, true); + "PrematureEofInPackedField" + type_name, REQUIRED); } } @@ -758,9 +769,47 @@ void ConformanceTestSuite::TestIllegalTags() { for (int i = 0; i < 4; i++) { string name = "IllegalZeroFieldNum_Case_0"; name.back() += i; - ExpectParseFailureForProto(nullfield[i], name, REQUIRED, true); + ExpectParseFailureForProto(nullfield[i], name, REQUIRED); } } +template +void ConformanceTestSuite::TestOneofMessage (MessageType &message, + bool isProto3) { + message.set_oneof_uint32(0); + RunValidProtobufTestWithMessage( + "OneofZeroUint32", RECOMMENDED, &message, "oneof_uint32: 0", isProto3); + message.mutable_oneof_nested_message()->set_a(0); + RunValidProtobufTestWithMessage( + "OneofZeroMessage", RECOMMENDED, &message, + isProto3 ? "oneof_nested_message: {}" : "oneof_nested_message: {a: 0}", + isProto3); + message.mutable_oneof_nested_message()->set_a(1); + RunValidProtobufTestWithMessage( + "OneofZeroMessageSetTwice", RECOMMENDED, &message, + "oneof_nested_message: {a: 1}", + isProto3); + message.set_oneof_string(""); + RunValidProtobufTestWithMessage( + "OneofZeroString", RECOMMENDED, &message, "oneof_string: \"\"", isProto3); + message.set_oneof_bytes(""); + RunValidProtobufTestWithMessage( + "OneofZeroBytes", RECOMMENDED, &message, "oneof_bytes: \"\"", isProto3); + message.set_oneof_bool(false); + RunValidProtobufTestWithMessage( + "OneofZeroBool", RECOMMENDED, &message, "oneof_bool: false", isProto3); + message.set_oneof_uint64(0); + RunValidProtobufTestWithMessage( + "OneofZeroUint64", RECOMMENDED, &message, "oneof_uint64: 0", isProto3); + message.set_oneof_float(0.0f); + RunValidProtobufTestWithMessage( + "OneofZeroFloat", RECOMMENDED, &message, "oneof_float: 0", isProto3); + message.set_oneof_double(0.0); + RunValidProtobufTestWithMessage( + "OneofZeroDouble", RECOMMENDED, &message, "oneof_double: 0", isProto3); + message.set_oneof_enum(MessageType::FOO); + RunValidProtobufTestWithMessage( + "OneofZeroEnum", RECOMMENDED, &message, "oneof_enum: FOO", isProto3); +} bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, std::string* output) { @@ -773,7 +822,7 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, unexpected_succeeding_tests_.clear(); type_resolver_.reset(NewTypeResolverForDescriptorPool( kTypeUrlPrefix, DescriptorPool::generated_pool())); - type_url_ = GetTypeUrl(TestAllTypes::descriptor()); + type_url_ = GetTypeUrl(TestAllTypesProto3::descriptor()); output_ = "\nCONFORMANCE TEST BEGIN ====================================\n\n"; @@ -1369,21 +1418,21 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, "optional_float: -inf"); // Non-cannonical Nan will be correctly normalized. { - TestAllTypes message; + TestAllTypesProto3 message; // IEEE floating-point standard 32-bit quiet NaN: // 0111 1111 1xxx xxxx xxxx xxxx xxxx xxxx message.set_optional_float( WireFormatLite::DecodeFloat(0x7FA12345)); RunValidJsonTestWithProtobufInput( "FloatFieldNormalizeQuietNan", REQUIRED, message, - "optional_float: nan", true); + "optional_float: nan"); // IEEE floating-point standard 64-bit signaling NaN: // 1111 1111 1xxx xxxx xxxx xxxx xxxx xxxx message.set_optional_float( WireFormatLite::DecodeFloat(0xFFB54321)); RunValidJsonTestWithProtobufInput( "FloatFieldNormalizeSignalingNan", REQUIRED, message, - "optional_float: nan", true); + "optional_float: nan"); } // Special values must be quoted. @@ -1441,17 +1490,17 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, "optional_double: -inf"); // Non-cannonical Nan will be correctly normalized. { - TestAllTypes message; + TestAllTypesProto3 message; message.set_optional_double( WireFormatLite::DecodeDouble(0x7FFA123456789ABCLL)); RunValidJsonTestWithProtobufInput( "DoubleFieldNormalizeQuietNan", REQUIRED, message, - "optional_double: nan", true); + "optional_double: nan"); message.set_optional_double( WireFormatLite::DecodeDouble(0xFFFBCBA987654321LL)); RunValidJsonTestWithProtobufInput( "DoubleFieldNormalizeSignalingNan", REQUIRED, message, - "optional_double: nan", true); + "optional_double: nan"); } // Special values must be quoted. @@ -1571,36 +1620,10 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, "OneofFieldDuplicate", REQUIRED, R"({"oneofUint32": 1, "oneofString": "test"})"); // Ensure zero values for oneof make it out/backs. - { - TestAllTypes message; - message.set_oneof_uint32(0); - RunValidProtobufTestWithMessage( - "OneofZeroUint32", RECOMMENDED, message, "oneof_uint32: 0", true); - message.mutable_oneof_nested_message()->set_a(0); - RunValidProtobufTestWithMessage( - "OneofZeroMessage", RECOMMENDED, message, "oneof_nested_message: {}", true); - message.set_oneof_string(""); - RunValidProtobufTestWithMessage( - "OneofZeroString", RECOMMENDED, message, "oneof_string: \"\"", true); - message.set_oneof_bytes(""); - RunValidProtobufTestWithMessage( - "OneofZeroBytes", RECOMMENDED, message, "oneof_bytes: \"\"", true); - message.set_oneof_bool(false); - RunValidProtobufTestWithMessage( - "OneofZeroBool", RECOMMENDED, message, "oneof_bool: false", true); - message.set_oneof_uint64(0); - RunValidProtobufTestWithMessage( - "OneofZeroUint64", RECOMMENDED, message, "oneof_uint64: 0", true); - message.set_oneof_float(0.0f); - RunValidProtobufTestWithMessage( - "OneofZeroFloat", RECOMMENDED, message, "oneof_float: 0", true); - message.set_oneof_double(0.0); - RunValidProtobufTestWithMessage( - "OneofZeroDouble", RECOMMENDED, message, "oneof_double: 0", true); - message.set_oneof_enum(TestAllTypes::FOO); - RunValidProtobufTestWithMessage( - "OneofZeroEnum", RECOMMENDED, message, "oneof_enum: FOO", true); - } + TestAllTypesProto3 messageProto3; + TestAllTypesProto2 messageProto2; + TestOneofMessage(messageProto3, true); + TestOneofMessage(messageProto2, false); RunValidJsonTest( "OneofZeroUint32", RECOMMENDED, R"({"oneofUint32": 0})", "oneof_uint32: 0"); @@ -2242,13 +2265,13 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, "Any", REQUIRED, R"({ "optionalAny": { - "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypes", + "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3", "optionalInt32": 12345 } })", R"( optional_any: { - [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypes] { + [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3] { optional_int32: 12345 } } @@ -2259,7 +2282,7 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, "optionalAny": { "@type": "type.googleapis.com/google.protobuf.Any", "value": { - "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypes", + "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3", "optionalInt32": 12345 } } @@ -2267,7 +2290,7 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, R"( optional_any: { [type.googleapis.com/google.protobuf.Any] { - [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypes] { + [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3] { optional_int32: 12345 } } @@ -2279,12 +2302,12 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, R"({ "optionalAny": { "optionalInt32": 12345, - "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypes" + "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3" } })", R"( optional_any: { - [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypes] { + [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3] { optional_int32: 12345 } } diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h index 3e3ac6eb5e..6eeea8b67d 100644 --- a/conformance/conformance_test.h +++ b/conformance/conformance_test.h @@ -53,7 +53,7 @@ class ConformanceResponse; namespace protobuf_test_messages { namespace proto3 { -class TestAllTypes; +class TestAllTypesProto3; } // namespace proto3 } // namespace protobuf_test_messages @@ -174,16 +174,15 @@ class ConformanceTestSuite { void RunValidJsonTestWithProtobufInput( const string& test_name, ConformanceLevel level, - const protobuf_test_messages::proto3::TestAllTypes& input, - const string& equivalent_text_format, - bool isProto3); + const protobuf_test_messages::proto3::TestAllTypesProto3& input, + const string& equivalent_text_format); void RunValidProtobufTest(const string& test_name, ConformanceLevel level, const string& input_protobuf, const string& equivalent_text_format, bool isProto3); void RunValidProtobufTestWithMessage( const string& test_name, ConformanceLevel level, - const protobuf_test_messages::proto3::TestAllTypes& input, + const Message *input, const string& equivalent_text_format, bool isProto3); @@ -198,16 +197,21 @@ class ConformanceTestSuite { void ExpectSerializeFailureForJson(const string& test_name, ConformanceLevel level, const string& text_format); + void ExpectParseFailureForProtoWithProtoVersion (const string& proto, + const string& test_name, + ConformanceLevel level, + bool isProto3); void ExpectParseFailureForProto(const std::string& proto, const std::string& test_name, - ConformanceLevel level, - bool isProto3); + ConformanceLevel level); void ExpectHardParseFailureForProto(const std::string& proto, const std::string& test_name, - ConformanceLevel level, - bool isProto3); + ConformanceLevel level); void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type); void TestIllegalTags(); + template + void TestOneofMessage (MessageType &message, + bool isProto3); void TestValidDataForType( google::protobuf::FieldDescriptor::Type, std::vector> values); diff --git a/conformance/failure_list_cpp.txt b/conformance/failure_list_cpp.txt index 8a4fa7eb11..c8b0fecf5e 100644 --- a/conformance/failure_list_cpp.txt +++ b/conformance/failure_list_cpp.txt @@ -10,35 +10,46 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.BoolFieldDoubleQuotedFalse -Recommended.JsonInput.BoolFieldDoubleQuotedTrue -Recommended.JsonInput.FieldMaskInvalidCharacter -Recommended.JsonInput.FieldNameDuplicate -Recommended.JsonInput.FieldNameDuplicateDifferentCasing1 -Recommended.JsonInput.FieldNameDuplicateDifferentCasing2 -Recommended.JsonInput.FieldNameNotQuoted -Recommended.JsonInput.MapFieldValueIsNull -Recommended.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.JsonInput.RepeatedFieldTrailingComma -Recommended.JsonInput.RepeatedFieldTrailingCommaWithNewlines -Recommended.JsonInput.RepeatedFieldTrailingCommaWithSpace -Recommended.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace -Recommended.JsonInput.StringFieldSingleQuoteBoth -Recommended.JsonInput.StringFieldSingleQuoteKey -Recommended.JsonInput.StringFieldSingleQuoteValue -Recommended.JsonInput.StringFieldUppercaseEscapeLetter -Recommended.JsonInput.TrailingCommaInAnObject -Recommended.JsonInput.TrailingCommaInAnObjectWithNewlines -Recommended.JsonInput.TrailingCommaInAnObjectWithSpace -Recommended.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInPackedField.BOOL -Required.ProtobufInput.PrematureEofInPackedField.ENUM -Required.ProtobufInput.PrematureEofInPackedField.INT32 -Required.ProtobufInput.PrematureEofInPackedField.INT64 -Required.ProtobufInput.PrematureEofInPackedField.SINT32 -Required.ProtobufInput.PrematureEofInPackedField.SINT64 -Required.ProtobufInput.PrematureEofInPackedField.UINT32 -Required.ProtobufInput.PrematureEofInPackedField.UINT64 +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue +Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter +Recommended.Proto3.JsonInput.FieldNameDuplicate +Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing1 +Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing2 +Recommended.Proto3.JsonInput.FieldNameNotQuoted +Recommended.Proto3.JsonInput.MapFieldValueIsNull +Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldTrailingComma +Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines +Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace +Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace +Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth +Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey +Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue +Recommended.Proto3.JsonInput.StringFieldUppercaseEscapeLetter +Recommended.Proto3.JsonInput.TrailingCommaInAnObject +Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines +Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace +Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInPackedField.BOOL +Required.Proto3.ProtobufInput.PrematureEofInPackedField.ENUM +Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT64 +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInPackedField.BOOL +Required.Proto2.ProtobufInput.PrematureEofInPackedField.ENUM +Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT64 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT64 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT64 + diff --git a/conformance/failure_list_csharp.txt b/conformance/failure_list_csharp.txt index 922db94c09..d215235a8c 100644 --- a/conformance/failure_list_csharp.txt +++ b/conformance/failure_list_csharp.txt @@ -1,4 +1,8 @@ -Required.ProtobufInput.IllegalZeroFieldNum_Case_0 -Required.ProtobufInput.IllegalZeroFieldNum_Case_1 -Required.ProtobufInput.IllegalZeroFieldNum_Case_2 -Required.ProtobufInput.IllegalZeroFieldNum_Case_3 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_0 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_1 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_2 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_3 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_0 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_1 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_2 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_3 diff --git a/conformance/failure_list_java.txt b/conformance/failure_list_java.txt index 632940efc8..5116c569ca 100644 --- a/conformance/failure_list_java.txt +++ b/conformance/failure_list_java.txt @@ -7,39 +7,41 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.BoolFieldAllCapitalFalse -Recommended.JsonInput.BoolFieldAllCapitalTrue -Recommended.JsonInput.BoolFieldCamelCaseFalse -Recommended.JsonInput.BoolFieldCamelCaseTrue -Recommended.JsonInput.BoolFieldDoubleQuotedFalse -Recommended.JsonInput.BoolFieldDoubleQuotedTrue -Recommended.JsonInput.BoolMapFieldKeyNotQuoted -Recommended.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.JsonInput.DoubleFieldNanNotQuoted -Recommended.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.JsonInput.FieldMaskInvalidCharacter -Recommended.JsonInput.FieldNameDuplicate -Recommended.JsonInput.FieldNameNotQuoted -Recommended.JsonInput.FloatFieldInfinityNotQuoted -Recommended.JsonInput.FloatFieldNanNotQuoted -Recommended.JsonInput.FloatFieldNegativeInfinityNotQuoted -Recommended.JsonInput.Int32MapFieldKeyNotQuoted -Recommended.JsonInput.Int64MapFieldKeyNotQuoted -Recommended.JsonInput.JsonWithComments -Recommended.JsonInput.StringFieldSingleQuoteBoth -Recommended.JsonInput.StringFieldSingleQuoteKey -Recommended.JsonInput.StringFieldSingleQuoteValue -Recommended.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.JsonInput.Uint32MapFieldKeyNotQuoted -Recommended.JsonInput.Uint64MapFieldKeyNotQuoted -Required.JsonInput.EnumFieldNotQuoted -Required.JsonInput.Int32FieldLeadingZero -Required.JsonInput.Int32FieldNegativeWithLeadingZero -Required.JsonInput.Int32FieldPlusSign -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt -Required.JsonInput.StringFieldNotAString -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse +Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue +Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse +Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue +Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter +Recommended.Proto3.JsonInput.FieldNameDuplicate +Recommended.Proto3.JsonInput.FieldNameNotQuoted +Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.JsonWithComments +Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth +Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey +Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted +Required.Proto3.JsonInput.EnumFieldNotQuoted +Required.Proto3.JsonInput.Int32FieldLeadingZero +Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero +Required.Proto3.JsonInput.Int32FieldPlusSign +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt +Required.Proto3.JsonInput.StringFieldNotAString +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE \ No newline at end of file diff --git a/conformance/failure_list_js.txt b/conformance/failure_list_js.txt index 5414a2f985..eb20f659a2 100644 --- a/conformance/failure_list_js.txt +++ b/conformance/failure_list_js.txt @@ -1,15 +1,19 @@ -Required.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.DOUBLE.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.FIXED32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.FIXED64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.FLOAT.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SFIXED32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SFIXED64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt index 6dd93918f9..c7898bda4c 100644 --- a/conformance/failure_list_php.txt +++ b/conformance/failure_list_php.txt @@ -1,611 +1,612 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.BoolFieldAllCapitalFalse -Recommended.JsonInput.BoolFieldAllCapitalTrue -Recommended.JsonInput.BoolFieldCamelCaseFalse -Recommended.JsonInput.BoolFieldCamelCaseTrue -Recommended.JsonInput.BoolFieldDoubleQuotedFalse -Recommended.JsonInput.BoolFieldDoubleQuotedTrue -Recommended.JsonInput.BoolFieldIntegerOne -Recommended.JsonInput.BoolFieldIntegerZero -Recommended.JsonInput.BoolMapFieldKeyNotQuoted -Recommended.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.JsonInput.DoubleFieldNanNotQuoted -Recommended.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.JsonInput.DurationHas9FractionalDigits.Validator -Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.JsonInput.FieldMaskInvalidCharacter -Recommended.JsonInput.FieldNameDuplicate -Recommended.JsonInput.FieldNameDuplicateDifferentCasing1 -Recommended.JsonInput.FieldNameDuplicateDifferentCasing2 -Recommended.JsonInput.FieldNameNotQuoted -Recommended.JsonInput.FieldNameWithDoubleUnderscores.JsonOutput -Recommended.JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput -Recommended.JsonInput.FieldNameWithDoubleUnderscores.Validator -Recommended.JsonInput.FloatFieldInfinityNotQuoted -Recommended.JsonInput.FloatFieldNanNotQuoted -Recommended.JsonInput.FloatFieldNegativeInfinityNotQuoted -Recommended.JsonInput.Int32MapFieldKeyNotQuoted -Recommended.JsonInput.Int64FieldBeString.Validator -Recommended.JsonInput.Int64MapFieldKeyNotQuoted -Recommended.JsonInput.JsonWithComments -Recommended.JsonInput.MapFieldKeyIsNull -Recommended.JsonInput.MapFieldValueIsNull -Recommended.JsonInput.MissingCommaMultiline -Recommended.JsonInput.MissingCommaOneLine -Recommended.JsonInput.MultilineNoSpaces.JsonOutput -Recommended.JsonInput.MultilineNoSpaces.ProtobufOutput -Recommended.JsonInput.MultilineWithSpaces.JsonOutput -Recommended.JsonInput.MultilineWithSpaces.ProtobufOutput -Recommended.JsonInput.OneLineNoSpaces.JsonOutput -Recommended.JsonInput.OneLineNoSpaces.ProtobufOutput -Recommended.JsonInput.OneLineWithSpaces.JsonOutput -Recommended.JsonInput.OneLineWithSpaces.ProtobufOutput -Recommended.JsonInput.OneofZeroBool.JsonOutput -Recommended.JsonInput.OneofZeroBool.ProtobufOutput -Recommended.JsonInput.OneofZeroBytes.JsonOutput -Recommended.JsonInput.OneofZeroBytes.ProtobufOutput -Recommended.JsonInput.OneofZeroDouble.JsonOutput -Recommended.JsonInput.OneofZeroDouble.ProtobufOutput -Recommended.JsonInput.OneofZeroEnum.JsonOutput -Recommended.JsonInput.OneofZeroEnum.ProtobufOutput -Recommended.JsonInput.OneofZeroFloat.JsonOutput -Recommended.JsonInput.OneofZeroFloat.ProtobufOutput -Recommended.JsonInput.OneofZeroMessage.JsonOutput -Recommended.JsonInput.OneofZeroMessage.ProtobufOutput -Recommended.JsonInput.OneofZeroString.JsonOutput -Recommended.JsonInput.OneofZeroString.ProtobufOutput -Recommended.JsonInput.OneofZeroUint32.JsonOutput -Recommended.JsonInput.OneofZeroUint32.ProtobufOutput -Recommended.JsonInput.OneofZeroUint64.JsonOutput -Recommended.JsonInput.OneofZeroUint64.ProtobufOutput -Recommended.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.JsonInput.RepeatedFieldTrailingComma -Recommended.JsonInput.RepeatedFieldTrailingCommaWithNewlines -Recommended.JsonInput.RepeatedFieldTrailingCommaWithSpace -Recommended.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace -Recommended.JsonInput.StringEndsWithEscapeChar -Recommended.JsonInput.StringFieldInvalidEscape -Recommended.JsonInput.StringFieldSingleQuoteBoth -Recommended.JsonInput.StringFieldSingleQuoteKey -Recommended.JsonInput.StringFieldSingleQuoteValue -Recommended.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.JsonInput.StringFieldUnterminatedEscape -Recommended.JsonInput.StringFieldUppercaseEscapeLetter -Recommended.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.JsonInput.TimestampHas9FractionalDigits.Validator -Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator -Recommended.JsonInput.TimestampZeroNormalized.Validator -Recommended.JsonInput.TrailingCommaInAnObject -Recommended.JsonInput.TrailingCommaInAnObjectWithNewlines -Recommended.JsonInput.TrailingCommaInAnObjectWithSpace -Recommended.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace -Recommended.JsonInput.Uint32MapFieldKeyNotQuoted -Recommended.JsonInput.Uint64FieldBeString.Validator -Recommended.JsonInput.Uint64MapFieldKeyNotQuoted -Recommended.ProtobufInput.OneofZeroBool.JsonOutput -Recommended.ProtobufInput.OneofZeroBool.ProtobufOutput -Recommended.ProtobufInput.OneofZeroBytes.JsonOutput -Recommended.ProtobufInput.OneofZeroBytes.ProtobufOutput -Recommended.ProtobufInput.OneofZeroDouble.JsonOutput -Recommended.ProtobufInput.OneofZeroDouble.ProtobufOutput -Recommended.ProtobufInput.OneofZeroEnum.JsonOutput -Recommended.ProtobufInput.OneofZeroEnum.ProtobufOutput -Recommended.ProtobufInput.OneofZeroFloat.JsonOutput -Recommended.ProtobufInput.OneofZeroFloat.ProtobufOutput -Recommended.ProtobufInput.OneofZeroMessage.JsonOutput -Recommended.ProtobufInput.OneofZeroMessage.ProtobufOutput -Recommended.ProtobufInput.OneofZeroString.JsonOutput -Recommended.ProtobufInput.OneofZeroString.ProtobufOutput -Recommended.ProtobufInput.OneofZeroUint32.JsonOutput -Recommended.ProtobufInput.OneofZeroUint32.ProtobufOutput -Recommended.ProtobufInput.OneofZeroUint64.JsonOutput -Recommended.ProtobufInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse +Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue +Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse +Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue +Recommended.Proto3.JsonInput.BoolFieldIntegerOne +Recommended.Proto3.JsonInput.BoolFieldIntegerZero +Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter +Recommended.Proto3.JsonInput.FieldNameDuplicate +Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing1 +Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing2 +Recommended.Proto3.JsonInput.FieldNameNotQuoted +Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.JsonOutput +Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput +Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.Validator +Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.Int64FieldBeString.Validator +Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.JsonWithComments +Recommended.Proto3.JsonInput.MapFieldKeyIsNull +Recommended.Proto3.JsonInput.MapFieldValueIsNull +Recommended.Proto3.JsonInput.MissingCommaMultiline +Recommended.Proto3.JsonInput.MissingCommaOneLine +Recommended.Proto3.JsonInput.MultilineNoSpaces.JsonOutput +Recommended.Proto3.JsonInput.MultilineNoSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.MultilineWithSpaces.JsonOutput +Recommended.Proto3.JsonInput.MultilineWithSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.OneLineNoSpaces.JsonOutput +Recommended.Proto3.JsonInput.OneLineNoSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.OneLineWithSpaces.JsonOutput +Recommended.Proto3.JsonInput.OneLineWithSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroBool.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroMessage.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroMessage.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroString.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroUint64.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldTrailingComma +Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines +Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace +Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace +Recommended.Proto3.JsonInput.StringEndsWithEscapeChar +Recommended.Proto3.JsonInput.StringFieldInvalidEscape +Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth +Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey +Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.JsonInput.StringFieldUnterminatedEscape +Recommended.Proto3.JsonInput.StringFieldUppercaseEscapeLetter +Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator +Recommended.Proto3.JsonInput.TrailingCommaInAnObject +Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines +Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace +Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace +Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator +Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted +Recommended.Proto3.ProtobufInput.OneofZeroBool.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessage.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessage.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.ProtobufOutput Required.DurationProtoInputTooLarge.JsonOutput Required.DurationProtoInputTooSmall.JsonOutput -Required.JsonInput.AllFieldAcceptNull.JsonOutput -Required.JsonInput.AllFieldAcceptNull.ProtobufOutput -Required.JsonInput.Any.JsonOutput -Required.JsonInput.Any.ProtobufOutput -Required.JsonInput.AnyNested.JsonOutput -Required.JsonInput.AnyNested.ProtobufOutput -Required.JsonInput.AnyUnorderedTypeTag.JsonOutput -Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput -Required.JsonInput.AnyWithDuration.JsonOutput -Required.JsonInput.AnyWithDuration.ProtobufOutput -Required.JsonInput.AnyWithFieldMask.JsonOutput -Required.JsonInput.AnyWithFieldMask.ProtobufOutput -Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput -Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput -Required.JsonInput.AnyWithStruct.JsonOutput -Required.JsonInput.AnyWithStruct.ProtobufOutput -Required.JsonInput.AnyWithTimestamp.JsonOutput -Required.JsonInput.AnyWithTimestamp.ProtobufOutput -Required.JsonInput.AnyWithValueForInteger.JsonOutput -Required.JsonInput.AnyWithValueForInteger.ProtobufOutput -Required.JsonInput.AnyWithValueForJsonObject.JsonOutput -Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.JsonInput.BoolFieldFalse.JsonOutput -Required.JsonInput.BoolFieldFalse.ProtobufOutput -Required.JsonInput.BoolFieldTrue.JsonOutput -Required.JsonInput.BoolFieldTrue.ProtobufOutput -Required.JsonInput.BoolMapEscapedKey.JsonOutput -Required.JsonInput.BoolMapEscapedKey.ProtobufOutput -Required.JsonInput.BoolMapField.JsonOutput -Required.JsonInput.BoolMapField.ProtobufOutput -Required.JsonInput.BytesField.JsonOutput -Required.JsonInput.BytesField.ProtobufOutput -Required.JsonInput.BytesFieldInvalidBase64Characters -Required.JsonInput.BytesRepeatedField.JsonOutput -Required.JsonInput.BytesRepeatedField.ProtobufOutput -Required.JsonInput.DoubleFieldInfinity.JsonOutput -Required.JsonInput.DoubleFieldInfinity.ProtobufOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldNan.JsonOutput -Required.JsonInput.DoubleFieldNan.ProtobufOutput -Required.JsonInput.DoubleFieldNegativeInfinity.JsonOutput -Required.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput -Required.JsonInput.DoubleFieldQuotedValue.JsonOutput -Required.JsonInput.DoubleFieldQuotedValue.ProtobufOutput -Required.JsonInput.DoubleFieldTooLarge -Required.JsonInput.DoubleFieldTooSmall -Required.JsonInput.DurationJsonInputTooLarge -Required.JsonInput.DurationJsonInputTooSmall -Required.JsonInput.DurationMaxValue.JsonOutput -Required.JsonInput.DurationMaxValue.ProtobufOutput -Required.JsonInput.DurationMinValue.JsonOutput -Required.JsonInput.DurationMinValue.ProtobufOutput -Required.JsonInput.DurationMissingS -Required.JsonInput.DurationRepeatedValue.JsonOutput -Required.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.JsonInput.EnumField.JsonOutput -Required.JsonInput.EnumField.ProtobufOutput -Required.JsonInput.EnumFieldNotQuoted -Required.JsonInput.EnumFieldNumericValueNonZero.JsonOutput -Required.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput -Required.JsonInput.EnumFieldNumericValueZero.JsonOutput -Required.JsonInput.EnumFieldNumericValueZero.ProtobufOutput -Required.JsonInput.EnumFieldUnknownValue.Validator -Required.JsonInput.EnumRepeatedField.JsonOutput -Required.JsonInput.EnumRepeatedField.ProtobufOutput -Required.JsonInput.FieldMask.JsonOutput -Required.JsonInput.FieldMask.ProtobufOutput -Required.JsonInput.FieldNameEscaped.JsonOutput -Required.JsonInput.FieldNameEscaped.ProtobufOutput -Required.JsonInput.FieldNameInLowerCamelCase.Validator -Required.JsonInput.FieldNameInSnakeCase.JsonOutput -Required.JsonInput.FieldNameInSnakeCase.ProtobufOutput -Required.JsonInput.FieldNameWithMixedCases.JsonOutput -Required.JsonInput.FieldNameWithMixedCases.ProtobufOutput -Required.JsonInput.FieldNameWithMixedCases.Validator -Required.JsonInput.FieldNameWithNumbers.JsonOutput -Required.JsonInput.FieldNameWithNumbers.ProtobufOutput -Required.JsonInput.FieldNameWithNumbers.Validator -Required.JsonInput.FloatFieldInfinity.JsonOutput -Required.JsonInput.FloatFieldInfinity.ProtobufOutput -Required.JsonInput.FloatFieldMaxNegativeValue.JsonOutput -Required.JsonInput.FloatFieldMaxNegativeValue.ProtobufOutput -Required.JsonInput.FloatFieldMaxPositiveValue.JsonOutput -Required.JsonInput.FloatFieldMaxPositiveValue.ProtobufOutput -Required.JsonInput.FloatFieldMinNegativeValue.JsonOutput -Required.JsonInput.FloatFieldMinNegativeValue.ProtobufOutput -Required.JsonInput.FloatFieldMinPositiveValue.JsonOutput -Required.JsonInput.FloatFieldMinPositiveValue.ProtobufOutput -Required.JsonInput.FloatFieldNan.JsonOutput -Required.JsonInput.FloatFieldNan.ProtobufOutput -Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput -Required.JsonInput.FloatFieldQuotedValue.JsonOutput -Required.JsonInput.FloatFieldQuotedValue.ProtobufOutput -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.HelloWorld.JsonOutput -Required.JsonInput.HelloWorld.ProtobufOutput -Required.JsonInput.Int32FieldExponentialFormat.JsonOutput -Required.JsonInput.Int32FieldExponentialFormat.ProtobufOutput -Required.JsonInput.Int32FieldFloatTrailingZero.JsonOutput -Required.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput -Required.JsonInput.Int32FieldLeadingSpace -Required.JsonInput.Int32FieldLeadingZero -Required.JsonInput.Int32FieldMaxFloatValue.JsonOutput -Required.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput -Required.JsonInput.Int32FieldMaxValue.JsonOutput -Required.JsonInput.Int32FieldMaxValue.ProtobufOutput -Required.JsonInput.Int32FieldMinFloatValue.JsonOutput -Required.JsonInput.Int32FieldMinFloatValue.ProtobufOutput -Required.JsonInput.Int32FieldMinValue.JsonOutput -Required.JsonInput.Int32FieldMinValue.ProtobufOutput -Required.JsonInput.Int32FieldNegativeWithLeadingZero -Required.JsonInput.Int32FieldNotInteger -Required.JsonInput.Int32FieldNotNumber -Required.JsonInput.Int32FieldPlusSign -Required.JsonInput.Int32FieldStringValue.JsonOutput -Required.JsonInput.Int32FieldStringValue.ProtobufOutput -Required.JsonInput.Int32FieldStringValueEscaped.JsonOutput -Required.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput -Required.JsonInput.Int32FieldTooLarge -Required.JsonInput.Int32FieldTooSmall -Required.JsonInput.Int32FieldTrailingSpace -Required.JsonInput.Int32MapEscapedKey.JsonOutput -Required.JsonInput.Int32MapEscapedKey.ProtobufOutput -Required.JsonInput.Int32MapField.JsonOutput -Required.JsonInput.Int32MapField.ProtobufOutput -Required.JsonInput.Int64FieldMaxValue.JsonOutput -Required.JsonInput.Int64FieldMaxValue.ProtobufOutput -Required.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput -Required.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput -Required.JsonInput.Int64FieldMinValue.JsonOutput -Required.JsonInput.Int64FieldMinValue.ProtobufOutput -Required.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput -Required.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput -Required.JsonInput.Int64FieldNotInteger -Required.JsonInput.Int64FieldNotNumber -Required.JsonInput.Int64FieldTooLarge -Required.JsonInput.Int64FieldTooSmall -Required.JsonInput.Int64MapEscapedKey.JsonOutput -Required.JsonInput.Int64MapEscapedKey.ProtobufOutput -Required.JsonInput.Int64MapField.JsonOutput -Required.JsonInput.Int64MapField.ProtobufOutput -Required.JsonInput.MessageField.JsonOutput -Required.JsonInput.MessageField.ProtobufOutput -Required.JsonInput.MessageMapField.JsonOutput -Required.JsonInput.MessageMapField.ProtobufOutput -Required.JsonInput.MessageRepeatedField.JsonOutput -Required.JsonInput.MessageRepeatedField.ProtobufOutput -Required.JsonInput.OneofFieldDuplicate -Required.JsonInput.OptionalBoolWrapper.JsonOutput -Required.JsonInput.OptionalBoolWrapper.ProtobufOutput -Required.JsonInput.OptionalBytesWrapper.JsonOutput -Required.JsonInput.OptionalBytesWrapper.ProtobufOutput -Required.JsonInput.OptionalDoubleWrapper.JsonOutput -Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput -Required.JsonInput.OptionalFloatWrapper.JsonOutput -Required.JsonInput.OptionalFloatWrapper.ProtobufOutput -Required.JsonInput.OptionalInt32Wrapper.JsonOutput -Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput -Required.JsonInput.OptionalInt64Wrapper.JsonOutput -Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput -Required.JsonInput.OptionalStringWrapper.JsonOutput -Required.JsonInput.OptionalStringWrapper.ProtobufOutput -Required.JsonInput.OptionalUint32Wrapper.JsonOutput -Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput -Required.JsonInput.OptionalUint64Wrapper.JsonOutput -Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput -Required.JsonInput.OriginalProtoFieldName.JsonOutput -Required.JsonInput.OriginalProtoFieldName.ProtobufOutput -Required.JsonInput.PrimitiveRepeatedField.JsonOutput -Required.JsonInput.PrimitiveRepeatedField.ProtobufOutput -Required.JsonInput.RepeatedBoolWrapper.JsonOutput -Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput -Required.JsonInput.RepeatedBytesWrapper.JsonOutput -Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput -Required.JsonInput.RepeatedDoubleWrapper.JsonOutput -Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotMessage -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotString -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotBool -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotString -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotMessage -Required.JsonInput.RepeatedFloatWrapper.JsonOutput -Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput -Required.JsonInput.RepeatedInt32Wrapper.JsonOutput -Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedInt64Wrapper.JsonOutput -Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput -Required.JsonInput.RepeatedStringWrapper.JsonOutput -Required.JsonInput.RepeatedStringWrapper.ProtobufOutput -Required.JsonInput.RepeatedUint32Wrapper.JsonOutput -Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedUint64Wrapper.JsonOutput -Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput -Required.JsonInput.StringField.JsonOutput -Required.JsonInput.StringField.ProtobufOutput -Required.JsonInput.StringFieldEscape.JsonOutput -Required.JsonInput.StringFieldEscape.ProtobufOutput -Required.JsonInput.StringFieldNotAString -Required.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.JsonInput.StringFieldUnicode.JsonOutput -Required.JsonInput.StringFieldUnicode.ProtobufOutput -Required.JsonInput.StringFieldUnicodeEscape.JsonOutput -Required.JsonInput.StringFieldUnicodeEscape.ProtobufOutput -Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput -Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput -Required.JsonInput.StringRepeatedField.JsonOutput -Required.JsonInput.StringRepeatedField.ProtobufOutput -Required.JsonInput.Struct.JsonOutput -Required.JsonInput.Struct.ProtobufOutput -Required.JsonInput.TimestampJsonInputLowercaseT -Required.JsonInput.TimestampJsonInputLowercaseZ -Required.JsonInput.TimestampJsonInputMissingT -Required.JsonInput.TimestampJsonInputMissingZ -Required.JsonInput.TimestampJsonInputTooLarge -Required.JsonInput.TimestampJsonInputTooSmall -Required.JsonInput.TimestampMaxValue.JsonOutput -Required.JsonInput.TimestampMaxValue.ProtobufOutput -Required.JsonInput.TimestampMinValue.JsonOutput -Required.JsonInput.TimestampMinValue.ProtobufOutput -Required.JsonInput.TimestampRepeatedValue.JsonOutput -Required.JsonInput.TimestampRepeatedValue.ProtobufOutput -Required.JsonInput.TimestampWithNegativeOffset.JsonOutput -Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput -Required.JsonInput.TimestampWithPositiveOffset.JsonOutput -Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.JsonInput.Uint32FieldMaxFloatValue.JsonOutput -Required.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput -Required.JsonInput.Uint32FieldMaxValue.JsonOutput -Required.JsonInput.Uint32FieldMaxValue.ProtobufOutput -Required.JsonInput.Uint32FieldNotInteger -Required.JsonInput.Uint32FieldNotNumber -Required.JsonInput.Uint32FieldTooLarge -Required.JsonInput.Uint32MapField.JsonOutput -Required.JsonInput.Uint32MapField.ProtobufOutput -Required.JsonInput.Uint64FieldMaxValue.JsonOutput -Required.JsonInput.Uint64FieldMaxValue.ProtobufOutput -Required.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput -Required.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput -Required.JsonInput.Uint64FieldNotInteger -Required.JsonInput.Uint64FieldNotNumber -Required.JsonInput.Uint64FieldTooLarge -Required.JsonInput.Uint64MapField.JsonOutput -Required.JsonInput.Uint64MapField.ProtobufOutput -Required.JsonInput.ValueAcceptBool.JsonOutput -Required.JsonInput.ValueAcceptBool.ProtobufOutput -Required.JsonInput.ValueAcceptFloat.JsonOutput -Required.JsonInput.ValueAcceptFloat.ProtobufOutput -Required.JsonInput.ValueAcceptInteger.JsonOutput -Required.JsonInput.ValueAcceptInteger.ProtobufOutput -Required.JsonInput.ValueAcceptList.JsonOutput -Required.JsonInput.ValueAcceptList.ProtobufOutput -Required.JsonInput.ValueAcceptNull.JsonOutput -Required.JsonInput.ValueAcceptNull.ProtobufOutput -Required.JsonInput.ValueAcceptObject.JsonOutput -Required.JsonInput.ValueAcceptObject.ProtobufOutput -Required.JsonInput.ValueAcceptString.JsonOutput -Required.JsonInput.ValueAcceptString.ProtobufOutput -Required.JsonInput.WrapperTypesWithNullValue.JsonOutput -Required.JsonInput.WrapperTypesWithNullValue.ProtobufOutput -Required.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.BOOL -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.BYTES -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.DOUBLE -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.ENUM -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FIXED32 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FIXED64 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FLOAT -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.INT32 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.INT64 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SFIXED32 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SFIXED64 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SINT32 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SINT64 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.STRING -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.UINT32 -Required.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.UINT64 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.BOOL -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.BYTES -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.DOUBLE -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.ENUM -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FIXED32 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FIXED64 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FLOAT -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.INT32 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.INT64 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SFIXED32 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SFIXED64 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SINT32 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SINT64 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.STRING -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.UINT32 -Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.UINT64 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.BOOL -Required.ProtobufInput.PrematureEofBeforeUnknownValue.BYTES -Required.ProtobufInput.PrematureEofBeforeUnknownValue.DOUBLE -Required.ProtobufInput.PrematureEofBeforeUnknownValue.ENUM -Required.ProtobufInput.PrematureEofBeforeUnknownValue.FIXED32 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.FIXED64 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.FLOAT -Required.ProtobufInput.PrematureEofBeforeUnknownValue.INT32 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.INT64 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.MESSAGE -Required.ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED32 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED64 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.SINT32 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.SINT64 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.STRING -Required.ProtobufInput.PrematureEofBeforeUnknownValue.UINT32 -Required.ProtobufInput.PrematureEofBeforeUnknownValue.UINT64 -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.BYTES -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.STRING -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.BYTES -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.STRING -Required.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.BYTES -Required.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.MESSAGE -Required.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.STRING -Required.ProtobufInput.PrematureEofInPackedField.BOOL -Required.ProtobufInput.PrematureEofInPackedField.DOUBLE -Required.ProtobufInput.PrematureEofInPackedField.ENUM -Required.ProtobufInput.PrematureEofInPackedField.FIXED32 -Required.ProtobufInput.PrematureEofInPackedField.FIXED64 -Required.ProtobufInput.PrematureEofInPackedField.FLOAT -Required.ProtobufInput.PrematureEofInPackedField.INT32 -Required.ProtobufInput.PrematureEofInPackedField.INT64 -Required.ProtobufInput.PrematureEofInPackedField.SFIXED32 -Required.ProtobufInput.PrematureEofInPackedField.SFIXED64 -Required.ProtobufInput.PrematureEofInPackedField.SINT32 -Required.ProtobufInput.PrematureEofInPackedField.SINT64 -Required.ProtobufInput.PrematureEofInPackedField.UINT32 -Required.ProtobufInput.PrematureEofInPackedField.UINT64 -Required.ProtobufInput.PrematureEofInPackedFieldValue.BOOL -Required.ProtobufInput.PrematureEofInPackedFieldValue.DOUBLE -Required.ProtobufInput.PrematureEofInPackedFieldValue.ENUM -Required.ProtobufInput.PrematureEofInPackedFieldValue.FIXED32 -Required.ProtobufInput.PrematureEofInPackedFieldValue.FIXED64 -Required.ProtobufInput.PrematureEofInPackedFieldValue.FLOAT -Required.ProtobufInput.PrematureEofInPackedFieldValue.INT32 -Required.ProtobufInput.PrematureEofInPackedFieldValue.INT64 -Required.ProtobufInput.PrematureEofInPackedFieldValue.SFIXED32 -Required.ProtobufInput.PrematureEofInPackedFieldValue.SFIXED64 -Required.ProtobufInput.PrematureEofInPackedFieldValue.SINT32 -Required.ProtobufInput.PrematureEofInPackedFieldValue.SINT64 -Required.ProtobufInput.PrematureEofInPackedFieldValue.UINT32 -Required.ProtobufInput.PrematureEofInPackedFieldValue.UINT64 -Required.ProtobufInput.PrematureEofInSubmessageValue.MESSAGE -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BOOL -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BYTES -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.DOUBLE -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.ENUM -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FIXED32 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FIXED64 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FLOAT -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT32 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT64 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SFIXED32 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SFIXED64 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT32 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT64 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.STRING -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT32 -Required.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT64 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.BOOL -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.BYTES -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.DOUBLE -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.ENUM -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FIXED32 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FIXED64 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FLOAT -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.INT32 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.INT64 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SFIXED32 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SFIXED64 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SINT32 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SINT64 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.STRING -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.UINT32 -Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.UINT64 -Required.ProtobufInput.PrematureEofInsideUnknownValue.BOOL -Required.ProtobufInput.PrematureEofInsideUnknownValue.BYTES -Required.ProtobufInput.PrematureEofInsideUnknownValue.DOUBLE -Required.ProtobufInput.PrematureEofInsideUnknownValue.ENUM -Required.ProtobufInput.PrematureEofInsideUnknownValue.FIXED32 -Required.ProtobufInput.PrematureEofInsideUnknownValue.FIXED64 -Required.ProtobufInput.PrematureEofInsideUnknownValue.FLOAT -Required.ProtobufInput.PrematureEofInsideUnknownValue.INT32 -Required.ProtobufInput.PrematureEofInsideUnknownValue.INT64 -Required.ProtobufInput.PrematureEofInsideUnknownValue.MESSAGE -Required.ProtobufInput.PrematureEofInsideUnknownValue.SFIXED32 -Required.ProtobufInput.PrematureEofInsideUnknownValue.SFIXED64 -Required.ProtobufInput.PrematureEofInsideUnknownValue.SINT32 -Required.ProtobufInput.PrematureEofInsideUnknownValue.SINT64 -Required.ProtobufInput.PrematureEofInsideUnknownValue.STRING -Required.ProtobufInput.PrematureEofInsideUnknownValue.UINT32 -Required.ProtobufInput.PrematureEofInsideUnknownValue.UINT64 -Required.ProtobufInput.RepeatedScalarSelectsLast.BOOL.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.BOOL.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.INT32.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.INT64.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.INT64.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SINT32.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SINT32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SINT64.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.SINT64.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT32.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT64.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.BOOL.JsonOutput -Required.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.DOUBLE.JsonOutput -Required.ProtobufInput.ValidDataRepeated.DOUBLE.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.FIXED32.JsonOutput -Required.ProtobufInput.ValidDataRepeated.FIXED32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.FIXED64.JsonOutput -Required.ProtobufInput.ValidDataRepeated.FIXED64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput -Required.ProtobufInput.ValidDataRepeated.FLOAT.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.INT32.JsonOutput -Required.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.INT64.JsonOutput -Required.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SFIXED32.JsonOutput -Required.ProtobufInput.ValidDataRepeated.SFIXED32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SFIXED64.JsonOutput -Required.ProtobufInput.ValidDataRepeated.SFIXED64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SINT32.JsonOutput -Required.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SINT64.JsonOutput -Required.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.UINT32.JsonOutput -Required.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.UINT64.JsonOutput -Required.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.BOOL.JsonOutput -Required.ProtobufInput.ValidDataScalar.BOOL.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.DOUBLE.JsonOutput -Required.ProtobufInput.ValidDataScalar.DOUBLE.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.FIXED32.JsonOutput -Required.ProtobufInput.ValidDataScalar.FIXED32.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.FIXED64.JsonOutput -Required.ProtobufInput.ValidDataScalar.FIXED64.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.FLOAT.JsonOutput -Required.ProtobufInput.ValidDataScalar.FLOAT.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.INT32.JsonOutput -Required.ProtobufInput.ValidDataScalar.INT32.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.INT64.JsonOutput -Required.ProtobufInput.ValidDataScalar.INT64.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.SFIXED32.JsonOutput -Required.ProtobufInput.ValidDataScalar.SFIXED32.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.SFIXED64.JsonOutput -Required.ProtobufInput.ValidDataScalar.SFIXED64.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.SINT32.JsonOutput -Required.ProtobufInput.ValidDataScalar.SINT32.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.SINT64.JsonOutput -Required.ProtobufInput.ValidDataScalar.SINT64.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.UINT32.JsonOutput -Required.ProtobufInput.ValidDataScalar.UINT32.ProtobufOutput -Required.ProtobufInput.ValidDataScalar.UINT64.JsonOutput -Required.ProtobufInput.ValidDataScalar.UINT64.ProtobufOutput +Required.Proto3.JsonInput.AllFieldAcceptNull.JsonOutput +Required.Proto3.JsonInput.AllFieldAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.Any.JsonOutput +Required.Proto3.JsonInput.Any.ProtobufOutput +Required.Proto3.JsonInput.AnyNested.JsonOutput +Required.Proto3.JsonInput.AnyNested.ProtobufOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput +Required.Proto3.JsonInput.AnyWithDuration.JsonOutput +Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput +Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput +Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput +Required.Proto3.JsonInput.AnyWithStruct.JsonOutput +Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput +Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput +Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput +Required.Proto3.JsonInput.BoolFieldFalse.JsonOutput +Required.Proto3.JsonInput.BoolFieldFalse.ProtobufOutput +Required.Proto3.JsonInput.BoolFieldTrue.JsonOutput +Required.Proto3.JsonInput.BoolFieldTrue.ProtobufOutput +Required.Proto3.JsonInput.BoolMapEscapedKey.JsonOutput +Required.Proto3.JsonInput.BoolMapEscapedKey.ProtobufOutput +Required.Proto3.JsonInput.BoolMapField.JsonOutput +Required.Proto3.JsonInput.BoolMapField.ProtobufOutput +Required.Proto3.JsonInput.BytesField.JsonOutput +Required.Proto3.JsonInput.BytesField.ProtobufOutput +Required.Proto3.JsonInput.BytesFieldInvalidBase64Characters +Required.Proto3.JsonInput.BytesRepeatedField.JsonOutput +Required.Proto3.JsonInput.BytesRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldInfinity.JsonOutput +Required.Proto3.JsonInput.DoubleFieldInfinity.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput +Required.Proto3.JsonInput.DoubleFieldNan.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldQuotedValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldQuotedValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldTooLarge +Required.Proto3.JsonInput.DoubleFieldTooSmall +Required.Proto3.JsonInput.DurationJsonInputTooLarge +Required.Proto3.JsonInput.DurationJsonInputTooSmall +Required.Proto3.JsonInput.DurationMaxValue.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMinValue.JsonOutput +Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMissingS +Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput +Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.EnumField.JsonOutput +Required.Proto3.JsonInput.EnumField.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNotQuoted +Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.JsonOutput +Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNumericValueZero.JsonOutput +Required.Proto3.JsonInput.EnumFieldNumericValueZero.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator +Required.Proto3.JsonInput.EnumRepeatedField.JsonOutput +Required.Proto3.JsonInput.EnumRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.FieldMask.JsonOutput +Required.Proto3.JsonInput.FieldMask.ProtobufOutput +Required.Proto3.JsonInput.FieldNameEscaped.JsonOutput +Required.Proto3.JsonInput.FieldNameEscaped.ProtobufOutput +Required.Proto3.JsonInput.FieldNameInLowerCamelCase.Validator +Required.Proto3.JsonInput.FieldNameInSnakeCase.JsonOutput +Required.Proto3.JsonInput.FieldNameInSnakeCase.ProtobufOutput +Required.Proto3.JsonInput.FieldNameWithMixedCases.JsonOutput +Required.Proto3.JsonInput.FieldNameWithMixedCases.ProtobufOutput +Required.Proto3.JsonInput.FieldNameWithMixedCases.Validator +Required.Proto3.JsonInput.FieldNameWithNumbers.JsonOutput +Required.Proto3.JsonInput.FieldNameWithNumbers.ProtobufOutput +Required.Proto3.JsonInput.FieldNameWithNumbers.Validator +Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldInfinity.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMaxPositiveValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMaxPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMinNegativeValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMinNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldNan.JsonOutput +Required.Proto3.JsonInput.FloatFieldNan.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldQuotedValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldQuotedValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.HelloWorld.JsonOutput +Required.Proto3.JsonInput.HelloWorld.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldExponentialFormat.JsonOutput +Required.Proto3.JsonInput.Int32FieldExponentialFormat.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.JsonOutput +Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldLeadingSpace +Required.Proto3.JsonInput.Int32FieldLeadingZero +Required.Proto3.JsonInput.Int32FieldMaxFloatValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMinFloatValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMinFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMinValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMinValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero +Required.Proto3.JsonInput.Int32FieldNotInteger +Required.Proto3.JsonInput.Int32FieldNotNumber +Required.Proto3.JsonInput.Int32FieldPlusSign +Required.Proto3.JsonInput.Int32FieldStringValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldStringValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldStringValueEscaped.JsonOutput +Required.Proto3.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldTooLarge +Required.Proto3.JsonInput.Int32FieldTooSmall +Required.Proto3.JsonInput.Int32FieldTrailingSpace +Required.Proto3.JsonInput.Int32MapEscapedKey.JsonOutput +Required.Proto3.JsonInput.Int32MapEscapedKey.ProtobufOutput +Required.Proto3.JsonInput.Int32MapField.JsonOutput +Required.Proto3.JsonInput.Int32MapField.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldNotInteger +Required.Proto3.JsonInput.Int64FieldNotNumber +Required.Proto3.JsonInput.Int64FieldTooLarge +Required.Proto3.JsonInput.Int64FieldTooSmall +Required.Proto3.JsonInput.Int64MapEscapedKey.JsonOutput +Required.Proto3.JsonInput.Int64MapEscapedKey.ProtobufOutput +Required.Proto3.JsonInput.Int64MapField.JsonOutput +Required.Proto3.JsonInput.Int64MapField.ProtobufOutput +Required.Proto3.JsonInput.MessageField.JsonOutput +Required.Proto3.JsonInput.MessageField.ProtobufOutput +Required.Proto3.JsonInput.MessageMapField.JsonOutput +Required.Proto3.JsonInput.MessageMapField.ProtobufOutput +Required.Proto3.JsonInput.MessageRepeatedField.JsonOutput +Required.Proto3.JsonInput.MessageRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.OneofFieldDuplicate +Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput +Required.Proto3.JsonInput.OriginalProtoFieldName.JsonOutput +Required.Proto3.JsonInput.OriginalProtoFieldName.ProtobufOutput +Required.Proto3.JsonInput.PrimitiveRepeatedField.JsonOutput +Required.Proto3.JsonInput.PrimitiveRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotMessage +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotString +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotString +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotMessage +Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.StringField.JsonOutput +Required.Proto3.JsonInput.StringField.ProtobufOutput +Required.Proto3.JsonInput.StringFieldEscape.JsonOutput +Required.Proto3.JsonInput.StringFieldEscape.ProtobufOutput +Required.Proto3.JsonInput.StringFieldNotAString +Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicode.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicode.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscape.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscape.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput +Required.Proto3.JsonInput.StringRepeatedField.JsonOutput +Required.Proto3.JsonInput.StringRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.Struct.JsonOutput +Required.Proto3.JsonInput.Struct.ProtobufOutput +Required.Proto3.JsonInput.TimestampJsonInputLowercaseT +Required.Proto3.JsonInput.TimestampJsonInputLowercaseZ +Required.Proto3.JsonInput.TimestampJsonInputMissingT +Required.Proto3.JsonInput.TimestampJsonInputMissingZ +Required.Proto3.JsonInput.TimestampJsonInputTooLarge +Required.Proto3.JsonInput.TimestampJsonInputTooSmall +Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput +Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampMinValue.JsonOutput +Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput +Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.JsonOutput +Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Uint32FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Uint32FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Uint32FieldNotInteger +Required.Proto3.JsonInput.Uint32FieldNotNumber +Required.Proto3.JsonInput.Uint32FieldTooLarge +Required.Proto3.JsonInput.Uint32MapField.JsonOutput +Required.Proto3.JsonInput.Uint32MapField.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldNotInteger +Required.Proto3.JsonInput.Uint64FieldNotNumber +Required.Proto3.JsonInput.Uint64FieldTooLarge +Required.Proto3.JsonInput.Uint64MapField.JsonOutput +Required.Proto3.JsonInput.Uint64MapField.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput +Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput +Required.Proto3.JsonInput.ValueAcceptFloat.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptInteger.JsonOutput +Required.Proto3.JsonInput.ValueAcceptInteger.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptList.JsonOutput +Required.Proto3.JsonInput.ValueAcceptList.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptNull.JsonOutput +Required.Proto3.JsonInput.ValueAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput +Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptString.JsonOutput +Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput +Required.Proto3.JsonInput.WrapperTypesWithNullValue.JsonOutput +Required.Proto3.JsonInput.WrapperTypesWithNullValue.ProtobufOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.STRING +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.UINT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.STRING +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.UINT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.STRING +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.UINT64 +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.STRING +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.STRING +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.STRING +Required.Proto3.ProtobufInput.PrematureEofInPackedField.BOOL +Required.Proto3.ProtobufInput.PrematureEofInPackedField.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofInPackedField.ENUM +Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.FLOAT +Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.UINT64 +Required.Proto3.ProtobufInput.PrematureEofInSubmessageValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.STRING +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.STRING +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.UINT64 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.BYTES +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.ENUM +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.FLOAT +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.STRING +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.UINT64 +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64.ProtobufOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt index f53449f7d5..0fb8e94949 100644 --- a/conformance/failure_list_php_c.txt +++ b/conformance/failure_list_php_c.txt @@ -1,227 +1,228 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.BoolFieldIntegerOne -Recommended.JsonInput.BoolFieldIntegerZero -Recommended.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.JsonInput.DurationHas9FractionalDigits.Validator -Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.JsonInput.Int64FieldBeString.Validator -Recommended.JsonInput.MapFieldValueIsNull -Recommended.JsonInput.OneofZeroBool.JsonOutput -Recommended.JsonInput.OneofZeroBool.ProtobufOutput -Recommended.JsonInput.OneofZeroBytes.JsonOutput -Recommended.JsonInput.OneofZeroBytes.ProtobufOutput -Recommended.JsonInput.OneofZeroDouble.JsonOutput -Recommended.JsonInput.OneofZeroDouble.ProtobufOutput -Recommended.JsonInput.OneofZeroEnum.JsonOutput -Recommended.JsonInput.OneofZeroEnum.ProtobufOutput -Recommended.JsonInput.OneofZeroFloat.JsonOutput -Recommended.JsonInput.OneofZeroFloat.ProtobufOutput -Recommended.JsonInput.OneofZeroString.JsonOutput -Recommended.JsonInput.OneofZeroString.ProtobufOutput -Recommended.JsonInput.OneofZeroUint32.JsonOutput -Recommended.JsonInput.OneofZeroUint32.ProtobufOutput -Recommended.JsonInput.OneofZeroUint64.JsonOutput -Recommended.JsonInput.OneofZeroUint64.ProtobufOutput -Recommended.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.JsonInput.StringEndsWithEscapeChar -Recommended.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.JsonInput.TimestampHas9FractionalDigits.Validator -Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator -Recommended.JsonInput.TimestampZeroNormalized.Validator -Recommended.JsonInput.Uint64FieldBeString.Validator -Recommended.ProtobufInput.OneofZeroBool.JsonOutput -Recommended.ProtobufInput.OneofZeroBool.ProtobufOutput -Recommended.ProtobufInput.OneofZeroBytes.JsonOutput -Recommended.ProtobufInput.OneofZeroBytes.ProtobufOutput -Recommended.ProtobufInput.OneofZeroDouble.JsonOutput -Recommended.ProtobufInput.OneofZeroDouble.ProtobufOutput -Recommended.ProtobufInput.OneofZeroEnum.JsonOutput -Recommended.ProtobufInput.OneofZeroEnum.ProtobufOutput -Recommended.ProtobufInput.OneofZeroFloat.JsonOutput -Recommended.ProtobufInput.OneofZeroFloat.ProtobufOutput -Recommended.ProtobufInput.OneofZeroString.JsonOutput -Recommended.ProtobufInput.OneofZeroString.ProtobufOutput -Recommended.ProtobufInput.OneofZeroUint32.JsonOutput -Recommended.ProtobufInput.OneofZeroUint32.ProtobufOutput -Recommended.ProtobufInput.OneofZeroUint64.JsonOutput -Recommended.ProtobufInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.JsonInput.BoolFieldIntegerOne +Recommended.Proto3.JsonInput.BoolFieldIntegerZero +Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.Int64FieldBeString.Validator +Recommended.Proto3.JsonInput.MapFieldValueIsNull +Recommended.Proto3.JsonInput.OneofZeroBool.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroString.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroUint64.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.Proto3.JsonInput.StringEndsWithEscapeChar +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator +Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator +Recommended.Proto3.ProtobufInput.OneofZeroBool.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.ProtobufOutput Required.DurationProtoInputTooLarge.JsonOutput Required.DurationProtoInputTooSmall.JsonOutput -Required.JsonInput.AllFieldAcceptNull.ProtobufOutput -Required.JsonInput.Any.JsonOutput -Required.JsonInput.Any.ProtobufOutput -Required.JsonInput.AnyNested.JsonOutput -Required.JsonInput.AnyNested.ProtobufOutput -Required.JsonInput.AnyUnorderedTypeTag.JsonOutput -Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput -Required.JsonInput.AnyWithDuration.JsonOutput -Required.JsonInput.AnyWithDuration.ProtobufOutput -Required.JsonInput.AnyWithFieldMask.JsonOutput -Required.JsonInput.AnyWithFieldMask.ProtobufOutput -Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput -Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput -Required.JsonInput.AnyWithStruct.JsonOutput -Required.JsonInput.AnyWithStruct.ProtobufOutput -Required.JsonInput.AnyWithTimestamp.JsonOutput -Required.JsonInput.AnyWithTimestamp.ProtobufOutput -Required.JsonInput.AnyWithValueForInteger.JsonOutput -Required.JsonInput.AnyWithValueForInteger.ProtobufOutput -Required.JsonInput.AnyWithValueForJsonObject.JsonOutput -Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.JsonInput.BoolFieldFalse.ProtobufOutput -Required.JsonInput.BoolMapField.JsonOutput -Required.JsonInput.DoubleFieldInfinity.JsonOutput -Required.JsonInput.DoubleFieldInfinity.ProtobufOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldNan.JsonOutput -Required.JsonInput.DoubleFieldNan.ProtobufOutput -Required.JsonInput.DoubleFieldNegativeInfinity.JsonOutput -Required.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput -Required.JsonInput.DoubleFieldQuotedValue.JsonOutput -Required.JsonInput.DoubleFieldQuotedValue.ProtobufOutput -Required.JsonInput.DurationMaxValue.JsonOutput -Required.JsonInput.DurationMaxValue.ProtobufOutput -Required.JsonInput.DurationMinValue.JsonOutput -Required.JsonInput.DurationMinValue.ProtobufOutput -Required.JsonInput.DurationRepeatedValue.JsonOutput -Required.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.JsonInput.EnumField.ProtobufOutput -Required.JsonInput.EnumFieldNumericValueNonZero.JsonOutput -Required.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput -Required.JsonInput.EnumFieldNumericValueZero.JsonOutput -Required.JsonInput.EnumFieldNumericValueZero.ProtobufOutput -Required.JsonInput.EnumFieldUnknownValue.Validator -Required.JsonInput.FieldMask.JsonOutput -Required.JsonInput.FieldMask.ProtobufOutput -Required.JsonInput.FloatFieldInfinity.JsonOutput -Required.JsonInput.FloatFieldInfinity.ProtobufOutput -Required.JsonInput.FloatFieldNan.JsonOutput -Required.JsonInput.FloatFieldNan.ProtobufOutput -Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput -Required.JsonInput.FloatFieldQuotedValue.JsonOutput -Required.JsonInput.FloatFieldQuotedValue.ProtobufOutput -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.Int32FieldExponentialFormat.JsonOutput -Required.JsonInput.Int32FieldExponentialFormat.ProtobufOutput -Required.JsonInput.Int32FieldFloatTrailingZero.JsonOutput -Required.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput -Required.JsonInput.Int32FieldMaxFloatValue.JsonOutput -Required.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput -Required.JsonInput.Int32FieldMinFloatValue.JsonOutput -Required.JsonInput.Int32FieldMinFloatValue.ProtobufOutput -Required.JsonInput.Int32FieldStringValue.JsonOutput -Required.JsonInput.Int32FieldStringValue.ProtobufOutput -Required.JsonInput.Int32FieldStringValueEscaped.JsonOutput -Required.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput -Required.JsonInput.Int64FieldMaxValue.JsonOutput -Required.JsonInput.Int64FieldMaxValue.ProtobufOutput -Required.JsonInput.Int64FieldMinValue.JsonOutput -Required.JsonInput.Int64FieldMinValue.ProtobufOutput -Required.JsonInput.MessageField.JsonOutput -Required.JsonInput.MessageField.ProtobufOutput -Required.JsonInput.OptionalBoolWrapper.JsonOutput -Required.JsonInput.OptionalBoolWrapper.ProtobufOutput -Required.JsonInput.OptionalBytesWrapper.JsonOutput -Required.JsonInput.OptionalBytesWrapper.ProtobufOutput -Required.JsonInput.OptionalDoubleWrapper.JsonOutput -Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput -Required.JsonInput.OptionalFloatWrapper.JsonOutput -Required.JsonInput.OptionalFloatWrapper.ProtobufOutput -Required.JsonInput.OptionalInt32Wrapper.JsonOutput -Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput -Required.JsonInput.OptionalInt64Wrapper.JsonOutput -Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput -Required.JsonInput.OptionalStringWrapper.JsonOutput -Required.JsonInput.OptionalStringWrapper.ProtobufOutput -Required.JsonInput.OptionalUint32Wrapper.JsonOutput -Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput -Required.JsonInput.OptionalUint64Wrapper.JsonOutput -Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput -Required.JsonInput.RepeatedBoolWrapper.JsonOutput -Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput -Required.JsonInput.RepeatedBytesWrapper.JsonOutput -Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput -Required.JsonInput.RepeatedDoubleWrapper.JsonOutput -Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt -Required.JsonInput.RepeatedFloatWrapper.JsonOutput -Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput -Required.JsonInput.RepeatedInt32Wrapper.JsonOutput -Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedInt64Wrapper.JsonOutput -Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput -Required.JsonInput.RepeatedStringWrapper.JsonOutput -Required.JsonInput.RepeatedStringWrapper.ProtobufOutput -Required.JsonInput.RepeatedUint32Wrapper.JsonOutput -Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedUint64Wrapper.JsonOutput -Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput -Required.JsonInput.StringFieldEscape.JsonOutput -Required.JsonInput.StringFieldEscape.ProtobufOutput -Required.JsonInput.StringFieldNotAString -Required.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.JsonInput.StringFieldUnicodeEscape.JsonOutput -Required.JsonInput.StringFieldUnicodeEscape.ProtobufOutput -Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput -Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput -Required.JsonInput.Struct.JsonOutput -Required.JsonInput.Struct.ProtobufOutput -Required.JsonInput.TimestampMaxValue.JsonOutput -Required.JsonInput.TimestampMaxValue.ProtobufOutput -Required.JsonInput.TimestampMinValue.JsonOutput -Required.JsonInput.TimestampMinValue.ProtobufOutput -Required.JsonInput.TimestampRepeatedValue.JsonOutput -Required.JsonInput.TimestampRepeatedValue.ProtobufOutput -Required.JsonInput.TimestampWithNegativeOffset.JsonOutput -Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput -Required.JsonInput.TimestampWithPositiveOffset.JsonOutput -Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.JsonInput.Uint32FieldMaxFloatValue.JsonOutput -Required.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput -Required.JsonInput.Uint64FieldMaxValue.JsonOutput -Required.JsonInput.Uint64FieldMaxValue.ProtobufOutput -Required.JsonInput.ValueAcceptBool.JsonOutput -Required.JsonInput.ValueAcceptBool.ProtobufOutput -Required.JsonInput.ValueAcceptFloat.JsonOutput -Required.JsonInput.ValueAcceptFloat.ProtobufOutput -Required.JsonInput.ValueAcceptInteger.JsonOutput -Required.JsonInput.ValueAcceptInteger.ProtobufOutput -Required.JsonInput.ValueAcceptList.JsonOutput -Required.JsonInput.ValueAcceptList.ProtobufOutput -Required.JsonInput.ValueAcceptNull.JsonOutput -Required.JsonInput.ValueAcceptNull.ProtobufOutput -Required.JsonInput.ValueAcceptObject.JsonOutput -Required.JsonInput.ValueAcceptObject.ProtobufOutput -Required.JsonInput.ValueAcceptString.JsonOutput -Required.JsonInput.ValueAcceptString.ProtobufOutput -Required.JsonInput.WrapperTypesWithNullValue.ProtobufOutput -Required.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput +Required.Proto3.JsonInput.AllFieldAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.Any.JsonOutput +Required.Proto3.JsonInput.Any.ProtobufOutput +Required.Proto3.JsonInput.AnyNested.JsonOutput +Required.Proto3.JsonInput.AnyNested.ProtobufOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput +Required.Proto3.JsonInput.AnyWithDuration.JsonOutput +Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput +Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput +Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput +Required.Proto3.JsonInput.AnyWithStruct.JsonOutput +Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput +Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput +Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput +Required.Proto3.JsonInput.BoolFieldFalse.ProtobufOutput +Required.Proto3.JsonInput.BoolMapField.JsonOutput +Required.Proto3.JsonInput.DoubleFieldInfinity.JsonOutput +Required.Proto3.JsonInput.DoubleFieldInfinity.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput +Required.Proto3.JsonInput.DoubleFieldNan.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldQuotedValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldQuotedValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMaxValue.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMinValue.JsonOutput +Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput +Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput +Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.EnumField.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.JsonOutput +Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNumericValueZero.JsonOutput +Required.Proto3.JsonInput.EnumFieldNumericValueZero.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator +Required.Proto3.JsonInput.FieldMask.JsonOutput +Required.Proto3.JsonInput.FieldMask.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldInfinity.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldNan.JsonOutput +Required.Proto3.JsonInput.FloatFieldNan.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldQuotedValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldQuotedValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.Int32FieldExponentialFormat.JsonOutput +Required.Proto3.JsonInput.Int32FieldExponentialFormat.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.JsonOutput +Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMaxFloatValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMinFloatValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMinFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldStringValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldStringValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldStringValueEscaped.JsonOutput +Required.Proto3.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput +Required.Proto3.JsonInput.MessageField.JsonOutput +Required.Proto3.JsonInput.MessageField.ProtobufOutput +Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt +Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.StringFieldEscape.JsonOutput +Required.Proto3.JsonInput.StringFieldEscape.ProtobufOutput +Required.Proto3.JsonInput.StringFieldNotAString +Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscape.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscape.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput +Required.Proto3.JsonInput.Struct.JsonOutput +Required.Proto3.JsonInput.Struct.ProtobufOutput +Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput +Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampMinValue.JsonOutput +Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput +Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.JsonOutput +Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput +Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput +Required.Proto3.JsonInput.ValueAcceptFloat.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptInteger.JsonOutput +Required.Proto3.JsonInput.ValueAcceptInteger.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptList.JsonOutput +Required.Proto3.JsonInput.ValueAcceptList.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptNull.JsonOutput +Required.Proto3.JsonInput.ValueAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput +Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptString.JsonOutput +Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput +Required.Proto3.JsonInput.WrapperTypesWithNullValue.ProtobufOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput diff --git a/conformance/failure_list_python.txt b/conformance/failure_list_python.txt index 965b8212a5..7b01017895 100644 --- a/conformance/failure_list_python.txt +++ b/conformance/failure_list_python.txt @@ -1,17 +1,21 @@ -Recommended.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.JsonInput.DoubleFieldNanNotQuoted -Recommended.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.JsonInput.FloatFieldInfinityNotQuoted -Recommended.JsonInput.FloatFieldNanNotQuoted -Recommended.JsonInput.FloatFieldNegativeInfinityNotQuoted -Required.JsonInput.BytesFieldInvalidBase64Characters -Required.JsonInput.DoubleFieldTooSmall -Required.JsonInput.EnumFieldUnknownValue.Validator -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -Required.JsonInput.TimestampJsonInputLowercaseT -Required.ProtobufInput.IllegalZeroFieldNum_Case_0 -Required.ProtobufInput.IllegalZeroFieldNum_Case_1 -Required.ProtobufInput.IllegalZeroFieldNum_Case_2 -Required.ProtobufInput.IllegalZeroFieldNum_Case_3 +Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted +Required.Proto3.JsonInput.BytesFieldInvalidBase64Characters +Required.Proto3.JsonInput.DoubleFieldTooSmall +Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool +Required.Proto3.JsonInput.TimestampJsonInputLowercaseT +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_0 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_1 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_2 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_3 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_0 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_1 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_2 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_3 diff --git a/conformance/failure_list_python_cpp.txt b/conformance/failure_list_python_cpp.txt index 92404d2f6a..ab946d9d4e 100644 --- a/conformance/failure_list_python_cpp.txt +++ b/conformance/failure_list_python_cpp.txt @@ -7,32 +7,48 @@ # TODO(haberman): insert links to corresponding bugs tracking the issue. # Should we use GitHub issues or the Google-internal bug tracker? -Recommended.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.JsonInput.DoubleFieldNanNotQuoted -Recommended.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.JsonInput.FloatFieldInfinityNotQuoted -Recommended.JsonInput.FloatFieldNanNotQuoted -Recommended.JsonInput.FloatFieldNegativeInfinityNotQuoted -Required.JsonInput.BytesFieldInvalidBase64Characters -Required.JsonInput.DoubleFieldTooSmall -Required.JsonInput.EnumFieldUnknownValue.Validator -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -Required.JsonInput.TimestampJsonInputLowercaseT -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE -Required.ProtobufInput.PrematureEofInPackedField.BOOL -Required.ProtobufInput.PrematureEofInPackedField.DOUBLE -Required.ProtobufInput.PrematureEofInPackedField.ENUM -Required.ProtobufInput.PrematureEofInPackedField.FIXED32 -Required.ProtobufInput.PrematureEofInPackedField.FIXED64 -Required.ProtobufInput.PrematureEofInPackedField.FLOAT -Required.ProtobufInput.PrematureEofInPackedField.INT32 -Required.ProtobufInput.PrematureEofInPackedField.INT64 -Required.ProtobufInput.PrematureEofInPackedField.SFIXED32 -Required.ProtobufInput.PrematureEofInPackedField.SFIXED64 -Required.ProtobufInput.PrematureEofInPackedField.SINT32 -Required.ProtobufInput.PrematureEofInPackedField.SINT64 -Required.ProtobufInput.PrematureEofInPackedField.UINT32 -Required.ProtobufInput.PrematureEofInPackedField.UINT64 +Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted +Required.Proto3.JsonInput.BytesFieldInvalidBase64Characters +Required.Proto3.JsonInput.DoubleFieldTooSmall +Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool +Required.Proto3.JsonInput.TimestampJsonInputLowercaseT +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInPackedField.BOOL +Required.Proto3.ProtobufInput.PrematureEofInPackedField.DOUBLE +Required.Proto3.ProtobufInput.PrematureEofInPackedField.ENUM +Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.FLOAT +Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT64 +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInPackedField.BOOL +Required.Proto2.ProtobufInput.PrematureEofInPackedField.DOUBLE +Required.Proto2.ProtobufInput.PrematureEofInPackedField.ENUM +Required.Proto2.ProtobufInput.PrematureEofInPackedField.FIXED32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.FIXED64 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.FLOAT +Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT64 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.SFIXED32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.SFIXED64 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT64 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT32 +Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT64 diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt index d899ee40d1..a8d2e3f553 100644 --- a/conformance/failure_list_ruby.txt +++ b/conformance/failure_list_ruby.txt @@ -1,135 +1,135 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.JsonInput.DurationHas9FractionalDigits.Validator -Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.JsonInput.Int64FieldBeString.Validator -Recommended.JsonInput.MapFieldValueIsNull -Recommended.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.JsonInput.StringEndsWithEscapeChar -Recommended.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.JsonInput.TimestampHas9FractionalDigits.Validator -Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator -Recommended.JsonInput.TimestampZeroNormalized.Validator -Recommended.JsonInput.Uint64FieldBeString.Validator +Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.Int64FieldBeString.Validator +Recommended.Proto3.JsonInput.MapFieldValueIsNull +Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull +Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.Proto3.JsonInput.StringEndsWithEscapeChar +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator +Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator Required.DurationProtoInputTooLarge.JsonOutput Required.DurationProtoInputTooSmall.JsonOutput -Required.JsonInput.Any.JsonOutput -Required.JsonInput.Any.ProtobufOutput -Required.JsonInput.AnyNested.JsonOutput -Required.JsonInput.AnyNested.ProtobufOutput -Required.JsonInput.AnyUnorderedTypeTag.JsonOutput -Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput -Required.JsonInput.AnyWithDuration.JsonOutput -Required.JsonInput.AnyWithDuration.ProtobufOutput -Required.JsonInput.AnyWithFieldMask.JsonOutput -Required.JsonInput.AnyWithFieldMask.ProtobufOutput -Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput -Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput -Required.JsonInput.AnyWithStruct.JsonOutput -Required.JsonInput.AnyWithStruct.ProtobufOutput -Required.JsonInput.AnyWithTimestamp.JsonOutput -Required.JsonInput.AnyWithTimestamp.ProtobufOutput -Required.JsonInput.AnyWithValueForInteger.JsonOutput -Required.JsonInput.AnyWithValueForInteger.ProtobufOutput -Required.JsonInput.AnyWithValueForJsonObject.JsonOutput -Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.JsonInput.DoubleFieldNan.JsonOutput -Required.JsonInput.DurationMaxValue.JsonOutput -Required.JsonInput.DurationMaxValue.ProtobufOutput -Required.JsonInput.DurationMinValue.JsonOutput -Required.JsonInput.DurationMinValue.ProtobufOutput -Required.JsonInput.DurationRepeatedValue.JsonOutput -Required.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.JsonInput.FieldMask.JsonOutput -Required.JsonInput.FieldMask.ProtobufOutput -Required.JsonInput.FloatFieldInfinity.JsonOutput -Required.JsonInput.FloatFieldNan.JsonOutput -Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.JsonInput.FloatFieldTooLarge -Required.JsonInput.FloatFieldTooSmall -Required.JsonInput.OneofFieldDuplicate -Required.JsonInput.OptionalBoolWrapper.JsonOutput -Required.JsonInput.OptionalBoolWrapper.ProtobufOutput -Required.JsonInput.OptionalBytesWrapper.JsonOutput -Required.JsonInput.OptionalBytesWrapper.ProtobufOutput -Required.JsonInput.OptionalDoubleWrapper.JsonOutput -Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput -Required.JsonInput.OptionalFloatWrapper.JsonOutput -Required.JsonInput.OptionalFloatWrapper.ProtobufOutput -Required.JsonInput.OptionalInt32Wrapper.JsonOutput -Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput -Required.JsonInput.OptionalInt64Wrapper.JsonOutput -Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput -Required.JsonInput.OptionalStringWrapper.JsonOutput -Required.JsonInput.OptionalStringWrapper.ProtobufOutput -Required.JsonInput.OptionalUint32Wrapper.JsonOutput -Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput -Required.JsonInput.OptionalUint64Wrapper.JsonOutput -Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput -Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput -Required.JsonInput.RepeatedBoolWrapper.JsonOutput -Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput -Required.JsonInput.RepeatedBytesWrapper.JsonOutput -Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput -Required.JsonInput.RepeatedDoubleWrapper.JsonOutput -Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput -Required.JsonInput.RepeatedFloatWrapper.JsonOutput -Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput -Required.JsonInput.RepeatedInt32Wrapper.JsonOutput -Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedInt64Wrapper.JsonOutput -Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput -Required.JsonInput.RepeatedStringWrapper.JsonOutput -Required.JsonInput.RepeatedStringWrapper.ProtobufOutput -Required.JsonInput.RepeatedUint32Wrapper.JsonOutput -Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput -Required.JsonInput.RepeatedUint64Wrapper.JsonOutput -Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput -Required.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.JsonInput.Struct.JsonOutput -Required.JsonInput.Struct.ProtobufOutput -Required.JsonInput.TimestampMaxValue.JsonOutput -Required.JsonInput.TimestampMaxValue.ProtobufOutput -Required.JsonInput.TimestampMinValue.JsonOutput -Required.JsonInput.TimestampMinValue.ProtobufOutput -Required.JsonInput.TimestampRepeatedValue.JsonOutput -Required.JsonInput.TimestampRepeatedValue.ProtobufOutput -Required.JsonInput.TimestampWithNegativeOffset.JsonOutput -Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput -Required.JsonInput.TimestampWithPositiveOffset.JsonOutput -Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.JsonInput.ValueAcceptBool.JsonOutput -Required.JsonInput.ValueAcceptBool.ProtobufOutput -Required.JsonInput.ValueAcceptFloat.JsonOutput -Required.JsonInput.ValueAcceptFloat.ProtobufOutput -Required.JsonInput.ValueAcceptInteger.JsonOutput -Required.JsonInput.ValueAcceptInteger.ProtobufOutput -Required.JsonInput.ValueAcceptList.JsonOutput -Required.JsonInput.ValueAcceptList.ProtobufOutput -Required.JsonInput.ValueAcceptNull.JsonOutput -Required.JsonInput.ValueAcceptNull.ProtobufOutput -Required.JsonInput.ValueAcceptObject.JsonOutput -Required.JsonInput.ValueAcceptObject.ProtobufOutput -Required.JsonInput.ValueAcceptString.JsonOutput -Required.JsonInput.ValueAcceptString.ProtobufOutput -Required.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput +Required.Proto3.JsonInput.Any.JsonOutput +Required.Proto3.JsonInput.Any.ProtobufOutput +Required.Proto3.JsonInput.AnyNested.JsonOutput +Required.Proto3.JsonInput.AnyNested.ProtobufOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput +Required.Proto3.JsonInput.AnyWithDuration.JsonOutput +Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput +Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput +Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput +Required.Proto3.JsonInput.AnyWithStruct.JsonOutput +Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput +Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput +Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMinValue.JsonOutput +Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput +Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput +Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.FieldMask.JsonOutput +Required.Proto3.JsonInput.FieldMask.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldNan.JsonOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.OneofFieldDuplicate +Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput +Required.Proto3.JsonInput.Struct.JsonOutput +Required.Proto3.JsonInput.Struct.ProtobufOutput +Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput +Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampMinValue.JsonOutput +Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput +Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput +Required.Proto3.JsonInput.ValueAcceptFloat.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptInteger.JsonOutput +Required.Proto3.JsonInput.ValueAcceptInteger.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptList.JsonOutput +Required.Proto3.JsonInput.ValueAcceptList.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptNull.JsonOutput +Required.Proto3.JsonInput.ValueAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput +Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptString.JsonOutput +Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 2f30036cd1..96dc354e99 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -48,7 +48,7 @@ namespace Google.Protobuf.Conformance // This way we get the binary streams instead of readers/writers. var input = new BinaryReader(Console.OpenStandardInput()); var output = new BinaryWriter(Console.OpenStandardOutput()); - var typeRegistry = TypeRegistry.FromMessages(ProtobufTestMessages.Proto3.TestAllTypes.Descriptor); + var typeRegistry = TypeRegistry.FromMessages(ProtobufTestMessages.Proto3.TestAllTypesProto3.Descriptor); int count = 0; while (RunTest(input, output, typeRegistry)) @@ -81,20 +81,20 @@ namespace Google.Protobuf.Conformance private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry) { - ProtobufTestMessages.Proto3.TestAllTypes message; + ProtobufTestMessages.Proto3.TestAllTypesProto3 message; try { switch (request.PayloadCase) { case ConformanceRequest.PayloadOneofCase.JsonPayload: var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); - message = parser.Parse(request.JsonPayload); + message = parser.Parse(request.JsonPayload); break; case ConformanceRequest.PayloadOneofCase.ProtobufPayload: { - if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypes")) + if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3")) { - message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload); + message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); } else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) { diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto index 58fb006022..cbe0d17085 100644 --- a/src/google/protobuf/test_messages_proto2.proto +++ b/src/google/protobuf/test_messages_proto2.proto @@ -213,4 +213,4 @@ enum ForeignEnum { extend TestAllTypesProto2 { optional int32 extension_int32 = 120; -} \ No newline at end of file +} diff --git a/src/google/protobuf/test_messages_proto3.proto b/src/google/protobuf/test_messages_proto3.proto index 79230334d7..abf7342772 100644 --- a/src/google/protobuf/test_messages_proto3.proto +++ b/src/google/protobuf/test_messages_proto3.proto @@ -59,10 +59,10 @@ option cc_enable_arenas = true; // submessages of this message. So for example, a fuzz test of TestAllTypes // could trigger bugs that occur in any message type in this file. We verify // this stays true in a unit test. -message TestAllTypes { +message TestAllTypesProto3 { message NestedMessage { int32 a = 1; - TestAllTypes corecursive = 2; + TestAllTypesProto3 corecursive = 2; } enum NestedEnum { @@ -98,7 +98,7 @@ message TestAllTypes { string optional_string_piece = 24 [ctype=STRING_PIECE]; string optional_cord = 25 [ctype=CORD]; - TestAllTypes recursive_message = 27; + TestAllTypesProto3 recursive_message = 27; // Repeated repeated int32 repeated_int32 = 31; From 5085102d96ce1e0b50c0c8a906217fdb5ec4a387 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Fri, 30 Jun 2017 17:23:10 -0700 Subject: [PATCH 46/61] remove backup files --- conformance/conformance_objc.m~ | 188 ------------------------------- conformance/conformance_php.php~ | 119 ------------------- conformance/conformance_ruby.rb~ | 131 --------------------- 3 files changed, 438 deletions(-) delete mode 100644 conformance/conformance_objc.m~ delete mode 100755 conformance/conformance_php.php~ delete mode 100755 conformance/conformance_ruby.rb~ diff --git a/conformance/conformance_objc.m~ b/conformance/conformance_objc.m~ deleted file mode 100644 index ba1c946f33..0000000000 --- a/conformance/conformance_objc.m~ +++ /dev/null @@ -1,188 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#import - -#import "Conformance.pbobjc.h" -#import "google/protobuf/TestMessagesProto3.pbobjc.h" - -static void Die(NSString *format, ...) __dead2; - -static BOOL verbose = NO; -static int32_t testCount = 0; - -static void Die(NSString *format, ...) { - va_list args; - va_start(args, format); - NSString *msg = [[NSString alloc] initWithFormat:format arguments:args]; - NSLog(@"%@", msg); - va_end(args); - [msg release]; - exit(66); -} - -static NSData *CheckedReadDataOfLength(NSFileHandle *handle, NSUInteger numBytes) { - NSData *data = [handle readDataOfLength:numBytes]; - NSUInteger dataLen = data.length; - if (dataLen == 0) { - return nil; // EOF. - } - if (dataLen != numBytes) { - Die(@"Failed to read the request length (%d), only got: %@", - numBytes, data); - } - return data; -} - -static ConformanceResponse *DoTest(ConformanceRequest *request) { - ConformanceResponse *response = [ConformanceResponse message]; - TestAllTypesProto3 *testMessage = nil; - - switch (request.payloadOneOfCase) { - case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: - Die(@"Request didn't have a payload: %@", request); - break; - - case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { - if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) { - NSError *error = nil; - testMessage = [TestAllTypesProto3 parseFromData:request.protobufPayload - error:&error]; - if (!testMessage) { - response.parseError = - [NSString stringWithFormat:@"Parse error: %@", error]; - } - } else if ([request.messageType isEqualToString:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) { - response.skipped = @"ObjC doesn't support proto2"; - break; - } else { - Die(@"Protobuf request doesn't have specific payload type"); - break; - } - break; - } - - case ConformanceRequest_Payload_OneOfCase_JsonPayload: - response.skipped = @"ObjC doesn't support parsing JSON"; - break; - } - - if (testMessage) { - switch (request.requestedOutputFormat) { - case WireFormat_GPBUnrecognizedEnumeratorValue: - case WireFormat_Unspecified: - Die(@"Unrecognized/unspecified output format: %@", request); - break; - - case WireFormat_Protobuf: - response.protobufPayload = testMessage.data; - if (!response.protobufPayload) { - response.serializeError = - [NSString stringWithFormat:@"Failed to make data from: %@", testMessage]; - } - break; - - case WireFormat_Json: - response.skipped = @"ObjC doesn't support generating JSON"; - break; - } - } - - return response; -} - -static uint32_t UInt32FromLittleEndianData(NSData *data) { - if (data.length != sizeof(uint32_t)) { - Die(@"Data not the right size for uint32_t: %@", data); - } - uint32_t value; - memcpy(&value, data.bytes, sizeof(uint32_t)); - return CFSwapInt32LittleToHost(value); -} - -static NSData *UInt32ToLittleEndianData(uint32_t num) { - uint32_t value = CFSwapInt32HostToLittle(num); - return [NSData dataWithBytes:&value length:sizeof(uint32_t)]; -} - -static BOOL DoTestIo(NSFileHandle *input, NSFileHandle *output) { - // See conformance_test_runner.cc for the wire format. - NSData *data = CheckedReadDataOfLength(input, sizeof(uint32_t)); - if (!data) { - // EOF. - return NO; - } - uint32_t numBytes = UInt32FromLittleEndianData(data); - data = CheckedReadDataOfLength(input, numBytes); - if (!data) { - Die(@"Failed to read request"); - } - - NSError *error = nil; - ConformanceRequest *request = [ConformanceRequest parseFromData:data - error:&error]; - if (!request) { - Die(@"Failed to parse the message data: %@", error); - } - - ConformanceResponse *response = DoTest(request); - if (!response) { - Die(@"Failed to make a reply from %@", request); - } - - data = response.data; - [output writeData:UInt32ToLittleEndianData((int32_t)data.length)]; - [output writeData:data]; - - if (verbose) { - NSLog(@"Request: %@", request); - NSLog(@"Response: %@", response); - } - - ++testCount; - return YES; -} - -int main(int argc, const char *argv[]) { - @autoreleasepool { - NSFileHandle *input = [[NSFileHandle fileHandleWithStandardInput] retain]; - NSFileHandle *output = [[NSFileHandle fileHandleWithStandardOutput] retain]; - - BOOL notDone = YES; - while (notDone) { - @autoreleasepool { - notDone = DoTestIo(input, output); - } - } - - NSLog(@"Received EOF from test runner after %d tests, exiting.", testCount); - } - return 0; -} diff --git a/conformance/conformance_php.php~ b/conformance/conformance_php.php~ deleted file mode 100755 index ca2292ad46..0000000000 --- a/conformance/conformance_php.php~ +++ /dev/null @@ -1,119 +0,0 @@ -getPayload() == "protobuf_payload") { - if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") { - try { - $test_message->mergeFromString($request->getProtobufPayload()); - } catch (Exception $e) { - $response->setParseError($e->getMessage()); - return $response; - } - } elseif ($request->getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2") { - $response->setSkipped("PHP doesn't support proto2"); - return $response; - } else { - trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR); - } - } elseif ($request->getPayload() == "json_payload") { - try { - $test_message->jsonDecode($request->getJsonPayload()); - } catch (Exception $e) { - $response->setParseError($e->getMessage()); - return $response; - } - } else { - trigger_error("Request didn't have payload.", E_USER_ERROR); - } - - if ($request->getRequestedOutputFormat() == WireFormat::UNSPECIFIED) { - trigger_error("Unspecified output format.", E_USER_ERROR); - } elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) { - $response->setProtobufPayload($test_message->serializeToString()); - } elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) { - $response->setJsonPayload($test_message->jsonEncode()); - } - - return $response; -} - -function doTestIO() -{ - $length_bytes = fread(STDIN, 4); - if (strlen($length_bytes) == 0) { - return false; # EOF - } elseif (strlen($length_bytes) != 4) { - trigger_error("I/O error", E_USER_ERROR); - } - - $length = unpack("V", $length_bytes)[1]; - $serialized_request = fread(STDIN, $length); - if (strlen($serialized_request) != $length) { - trigger_error("I/O error", E_USER_ERROR); - } - - $request = new \Conformance\ConformanceRequest(); - $request->mergeFromString($serialized_request); - - $response = doTest($request); - - $serialized_response = $response->serializeToString(); - fwrite(STDOUT, pack("V", strlen($serialized_response))); - fwrite(STDOUT, $serialized_response); - - $GLOBALS['test_count'] += 1; - - return true; -} - -while(true){ - if (!doTestIO()) { - fprintf(STDERR, - "conformance_php: received EOF from test runner " + - "after %d tests, exiting\n", $test_count); - exit; - } -} diff --git a/conformance/conformance_ruby.rb~ b/conformance/conformance_ruby.rb~ deleted file mode 100755 index df63bf7ced..0000000000 --- a/conformance/conformance_ruby.rb~ +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env ruby -# -# Protocol Buffers - Google's data interchange format -# Copyright 2008 Google Inc. All rights reserved. -# https://developers.google.com/protocol-buffers/ -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -require 'conformance_pb' -require 'google/protobuf/test_messages_proto3_pb' - -$test_count = 0 -$verbose = false - -def do_test(request) - test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.new - response = Conformance::ConformanceResponse.new - - begin - case request.payload - when :protobuf_payload - if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypesProto3') - begin - test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode( - request.protobuf_payload) - rescue Google::Protobuf::ParseError => err - response.parse_error = err.message.encode('utf-8') - return response - end - elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2') - response.skipped = "Ruby doesn't support proto2" - return response - else - fail "Protobuf request doesn't have specific payload type" - end - - when :json_payload - begin - test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.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" - end - - case request.requested_output_format - when :UNSPECIFIED - fail 'Unspecified output format' - - when :PROTOBUF - response.protobuf_payload = test_message.to_proto - - 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') - end - - response -end - -# Returns true if the test ran successfully, false on legitimate EOF. -# If EOF is encountered in an unexpected place, raises IOError. -def do_test_io - length_bytes = STDIN.read(4) - return false if length_bytes.nil? - - length = length_bytes.unpack('V').first - serialized_request = STDIN.read(length) - if serialized_request.nil? || serialized_request.length != length - fail IOError - end - - request = Conformance::ConformanceRequest.decode(serialized_request) - - response = do_test(request) - - serialized_response = Conformance::ConformanceResponse.encode(response) - STDOUT.write([serialized_response.length].pack('V')) - STDOUT.write(serialized_response) - STDOUT.flush - - if $verbose - STDERR.puts("conformance_ruby: request=#{request.to_json}, " \ - "response=#{response.to_json}\n") - end - - $test_count += 1 - - true -end - -loop do - unless do_test_io - STDERR.puts('conformance_ruby: received EOF from test runner ' \ - "after #{$test_count} tests, exiting") - break - end -end From 726ba33d98cd06c268f88b7dedf2a9a7916d978d Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Fri, 30 Jun 2017 17:34:58 -0700 Subject: [PATCH 47/61] changed php's failing list --- conformance/failure_list_php.txt | 513 +---------------------------- conformance/failure_list_php_c.txt | 32 +- 2 files changed, 11 insertions(+), 534 deletions(-) diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt index c7898bda4c..ab9413bf0c 100644 --- a/conformance/failure_list_php.txt +++ b/conformance/failure_list_php.txt @@ -1,117 +1,17 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse -Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue -Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse -Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue -Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse -Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue -Recommended.Proto3.JsonInput.BoolFieldIntegerOne -Recommended.Proto3.JsonInput.BoolFieldIntegerZero -Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter -Recommended.Proto3.JsonInput.FieldNameDuplicate -Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing1 -Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing2 -Recommended.Proto3.JsonInput.FieldNameNotQuoted -Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.JsonOutput -Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput -Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.Validator -Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted -Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted -Recommended.Proto3.JsonInput.Int64FieldBeString.Validator -Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted -Recommended.Proto3.JsonInput.JsonWithComments -Recommended.Proto3.JsonInput.MapFieldKeyIsNull -Recommended.Proto3.JsonInput.MapFieldValueIsNull -Recommended.Proto3.JsonInput.MissingCommaMultiline -Recommended.Proto3.JsonInput.MissingCommaOneLine -Recommended.Proto3.JsonInput.MultilineNoSpaces.JsonOutput -Recommended.Proto3.JsonInput.MultilineNoSpaces.ProtobufOutput -Recommended.Proto3.JsonInput.MultilineWithSpaces.JsonOutput -Recommended.Proto3.JsonInput.MultilineWithSpaces.ProtobufOutput -Recommended.Proto3.JsonInput.OneLineNoSpaces.JsonOutput -Recommended.Proto3.JsonInput.OneLineNoSpaces.ProtobufOutput -Recommended.Proto3.JsonInput.OneLineWithSpaces.JsonOutput -Recommended.Proto3.JsonInput.OneLineWithSpaces.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroBool.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroBool.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroBytes.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroDouble.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroDouble.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroEnum.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroEnum.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroFloat.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroFloat.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroMessage.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroMessage.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroString.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroString.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroUint32.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroUint32.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroUint64.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroUint64.ProtobufOutput -Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.Proto3.JsonInput.RepeatedFieldTrailingComma -Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines -Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace -Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace -Recommended.Proto3.JsonInput.StringEndsWithEscapeChar -Recommended.Proto3.JsonInput.StringFieldInvalidEscape -Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth -Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey -Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue -Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.Proto3.JsonInput.StringFieldUnterminatedEscape -Recommended.Proto3.JsonInput.StringFieldUppercaseEscapeLetter Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator -Recommended.Proto3.JsonInput.TrailingCommaInAnObject -Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines -Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace -Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace -Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted -Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator -Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted -Recommended.Proto3.ProtobufInput.OneofZeroBool.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroBool.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroDouble.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroDouble.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroEnum.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroEnum.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroFloat.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroFloat.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroMessage.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroMessage.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint32.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint32.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint64.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint64.ProtobufOutput Required.DurationProtoInputTooLarge.JsonOutput Required.DurationProtoInputTooSmall.JsonOutput -Required.Proto3.JsonInput.AllFieldAcceptNull.JsonOutput -Required.Proto3.JsonInput.AllFieldAcceptNull.ProtobufOutput Required.Proto3.JsonInput.Any.JsonOutput Required.Proto3.JsonInput.Any.ProtobufOutput Required.Proto3.JsonInput.AnyNested.JsonOutput @@ -132,141 +32,14 @@ Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.Proto3.JsonInput.BoolFieldFalse.JsonOutput -Required.Proto3.JsonInput.BoolFieldFalse.ProtobufOutput -Required.Proto3.JsonInput.BoolFieldTrue.JsonOutput -Required.Proto3.JsonInput.BoolFieldTrue.ProtobufOutput -Required.Proto3.JsonInput.BoolMapEscapedKey.JsonOutput -Required.Proto3.JsonInput.BoolMapEscapedKey.ProtobufOutput -Required.Proto3.JsonInput.BoolMapField.JsonOutput -Required.Proto3.JsonInput.BoolMapField.ProtobufOutput -Required.Proto3.JsonInput.BytesField.JsonOutput -Required.Proto3.JsonInput.BytesField.ProtobufOutput -Required.Proto3.JsonInput.BytesFieldInvalidBase64Characters -Required.Proto3.JsonInput.BytesRepeatedField.JsonOutput -Required.Proto3.JsonInput.BytesRepeatedField.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldInfinity.JsonOutput -Required.Proto3.JsonInput.DoubleFieldInfinity.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput -Required.Proto3.JsonInput.DoubleFieldNan.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.JsonOutput -Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldQuotedValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldQuotedValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldTooLarge -Required.Proto3.JsonInput.DoubleFieldTooSmall -Required.Proto3.JsonInput.DurationJsonInputTooLarge -Required.Proto3.JsonInput.DurationJsonInputTooSmall Required.Proto3.JsonInput.DurationMaxValue.JsonOutput Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput Required.Proto3.JsonInput.DurationMinValue.JsonOutput Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput -Required.Proto3.JsonInput.DurationMissingS Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.Proto3.JsonInput.EnumField.JsonOutput -Required.Proto3.JsonInput.EnumField.ProtobufOutput -Required.Proto3.JsonInput.EnumFieldNotQuoted -Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.JsonOutput -Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput -Required.Proto3.JsonInput.EnumFieldNumericValueZero.JsonOutput -Required.Proto3.JsonInput.EnumFieldNumericValueZero.ProtobufOutput -Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator -Required.Proto3.JsonInput.EnumRepeatedField.JsonOutput -Required.Proto3.JsonInput.EnumRepeatedField.ProtobufOutput Required.Proto3.JsonInput.FieldMask.JsonOutput Required.Proto3.JsonInput.FieldMask.ProtobufOutput -Required.Proto3.JsonInput.FieldNameEscaped.JsonOutput -Required.Proto3.JsonInput.FieldNameEscaped.ProtobufOutput -Required.Proto3.JsonInput.FieldNameInLowerCamelCase.Validator -Required.Proto3.JsonInput.FieldNameInSnakeCase.JsonOutput -Required.Proto3.JsonInput.FieldNameInSnakeCase.ProtobufOutput -Required.Proto3.JsonInput.FieldNameWithMixedCases.JsonOutput -Required.Proto3.JsonInput.FieldNameWithMixedCases.ProtobufOutput -Required.Proto3.JsonInput.FieldNameWithMixedCases.Validator -Required.Proto3.JsonInput.FieldNameWithNumbers.JsonOutput -Required.Proto3.JsonInput.FieldNameWithNumbers.ProtobufOutput -Required.Proto3.JsonInput.FieldNameWithNumbers.Validator -Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput -Required.Proto3.JsonInput.FloatFieldInfinity.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldMaxNegativeValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldMaxNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldMaxPositiveValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldMaxPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldMinNegativeValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldMinNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldMinPositiveValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldMinPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldNan.JsonOutput -Required.Proto3.JsonInput.FloatFieldNan.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.Proto3.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldQuotedValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldQuotedValue.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldTooLarge -Required.Proto3.JsonInput.FloatFieldTooSmall -Required.Proto3.JsonInput.HelloWorld.JsonOutput -Required.Proto3.JsonInput.HelloWorld.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldExponentialFormat.JsonOutput -Required.Proto3.JsonInput.Int32FieldExponentialFormat.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.JsonOutput -Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldLeadingSpace -Required.Proto3.JsonInput.Int32FieldLeadingZero -Required.Proto3.JsonInput.Int32FieldMaxFloatValue.JsonOutput -Required.Proto3.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldMaxValue.JsonOutput -Required.Proto3.JsonInput.Int32FieldMaxValue.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldMinFloatValue.JsonOutput -Required.Proto3.JsonInput.Int32FieldMinFloatValue.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldMinValue.JsonOutput -Required.Proto3.JsonInput.Int32FieldMinValue.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero -Required.Proto3.JsonInput.Int32FieldNotInteger -Required.Proto3.JsonInput.Int32FieldNotNumber -Required.Proto3.JsonInput.Int32FieldPlusSign -Required.Proto3.JsonInput.Int32FieldStringValue.JsonOutput -Required.Proto3.JsonInput.Int32FieldStringValue.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldStringValueEscaped.JsonOutput -Required.Proto3.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput -Required.Proto3.JsonInput.Int32FieldTooLarge -Required.Proto3.JsonInput.Int32FieldTooSmall -Required.Proto3.JsonInput.Int32FieldTrailingSpace -Required.Proto3.JsonInput.Int32MapEscapedKey.JsonOutput -Required.Proto3.JsonInput.Int32MapEscapedKey.ProtobufOutput -Required.Proto3.JsonInput.Int32MapField.JsonOutput -Required.Proto3.JsonInput.Int32MapField.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput -Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput -Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput -Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput -Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldNotInteger -Required.Proto3.JsonInput.Int64FieldNotNumber -Required.Proto3.JsonInput.Int64FieldTooLarge -Required.Proto3.JsonInput.Int64FieldTooSmall -Required.Proto3.JsonInput.Int64MapEscapedKey.JsonOutput -Required.Proto3.JsonInput.Int64MapEscapedKey.ProtobufOutput -Required.Proto3.JsonInput.Int64MapField.JsonOutput -Required.Proto3.JsonInput.Int64MapField.ProtobufOutput -Required.Proto3.JsonInput.MessageField.JsonOutput -Required.Proto3.JsonInput.MessageField.ProtobufOutput -Required.Proto3.JsonInput.MessageMapField.JsonOutput -Required.Proto3.JsonInput.MessageMapField.ProtobufOutput -Required.Proto3.JsonInput.MessageRepeatedField.JsonOutput -Required.Proto3.JsonInput.MessageRepeatedField.ProtobufOutput -Required.Proto3.JsonInput.OneofFieldDuplicate Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput @@ -287,25 +60,12 @@ Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput -Required.Proto3.JsonInput.OriginalProtoFieldName.JsonOutput -Required.Proto3.JsonInput.OriginalProtoFieldName.ProtobufOutput -Required.Proto3.JsonInput.PrimitiveRepeatedField.JsonOutput -Required.Proto3.JsonInput.PrimitiveRepeatedField.ProtobufOutput Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotMessage -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotString -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotBool -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotString -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotMessage Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput @@ -318,29 +78,8 @@ Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput -Required.Proto3.JsonInput.StringField.JsonOutput -Required.Proto3.JsonInput.StringField.ProtobufOutput -Required.Proto3.JsonInput.StringFieldEscape.JsonOutput -Required.Proto3.JsonInput.StringFieldEscape.ProtobufOutput -Required.Proto3.JsonInput.StringFieldNotAString -Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.Proto3.JsonInput.StringFieldUnicode.JsonOutput -Required.Proto3.JsonInput.StringFieldUnicode.ProtobufOutput -Required.Proto3.JsonInput.StringFieldUnicodeEscape.JsonOutput -Required.Proto3.JsonInput.StringFieldUnicodeEscape.ProtobufOutput -Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput -Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput -Required.Proto3.JsonInput.StringRepeatedField.JsonOutput -Required.Proto3.JsonInput.StringRepeatedField.ProtobufOutput Required.Proto3.JsonInput.Struct.JsonOutput Required.Proto3.JsonInput.Struct.ProtobufOutput -Required.Proto3.JsonInput.TimestampJsonInputLowercaseT -Required.Proto3.JsonInput.TimestampJsonInputLowercaseZ -Required.Proto3.JsonInput.TimestampJsonInputMissingT -Required.Proto3.JsonInput.TimestampJsonInputMissingZ -Required.Proto3.JsonInput.TimestampJsonInputTooLarge -Required.Proto3.JsonInput.TimestampJsonInputTooSmall Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput Required.Proto3.JsonInput.TimestampMinValue.JsonOutput @@ -351,24 +90,6 @@ Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.JsonOutput -Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput -Required.Proto3.JsonInput.Uint32FieldMaxValue.JsonOutput -Required.Proto3.JsonInput.Uint32FieldMaxValue.ProtobufOutput -Required.Proto3.JsonInput.Uint32FieldNotInteger -Required.Proto3.JsonInput.Uint32FieldNotNumber -Required.Proto3.JsonInput.Uint32FieldTooLarge -Required.Proto3.JsonInput.Uint32MapField.JsonOutput -Required.Proto3.JsonInput.Uint32MapField.ProtobufOutput -Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput -Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput -Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput -Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput -Required.Proto3.JsonInput.Uint64FieldNotInteger -Required.Proto3.JsonInput.Uint64FieldNotNumber -Required.Proto3.JsonInput.Uint64FieldTooLarge -Required.Proto3.JsonInput.Uint64MapField.JsonOutput -Required.Proto3.JsonInput.Uint64MapField.ProtobufOutput Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput @@ -383,230 +104,16 @@ Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput Required.Proto3.JsonInput.ValueAcceptString.JsonOutput Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput -Required.Proto3.JsonInput.WrapperTypesWithNullValue.JsonOutput -Required.Proto3.JsonInput.WrapperTypesWithNullValue.ProtobufOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.STRING -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownNonRepeatedValue.UINT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.STRING -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.UINT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.STRING -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofBeforeUnknownValue.UINT64 -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.STRING -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.STRING -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.STRING -Required.Proto3.ProtobufInput.PrematureEofInPackedField.BOOL -Required.Proto3.ProtobufInput.PrematureEofInPackedField.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofInPackedField.ENUM -Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.FLOAT -Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT32 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT64 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT32 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT64 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT32 -Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT64 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.UINT64 -Required.Proto3.ProtobufInput.PrematureEofInSubmessageValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.STRING -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.STRING -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofInsideKnownRepeatedValue.UINT64 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.BOOL -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.BYTES -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.DOUBLE -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.ENUM -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.FIXED32 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.FIXED64 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.FLOAT -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.INT32 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.INT64 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SFIXED32 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SFIXED64 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SINT32 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.SINT64 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.STRING -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.UINT32 -Required.Proto3.ProtobufInput.PrematureEofInsideUnknownValue.UINT64 -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.BOOL.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.BOOL.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.INT32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.INT32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.INT64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.INT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SINT32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SINT32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SINT64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SINT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.UINT32.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.UINT32.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.UINT64.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.UINT64.ProtobufOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.DoubleFieldTooSmall +Required.Proto3.JsonInput.Int32FieldNotInteger +Required.Proto3.JsonInput.Int64FieldNotInteger +Required.Proto3.JsonInput.Uint32FieldNotInteger +Required.Proto3.JsonInput.Uint64FieldNotInteger +Required.Proto3.JsonInput.Int32FieldLeadingSpace +Required.Proto3.JsonInput.OneofFieldDuplicate +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt index 0fb8e94949..2d23da1609 100644 --- a/conformance/failure_list_php_c.txt +++ b/conformance/failure_list_php_c.txt @@ -9,22 +9,10 @@ Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator Recommended.Proto3.JsonInput.Int64FieldBeString.Validator Recommended.Proto3.JsonInput.MapFieldValueIsNull -Recommended.Proto3.JsonInput.OneofZeroBool.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroBool.ProtobufOutput Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput Recommended.Proto3.JsonInput.OneofZeroBytes.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroDouble.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroDouble.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroEnum.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroEnum.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroFloat.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroFloat.ProtobufOutput Recommended.Proto3.JsonInput.OneofZeroString.JsonOutput Recommended.Proto3.JsonInput.OneofZeroString.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroUint32.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroUint32.ProtobufOutput -Recommended.Proto3.JsonInput.OneofZeroUint64.JsonOutput -Recommended.Proto3.JsonInput.OneofZeroUint64.ProtobufOutput Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull Recommended.Proto3.JsonInput.StringEndsWithEscapeChar @@ -37,25 +25,12 @@ Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator -Recommended.Proto3.ProtobufInput.OneofZeroBool.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroBool.ProtobufOutput Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroDouble.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroDouble.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroEnum.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroEnum.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroFloat.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroFloat.ProtobufOutput Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint32.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint32.ProtobufOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint64.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroUint64.ProtobufOutput Required.DurationProtoInputTooLarge.JsonOutput Required.DurationProtoInputTooSmall.JsonOutput -Required.Proto3.JsonInput.AllFieldAcceptNull.ProtobufOutput Required.Proto3.JsonInput.Any.JsonOutput Required.Proto3.JsonInput.Any.ProtobufOutput Required.Proto3.JsonInput.AnyNested.JsonOutput @@ -76,7 +51,6 @@ Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput -Required.Proto3.JsonInput.BoolFieldFalse.ProtobufOutput Required.Proto3.JsonInput.BoolMapField.JsonOutput Required.Proto3.JsonInput.DoubleFieldInfinity.JsonOutput Required.Proto3.JsonInput.DoubleFieldInfinity.ProtobufOutput @@ -100,7 +74,6 @@ Required.Proto3.JsonInput.DurationMinValue.JsonOutput Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.Proto3.JsonInput.EnumField.ProtobufOutput Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.JsonOutput Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput Required.Proto3.JsonInput.EnumFieldNumericValueZero.JsonOutput @@ -215,14 +188,11 @@ Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput Required.Proto3.JsonInput.ValueAcceptString.JsonOutput Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput -Required.Proto3.JsonInput.WrapperTypesWithNullValue.ProtobufOutput Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput From cbf7dfb3233925639de99c2e3aea4c4676e886ad Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 5 Jul 2017 09:48:40 -0700 Subject: [PATCH 48/61] fix php failing list and csharp generated proto --- conformance/failure_list_php.txt | 1 - conformance/failure_list_php_c.txt | 1 - .../Google.Protobuf.Conformance/Program.cs~ | 155 +++++++ .../TestProtos/TestMessagesProto3.cs | 426 +++++++++--------- 4 files changed, 370 insertions(+), 213 deletions(-) create mode 100644 csharp/src/Google.Protobuf.Conformance/Program.cs~ diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt index ab9413bf0c..e06d07a114 100644 --- a/conformance/failure_list_php.txt +++ b/conformance/failure_list_php.txt @@ -116,4 +116,3 @@ Required.Proto3.JsonInput.Uint64FieldNotInteger Required.Proto3.JsonInput.Int32FieldLeadingSpace Required.Proto3.JsonInput.OneofFieldDuplicate Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt index 2d23da1609..2e37884298 100644 --- a/conformance/failure_list_php_c.txt +++ b/conformance/failure_list_php_c.txt @@ -195,4 +195,3 @@ Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput Required.TimestampProtoInputTooLarge.JsonOutput Required.TimestampProtoInputTooSmall.JsonOutput -Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs~ b/csharp/src/Google.Protobuf.Conformance/Program.cs~ new file mode 100644 index 0000000000..96dc354e99 --- /dev/null +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs~ @@ -0,0 +1,155 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Conformance; +using Google.Protobuf.Reflection; +using System; +using System.IO; + +namespace Google.Protobuf.Conformance +{ + /// + /// Conformance tests. The test runner will provide JSON or proto data on stdin, + /// and this program will produce its output on stdout. + /// + class Program + { + private static void Main(string[] args) + { + // This way we get the binary streams instead of readers/writers. + var input = new BinaryReader(Console.OpenStandardInput()); + var output = new BinaryWriter(Console.OpenStandardOutput()); + var typeRegistry = TypeRegistry.FromMessages(ProtobufTestMessages.Proto3.TestAllTypesProto3.Descriptor); + + int count = 0; + while (RunTest(input, output, typeRegistry)) + { + count++; + } + Console.Error.WriteLine("Received EOF after {0} tests", count); + } + + private static bool RunTest(BinaryReader input, BinaryWriter output, TypeRegistry typeRegistry) + { + int? size = ReadInt32(input); + if (size == null) + { + return false; + } + byte[] inputData = input.ReadBytes(size.Value); + if (inputData.Length != size.Value) + { + throw new EndOfStreamException("Read " + inputData.Length + " bytes of data when expecting " + size); + } + ConformanceRequest request = ConformanceRequest.Parser.ParseFrom(inputData); + ConformanceResponse response = PerformRequest(request, typeRegistry); + byte[] outputData = response.ToByteArray(); + output.Write(outputData.Length); + output.Write(outputData); + // Ready for another test... + return true; + } + + private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry) + { + ProtobufTestMessages.Proto3.TestAllTypesProto3 message; + try + { + switch (request.PayloadCase) + { + case ConformanceRequest.PayloadOneofCase.JsonPayload: + var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); + message = parser.Parse(request.JsonPayload); + break; + case ConformanceRequest.PayloadOneofCase.ProtobufPayload: + { + if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3")) + { + message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); + } + else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) + { + return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" }; + } + else + { + throw new Exception(" Protobuf request doesn't have specific payload type"); + } + break; + } + default: + throw new Exception("Unsupported request payload: " + request.PayloadCase); + } + } + catch (InvalidProtocolBufferException e) + { + return new ConformanceResponse { ParseError = e.Message }; + } + catch (InvalidJsonException e) + { + return new ConformanceResponse { ParseError = e.Message }; + } + try + { + switch (request.RequestedOutputFormat) + { + case global::Conformance.WireFormat.Json: + var formatter = new JsonFormatter(new JsonFormatter.Settings(false, typeRegistry)); + return new ConformanceResponse { JsonPayload = formatter.Format(message) }; + case global::Conformance.WireFormat.Protobuf: + return new ConformanceResponse { ProtobufPayload = message.ToByteString() }; + default: + throw new Exception("Unsupported request output format: " + request.PayloadCase); + } + } + catch (InvalidOperationException e) + { + return new ConformanceResponse { SerializeError = e.Message }; + } + } + + private static int? ReadInt32(BinaryReader input) + { + byte[] bytes = input.ReadBytes(4); + if (bytes.Length == 0) + { + // Cleanly reached the end of the stream + return null; + } + if (bytes.Length != 4) + { + throw new EndOfStreamException("Read " + bytes.Length + " bytes of size when expecting 4"); + } + return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24); + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs index fbeb512ac7..076afb3be2 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs @@ -27,168 +27,172 @@ namespace ProtobufTestMessages.Proto3 { "dWYvYW55LnByb3RvGh5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8a", "IGdvb2dsZS9wcm90b2J1Zi9maWVsZF9tYXNrLnByb3RvGhxnb29nbGUvcHJv", "dG9idWYvc3RydWN0LnByb3RvGh9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1w", - "LnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8i+DkKDFRl", - "c3RBbGxUeXBlcxIWCg5vcHRpb25hbF9pbnQzMhgBIAEoBRIWCg5vcHRpb25h", - "bF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25hbF91aW50MzIYAyABKA0SFwoPb3B0", - "aW9uYWxfdWludDY0GAQgASgEEhcKD29wdGlvbmFsX3NpbnQzMhgFIAEoERIX", - "Cg9vcHRpb25hbF9zaW50NjQYBiABKBISGAoQb3B0aW9uYWxfZml4ZWQzMhgH", - "IAEoBxIYChBvcHRpb25hbF9maXhlZDY0GAggASgGEhkKEW9wdGlvbmFsX3Nm", - "aXhlZDMyGAkgASgPEhkKEW9wdGlvbmFsX3NmaXhlZDY0GAogASgQEhYKDm9w", - "dGlvbmFsX2Zsb2F0GAsgASgCEhcKD29wdGlvbmFsX2RvdWJsZRgMIAEoARIV", - "Cg1vcHRpb25hbF9ib29sGA0gASgIEhcKD29wdGlvbmFsX3N0cmluZxgOIAEo", - "CRIWCg5vcHRpb25hbF9ieXRlcxgPIAEoDBJaChdvcHRpb25hbF9uZXN0ZWRf", - "bWVzc2FnZRgSIAEoCzI5LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8z", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlEk8KGG9wdGlvbmFsX2ZvcmVp", - "Z25fbWVzc2FnZRgTIAEoCzItLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJv", - "dG8zLkZvcmVpZ25NZXNzYWdlElQKFG9wdGlvbmFsX25lc3RlZF9lbnVtGBUg", - "ASgOMjYucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5", - "cGVzLk5lc3RlZEVudW0SSQoVb3B0aW9uYWxfZm9yZWlnbl9lbnVtGBYgASgO", - "MioucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuRm9yZWlnbkVudW0S", - "IQoVb3B0aW9uYWxfc3RyaW5nX3BpZWNlGBggASgJQgIIAhIZCg1vcHRpb25h", - "bF9jb3JkGBkgASgJQgIIARJGChFyZWN1cnNpdmVfbWVzc2FnZRgbIAEoCzIr", - "LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlcxIW", - "Cg5yZXBlYXRlZF9pbnQzMhgfIAMoBRIWCg5yZXBlYXRlZF9pbnQ2NBggIAMo", - "AxIXCg9yZXBlYXRlZF91aW50MzIYISADKA0SFwoPcmVwZWF0ZWRfdWludDY0", - "GCIgAygEEhcKD3JlcGVhdGVkX3NpbnQzMhgjIAMoERIXCg9yZXBlYXRlZF9z", - "aW50NjQYJCADKBISGAoQcmVwZWF0ZWRfZml4ZWQzMhglIAMoBxIYChByZXBl", - "YXRlZF9maXhlZDY0GCYgAygGEhkKEXJlcGVhdGVkX3NmaXhlZDMyGCcgAygP", - "EhkKEXJlcGVhdGVkX3NmaXhlZDY0GCggAygQEhYKDnJlcGVhdGVkX2Zsb2F0", - "GCkgAygCEhcKD3JlcGVhdGVkX2RvdWJsZRgqIAMoARIVCg1yZXBlYXRlZF9i", - "b29sGCsgAygIEhcKD3JlcGVhdGVkX3N0cmluZxgsIAMoCRIWCg5yZXBlYXRl", - "ZF9ieXRlcxgtIAMoDBJaChdyZXBlYXRlZF9uZXN0ZWRfbWVzc2FnZRgwIAMo", - "CzI5LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBl", - "cy5OZXN0ZWRNZXNzYWdlEk8KGHJlcGVhdGVkX2ZvcmVpZ25fbWVzc2FnZRgx", - "IAMoCzItLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLkZvcmVpZ25N", - "ZXNzYWdlElQKFHJlcGVhdGVkX25lc3RlZF9lbnVtGDMgAygOMjYucHJvdG9i", - "dWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzLk5lc3RlZEVu", - "dW0SSQoVcmVwZWF0ZWRfZm9yZWlnbl9lbnVtGDQgAygOMioucHJvdG9idWZf", - "dGVzdF9tZXNzYWdlcy5wcm90bzMuRm9yZWlnbkVudW0SIQoVcmVwZWF0ZWRf", - "c3RyaW5nX3BpZWNlGDYgAygJQgIIAhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJ", - "QgIIARJXCg9tYXBfaW50MzJfaW50MzIYOCADKAsyPi5wcm90b2J1Zl90ZXN0", - "X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwSW50MzJJbnQzMkVu", - "dHJ5ElcKD21hcF9pbnQ2NF9pbnQ2NBg5IAMoCzI+LnByb3RvYnVmX3Rlc3Rf", - "bWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlcy5NYXBJbnQ2NEludDY0RW50", - "cnkSWwoRbWFwX3VpbnQzMl91aW50MzIYOiADKAsyQC5wcm90b2J1Zl90ZXN0", - "X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwVWludDMyVWludDMy", - "RW50cnkSWwoRbWFwX3VpbnQ2NF91aW50NjQYOyADKAsyQC5wcm90b2J1Zl90", - "ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwVWludDY0VWlu", - "dDY0RW50cnkSWwoRbWFwX3NpbnQzMl9zaW50MzIYPCADKAsyQC5wcm90b2J1", - "Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwU2ludDMy", - "U2ludDMyRW50cnkSWwoRbWFwX3NpbnQ2NF9zaW50NjQYPSADKAsyQC5wcm90", - "b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwU2lu", - "dDY0U2ludDY0RW50cnkSXwoTbWFwX2ZpeGVkMzJfZml4ZWQzMhg+IAMoCzJC", - "LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlcy5N", - "YXBGaXhlZDMyRml4ZWQzMkVudHJ5El8KE21hcF9maXhlZDY0X2ZpeGVkNjQY", - "PyADKAsyQi5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxs", - "VHlwZXMuTWFwRml4ZWQ2NEZpeGVkNjRFbnRyeRJjChVtYXBfc2ZpeGVkMzJf", - "c2ZpeGVkMzIYQCADKAsyRC5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3Rv", - "My5UZXN0QWxsVHlwZXMuTWFwU2ZpeGVkMzJTZml4ZWQzMkVudHJ5EmMKFW1h", - "cF9zZml4ZWQ2NF9zZml4ZWQ2NBhBIAMoCzJELnByb3RvYnVmX3Rlc3RfbWVz", - "c2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlcy5NYXBTZml4ZWQ2NFNmaXhlZDY0", - "RW50cnkSVwoPbWFwX2ludDMyX2Zsb2F0GEIgAygLMj4ucHJvdG9idWZfdGVz", - "dF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzLk1hcEludDMyRmxvYXRF", - "bnRyeRJZChBtYXBfaW50MzJfZG91YmxlGEMgAygLMj8ucHJvdG9idWZfdGVz", - "dF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzLk1hcEludDMyRG91Ymxl", - "RW50cnkSUwoNbWFwX2Jvb2xfYm9vbBhEIAMoCzI8LnByb3RvYnVmX3Rlc3Rf", - "bWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlcy5NYXBCb29sQm9vbEVudHJ5", - "ElsKEW1hcF9zdHJpbmdfc3RyaW5nGEUgAygLMkAucHJvdG9idWZfdGVzdF9t", - "ZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzLk1hcFN0cmluZ1N0cmluZ0Vu", - "dHJ5ElkKEG1hcF9zdHJpbmdfYnl0ZXMYRiADKAsyPy5wcm90b2J1Zl90ZXN0", - "X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwU3RyaW5nQnl0ZXNF", - "bnRyeRJqChltYXBfc3RyaW5nX25lc3RlZF9tZXNzYWdlGEcgAygLMkcucHJv", - "dG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzLk1hcFN0", - "cmluZ05lc3RlZE1lc3NhZ2VFbnRyeRJsChptYXBfc3RyaW5nX2ZvcmVpZ25f", - "bWVzc2FnZRhIIAMoCzJILnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8z", - "LlRlc3RBbGxUeXBlcy5NYXBTdHJpbmdGb3JlaWduTWVzc2FnZUVudHJ5EmQK", - "Fm1hcF9zdHJpbmdfbmVzdGVkX2VudW0YSSADKAsyRC5wcm90b2J1Zl90ZXN0", - "X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTWFwU3RyaW5nTmVzdGVk", - "RW51bUVudHJ5EmYKF21hcF9zdHJpbmdfZm9yZWlnbl9lbnVtGEogAygLMkUu", - "cHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzLk1h", - "cFN0cmluZ0ZvcmVpZ25FbnVtRW50cnkSFgoMb25lb2ZfdWludDMyGG8gASgN", - "SAASWQoUb25lb2ZfbmVzdGVkX21lc3NhZ2UYcCABKAsyOS5wcm90b2J1Zl90", - "ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2Fn", - "ZUgAEhYKDG9uZW9mX3N0cmluZxhxIAEoCUgAEhUKC29uZW9mX2J5dGVzGHIg", - "ASgMSAASFAoKb25lb2ZfYm9vbBhzIAEoCEgAEhYKDG9uZW9mX3VpbnQ2NBh0", - "IAEoBEgAEhUKC29uZW9mX2Zsb2F0GHUgASgCSAASFgoMb25lb2ZfZG91Ymxl", - "GHYgASgBSAASTAoKb25lb2ZfZW51bRh3IAEoDjI2LnByb3RvYnVmX3Rlc3Rf", - "bWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtSAASOgoV", - "b3B0aW9uYWxfYm9vbF93cmFwcGVyGMkBIAEoCzIaLmdvb2dsZS5wcm90b2J1", - "Zi5Cb29sVmFsdWUSPAoWb3B0aW9uYWxfaW50MzJfd3JhcHBlchjKASABKAsy", - "Gy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZRI8ChZvcHRpb25hbF9pbnQ2", - "NF93cmFwcGVyGMsBIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVl", - "Ej4KF29wdGlvbmFsX3VpbnQzMl93cmFwcGVyGMwBIAEoCzIcLmdvb2dsZS5w", - "cm90b2J1Zi5VSW50MzJWYWx1ZRI+ChdvcHRpb25hbF91aW50NjRfd3JhcHBl", - "chjNASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDY0VmFsdWUSPAoWb3B0", - "aW9uYWxfZmxvYXRfd3JhcHBlchjOASABKAsyGy5nb29nbGUucHJvdG9idWYu", - "RmxvYXRWYWx1ZRI+ChdvcHRpb25hbF9kb3VibGVfd3JhcHBlchjPASABKAsy", - "HC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSPgoXb3B0aW9uYWxfc3Ry", - "aW5nX3dyYXBwZXIY0AEgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1Zh", - "bHVlEjwKFm9wdGlvbmFsX2J5dGVzX3dyYXBwZXIY0QEgASgLMhsuZ29vZ2xl", - "LnByb3RvYnVmLkJ5dGVzVmFsdWUSOgoVcmVwZWF0ZWRfYm9vbF93cmFwcGVy", - "GNMBIAMoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSPAoWcmVwZWF0", - "ZWRfaW50MzJfd3JhcHBlchjUASADKAsyGy5nb29nbGUucHJvdG9idWYuSW50", - "MzJWYWx1ZRI8ChZyZXBlYXRlZF9pbnQ2NF93cmFwcGVyGNUBIAMoCzIbLmdv", - "b2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEj4KF3JlcGVhdGVkX3VpbnQzMl93", - "cmFwcGVyGNYBIAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50MzJWYWx1ZRI+", - "ChdyZXBlYXRlZF91aW50NjRfd3JhcHBlchjXASADKAsyHC5nb29nbGUucHJv", - "dG9idWYuVUludDY0VmFsdWUSPAoWcmVwZWF0ZWRfZmxvYXRfd3JhcHBlchjY", - "ASADKAsyGy5nb29nbGUucHJvdG9idWYuRmxvYXRWYWx1ZRI+ChdyZXBlYXRl", - "ZF9kb3VibGVfd3JhcHBlchjZASADKAsyHC5nb29nbGUucHJvdG9idWYuRG91", - "YmxlVmFsdWUSPgoXcmVwZWF0ZWRfc3RyaW5nX3dyYXBwZXIY2gEgAygLMhwu", - "Z29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEjwKFnJlcGVhdGVkX2J5dGVz", - "X3dyYXBwZXIY2wEgAygLMhsuZ29vZ2xlLnByb3RvYnVmLkJ5dGVzVmFsdWUS", - "NQoRb3B0aW9uYWxfZHVyYXRpb24YrQIgASgLMhkuZ29vZ2xlLnByb3RvYnVm", - "LkR1cmF0aW9uEjcKEm9wdGlvbmFsX3RpbWVzdGFtcBiuAiABKAsyGi5nb29n", - "bGUucHJvdG9idWYuVGltZXN0YW1wEjgKE29wdGlvbmFsX2ZpZWxkX21hc2sY", - "rwIgASgLMhouZ29vZ2xlLnByb3RvYnVmLkZpZWxkTWFzaxIxCg9vcHRpb25h", - "bF9zdHJ1Y3QYsAIgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIrCgxv", - "cHRpb25hbF9hbnkYsQIgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueRIvCg5v", - "cHRpb25hbF92YWx1ZRiyAiABKAsyFi5nb29nbGUucHJvdG9idWYuVmFsdWUS", - "NQoRcmVwZWF0ZWRfZHVyYXRpb24YtwIgAygLMhkuZ29vZ2xlLnByb3RvYnVm", - "LkR1cmF0aW9uEjcKEnJlcGVhdGVkX3RpbWVzdGFtcBi4AiADKAsyGi5nb29n", - "bGUucHJvdG9idWYuVGltZXN0YW1wEjcKEnJlcGVhdGVkX2ZpZWxkbWFzaxi5", - "AiADKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrEjEKD3JlcGVhdGVk", - "X3N0cnVjdBjEAiADKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0EisKDHJl", - "cGVhdGVkX2FueRi7AiADKAsyFC5nb29nbGUucHJvdG9idWYuQW55Ei8KDnJl", - "cGVhdGVkX3ZhbHVlGLwCIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZRIT", - "CgpmaWVsZG5hbWUxGJEDIAEoBRIUCgtmaWVsZF9uYW1lMhiSAyABKAUSFQoM", - "X2ZpZWxkX25hbWUzGJMDIAEoBRIWCg1maWVsZF9fbmFtZTRfGJQDIAEoBRIU", - "CgtmaWVsZDBuYW1lNRiVAyABKAUSFgoNZmllbGRfMF9uYW1lNhiWAyABKAUS", - "EwoKZmllbGROYW1lNxiXAyABKAUSEwoKRmllbGROYW1lOBiYAyABKAUSFAoL", - "ZmllbGRfTmFtZTkYmQMgASgFEhUKDEZpZWxkX05hbWUxMBiaAyABKAUSFQoM", - "RklFTERfTkFNRTExGJsDIAEoBRIVCgxGSUVMRF9uYW1lMTIYnAMgASgFEhcK", - "Dl9fZmllbGRfbmFtZTEzGJ0DIAEoBRIXCg5fX0ZpZWxkX25hbWUxNBieAyAB", - "KAUSFgoNZmllbGRfX25hbWUxNRifAyABKAUSFgoNZmllbGRfX05hbWUxNhig", - "AyABKAUSFwoOZmllbGRfbmFtZTE3X18YoQMgASgFEhcKDkZpZWxkX25hbWUx", - "OF9fGKIDIAEoBRpcCg1OZXN0ZWRNZXNzYWdlEgkKAWEYASABKAUSQAoLY29y", - "ZWN1cnNpdmUYAiABKAsyKy5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3Rv", - "My5UZXN0QWxsVHlwZXMaNAoSTWFwSW50MzJJbnQzMkVudHJ5EgsKA2tleRgB", - "IAEoBRINCgV2YWx1ZRgCIAEoBToCOAEaNAoSTWFwSW50NjRJbnQ2NEVudHJ5", - "EgsKA2tleRgBIAEoAxINCgV2YWx1ZRgCIAEoAzoCOAEaNgoUTWFwVWludDMy", - "VWludDMyRW50cnkSCwoDa2V5GAEgASgNEg0KBXZhbHVlGAIgASgNOgI4ARo2", - "ChRNYXBVaW50NjRVaW50NjRFbnRyeRILCgNrZXkYASABKAQSDQoFdmFsdWUY", - "AiABKAQ6AjgBGjYKFE1hcFNpbnQzMlNpbnQzMkVudHJ5EgsKA2tleRgBIAEo", - "ERINCgV2YWx1ZRgCIAEoEToCOAEaNgoUTWFwU2ludDY0U2ludDY0RW50cnkS", - "CwoDa2V5GAEgASgSEg0KBXZhbHVlGAIgASgSOgI4ARo4ChZNYXBGaXhlZDMy", - "Rml4ZWQzMkVudHJ5EgsKA2tleRgBIAEoBxINCgV2YWx1ZRgCIAEoBzoCOAEa", - "OAoWTWFwRml4ZWQ2NEZpeGVkNjRFbnRyeRILCgNrZXkYASABKAYSDQoFdmFs", - "dWUYAiABKAY6AjgBGjoKGE1hcFNmaXhlZDMyU2ZpeGVkMzJFbnRyeRILCgNr", - "ZXkYASABKA8SDQoFdmFsdWUYAiABKA86AjgBGjoKGE1hcFNmaXhlZDY0U2Zp", - "eGVkNjRFbnRyeRILCgNrZXkYASABKBASDQoFdmFsdWUYAiABKBA6AjgBGjQK", - "Ek1hcEludDMyRmxvYXRFbnRyeRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiAB", - "KAI6AjgBGjUKE01hcEludDMyRG91YmxlRW50cnkSCwoDa2V5GAEgASgFEg0K", - "BXZhbHVlGAIgASgBOgI4ARoyChBNYXBCb29sQm9vbEVudHJ5EgsKA2tleRgB", - "IAEoCBINCgV2YWx1ZRgCIAEoCDoCOAEaNgoUTWFwU3RyaW5nU3RyaW5nRW50", - "cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ARo1ChNNYXBTdHJp", - "bmdCeXRlc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoCOAEa", - "eAobTWFwU3RyaW5nTmVzdGVkTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRJI", - "CgV2YWx1ZRgCIAEoCzI5LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8z", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlOgI4ARptChxNYXBTdHJpbmdG", - "b3JlaWduTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRI8CgV2YWx1ZRgCIAEo", - "CzItLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLkZvcmVpZ25NZXNz", - "YWdlOgI4ARpyChhNYXBTdHJpbmdOZXN0ZWRFbnVtRW50cnkSCwoDa2V5GAEg", - "ASgJEkUKBXZhbHVlGAIgASgOMjYucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5w", - "cm90bzMuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06AjgBGmcKGU1hcFN0cmlu", + "LnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8irDsKElRl", + "c3RBbGxUeXBlc1Byb3RvMxIWCg5vcHRpb25hbF9pbnQzMhgBIAEoBRIWCg5v", + "cHRpb25hbF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25hbF91aW50MzIYAyABKA0S", + "FwoPb3B0aW9uYWxfdWludDY0GAQgASgEEhcKD29wdGlvbmFsX3NpbnQzMhgF", + "IAEoERIXCg9vcHRpb25hbF9zaW50NjQYBiABKBISGAoQb3B0aW9uYWxfZml4", + "ZWQzMhgHIAEoBxIYChBvcHRpb25hbF9maXhlZDY0GAggASgGEhkKEW9wdGlv", + "bmFsX3NmaXhlZDMyGAkgASgPEhkKEW9wdGlvbmFsX3NmaXhlZDY0GAogASgQ", + "EhYKDm9wdGlvbmFsX2Zsb2F0GAsgASgCEhcKD29wdGlvbmFsX2RvdWJsZRgM", + "IAEoARIVCg1vcHRpb25hbF9ib29sGA0gASgIEhcKD29wdGlvbmFsX3N0cmlu", + "ZxgOIAEoCRIWCg5vcHRpb25hbF9ieXRlcxgPIAEoDBJgChdvcHRpb25hbF9u", + "ZXN0ZWRfbWVzc2FnZRgSIAEoCzI/LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMu", + "cHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5OZXN0ZWRNZXNzYWdlEk8KGG9w", + "dGlvbmFsX2ZvcmVpZ25fbWVzc2FnZRgTIAEoCzItLnByb3RvYnVmX3Rlc3Rf", + "bWVzc2FnZXMucHJvdG8zLkZvcmVpZ25NZXNzYWdlEloKFG9wdGlvbmFsX25l", + "c3RlZF9lbnVtGBUgASgOMjwucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90", + "bzMuVGVzdEFsbFR5cGVzUHJvdG8zLk5lc3RlZEVudW0SSQoVb3B0aW9uYWxf", + "Zm9yZWlnbl9lbnVtGBYgASgOMioucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5w", + "cm90bzMuRm9yZWlnbkVudW0SIQoVb3B0aW9uYWxfc3RyaW5nX3BpZWNlGBgg", + "ASgJQgIIAhIZCg1vcHRpb25hbF9jb3JkGBkgASgJQgIIARJMChFyZWN1cnNp", + "dmVfbWVzc2FnZRgbIAEoCzIxLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJv", + "dG8zLlRlc3RBbGxUeXBlc1Byb3RvMxIWCg5yZXBlYXRlZF9pbnQzMhgfIAMo", + "BRIWCg5yZXBlYXRlZF9pbnQ2NBggIAMoAxIXCg9yZXBlYXRlZF91aW50MzIY", + "ISADKA0SFwoPcmVwZWF0ZWRfdWludDY0GCIgAygEEhcKD3JlcGVhdGVkX3Np", + "bnQzMhgjIAMoERIXCg9yZXBlYXRlZF9zaW50NjQYJCADKBISGAoQcmVwZWF0", + "ZWRfZml4ZWQzMhglIAMoBxIYChByZXBlYXRlZF9maXhlZDY0GCYgAygGEhkK", + "EXJlcGVhdGVkX3NmaXhlZDMyGCcgAygPEhkKEXJlcGVhdGVkX3NmaXhlZDY0", + "GCggAygQEhYKDnJlcGVhdGVkX2Zsb2F0GCkgAygCEhcKD3JlcGVhdGVkX2Rv", + "dWJsZRgqIAMoARIVCg1yZXBlYXRlZF9ib29sGCsgAygIEhcKD3JlcGVhdGVk", + "X3N0cmluZxgsIAMoCRIWCg5yZXBlYXRlZF9ieXRlcxgtIAMoDBJgChdyZXBl", + "YXRlZF9uZXN0ZWRfbWVzc2FnZRgwIAMoCzI/LnByb3RvYnVmX3Rlc3RfbWVz", + "c2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5OZXN0ZWRNZXNzYWdl", + "Ek8KGHJlcGVhdGVkX2ZvcmVpZ25fbWVzc2FnZRgxIAMoCzItLnByb3RvYnVm", + "X3Rlc3RfbWVzc2FnZXMucHJvdG8zLkZvcmVpZ25NZXNzYWdlEloKFHJlcGVh", + "dGVkX25lc3RlZF9lbnVtGDMgAygOMjwucHJvdG9idWZfdGVzdF9tZXNzYWdl", + "cy5wcm90bzMuVGVzdEFsbFR5cGVzUHJvdG8zLk5lc3RlZEVudW0SSQoVcmVw", + "ZWF0ZWRfZm9yZWlnbl9lbnVtGDQgAygOMioucHJvdG9idWZfdGVzdF9tZXNz", + "YWdlcy5wcm90bzMuRm9yZWlnbkVudW0SIQoVcmVwZWF0ZWRfc3RyaW5nX3Bp", + "ZWNlGDYgAygJQgIIAhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJQgIIARJdCg9t", + "YXBfaW50MzJfaW50MzIYOCADKAsyRC5wcm90b2J1Zl90ZXN0X21lc3NhZ2Vz", + "LnByb3RvMy5UZXN0QWxsVHlwZXNQcm90bzMuTWFwSW50MzJJbnQzMkVudHJ5", + "El0KD21hcF9pbnQ2NF9pbnQ2NBg5IAMoCzJELnByb3RvYnVmX3Rlc3RfbWVz", + "c2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5NYXBJbnQ2NEludDY0", + "RW50cnkSYQoRbWFwX3VpbnQzMl91aW50MzIYOiADKAsyRi5wcm90b2J1Zl90", + "ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXNQcm90bzMuTWFwVWlu", + "dDMyVWludDMyRW50cnkSYQoRbWFwX3VpbnQ2NF91aW50NjQYOyADKAsyRi5w", + "cm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXNQcm90", + "bzMuTWFwVWludDY0VWludDY0RW50cnkSYQoRbWFwX3NpbnQzMl9zaW50MzIY", + "PCADKAsyRi5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxs", + "VHlwZXNQcm90bzMuTWFwU2ludDMyU2ludDMyRW50cnkSYQoRbWFwX3NpbnQ2", + "NF9zaW50NjQYPSADKAsyRi5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3Rv", + "My5UZXN0QWxsVHlwZXNQcm90bzMuTWFwU2ludDY0U2ludDY0RW50cnkSZQoT", + "bWFwX2ZpeGVkMzJfZml4ZWQzMhg+IAMoCzJILnByb3RvYnVmX3Rlc3RfbWVz", + "c2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5NYXBGaXhlZDMyRml4", + "ZWQzMkVudHJ5EmUKE21hcF9maXhlZDY0X2ZpeGVkNjQYPyADKAsySC5wcm90", + "b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXNQcm90bzMu", + "TWFwRml4ZWQ2NEZpeGVkNjRFbnRyeRJpChVtYXBfc2ZpeGVkMzJfc2ZpeGVk", + "MzIYQCADKAsySi5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0", + "QWxsVHlwZXNQcm90bzMuTWFwU2ZpeGVkMzJTZml4ZWQzMkVudHJ5EmkKFW1h", + "cF9zZml4ZWQ2NF9zZml4ZWQ2NBhBIAMoCzJKLnByb3RvYnVmX3Rlc3RfbWVz", + "c2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5NYXBTZml4ZWQ2NFNm", + "aXhlZDY0RW50cnkSXQoPbWFwX2ludDMyX2Zsb2F0GEIgAygLMkQucHJvdG9i", + "dWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzUHJvdG8zLk1h", + "cEludDMyRmxvYXRFbnRyeRJfChBtYXBfaW50MzJfZG91YmxlGEMgAygLMkUu", + "cHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzUHJv", + "dG8zLk1hcEludDMyRG91YmxlRW50cnkSWQoNbWFwX2Jvb2xfYm9vbBhEIAMo", + "CzJCLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBl", + "c1Byb3RvMy5NYXBCb29sQm9vbEVudHJ5EmEKEW1hcF9zdHJpbmdfc3RyaW5n", + "GEUgAygLMkYucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFs", + "bFR5cGVzUHJvdG8zLk1hcFN0cmluZ1N0cmluZ0VudHJ5El8KEG1hcF9zdHJp", + "bmdfYnl0ZXMYRiADKAsyRS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3Rv", + "My5UZXN0QWxsVHlwZXNQcm90bzMuTWFwU3RyaW5nQnl0ZXNFbnRyeRJwChlt", + "YXBfc3RyaW5nX25lc3RlZF9tZXNzYWdlGEcgAygLMk0ucHJvdG9idWZfdGVz", + "dF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzUHJvdG8zLk1hcFN0cmlu", + "Z05lc3RlZE1lc3NhZ2VFbnRyeRJyChptYXBfc3RyaW5nX2ZvcmVpZ25fbWVz", + "c2FnZRhIIAMoCzJOLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRl", + "c3RBbGxUeXBlc1Byb3RvMy5NYXBTdHJpbmdGb3JlaWduTWVzc2FnZUVudHJ5", + "EmoKFm1hcF9zdHJpbmdfbmVzdGVkX2VudW0YSSADKAsySi5wcm90b2J1Zl90", + "ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXNQcm90bzMuTWFwU3Ry", + "aW5nTmVzdGVkRW51bUVudHJ5EmwKF21hcF9zdHJpbmdfZm9yZWlnbl9lbnVt", + "GEogAygLMksucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFs", + "bFR5cGVzUHJvdG8zLk1hcFN0cmluZ0ZvcmVpZ25FbnVtRW50cnkSFgoMb25l", + "b2ZfdWludDMyGG8gASgNSAASXwoUb25lb2ZfbmVzdGVkX21lc3NhZ2UYcCAB", + "KAsyPy5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlw", + "ZXNQcm90bzMuTmVzdGVkTWVzc2FnZUgAEhYKDG9uZW9mX3N0cmluZxhxIAEo", + "CUgAEhUKC29uZW9mX2J5dGVzGHIgASgMSAASFAoKb25lb2ZfYm9vbBhzIAEo", + "CEgAEhYKDG9uZW9mX3VpbnQ2NBh0IAEoBEgAEhUKC29uZW9mX2Zsb2F0GHUg", + "ASgCSAASFgoMb25lb2ZfZG91YmxlGHYgASgBSAASUgoKb25lb2ZfZW51bRh3", + "IAEoDjI8LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxU", + "eXBlc1Byb3RvMy5OZXN0ZWRFbnVtSAASOgoVb3B0aW9uYWxfYm9vbF93cmFw", + "cGVyGMkBIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSPAoWb3B0", + "aW9uYWxfaW50MzJfd3JhcHBlchjKASABKAsyGy5nb29nbGUucHJvdG9idWYu", + "SW50MzJWYWx1ZRI8ChZvcHRpb25hbF9pbnQ2NF93cmFwcGVyGMsBIAEoCzIb", + "Lmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEj4KF29wdGlvbmFsX3VpbnQz", + "Ml93cmFwcGVyGMwBIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50MzJWYWx1", + "ZRI+ChdvcHRpb25hbF91aW50NjRfd3JhcHBlchjNASABKAsyHC5nb29nbGUu", + "cHJvdG9idWYuVUludDY0VmFsdWUSPAoWb3B0aW9uYWxfZmxvYXRfd3JhcHBl", + "chjOASABKAsyGy5nb29nbGUucHJvdG9idWYuRmxvYXRWYWx1ZRI+ChdvcHRp", + "b25hbF9kb3VibGVfd3JhcHBlchjPASABKAsyHC5nb29nbGUucHJvdG9idWYu", + "RG91YmxlVmFsdWUSPgoXb3B0aW9uYWxfc3RyaW5nX3dyYXBwZXIY0AEgASgL", + "MhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEjwKFm9wdGlvbmFsX2J5", + "dGVzX3dyYXBwZXIY0QEgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkJ5dGVzVmFs", + "dWUSOgoVcmVwZWF0ZWRfYm9vbF93cmFwcGVyGNMBIAMoCzIaLmdvb2dsZS5w", + "cm90b2J1Zi5Cb29sVmFsdWUSPAoWcmVwZWF0ZWRfaW50MzJfd3JhcHBlchjU", + "ASADKAsyGy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZRI8ChZyZXBlYXRl", + "ZF9pbnQ2NF93cmFwcGVyGNUBIAMoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2", + "NFZhbHVlEj4KF3JlcGVhdGVkX3VpbnQzMl93cmFwcGVyGNYBIAMoCzIcLmdv", + "b2dsZS5wcm90b2J1Zi5VSW50MzJWYWx1ZRI+ChdyZXBlYXRlZF91aW50NjRf", + "d3JhcHBlchjXASADKAsyHC5nb29nbGUucHJvdG9idWYuVUludDY0VmFsdWUS", + "PAoWcmVwZWF0ZWRfZmxvYXRfd3JhcHBlchjYASADKAsyGy5nb29nbGUucHJv", + "dG9idWYuRmxvYXRWYWx1ZRI+ChdyZXBlYXRlZF9kb3VibGVfd3JhcHBlchjZ", + "ASADKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSPgoXcmVwZWF0", + "ZWRfc3RyaW5nX3dyYXBwZXIY2gEgAygLMhwuZ29vZ2xlLnByb3RvYnVmLlN0", + "cmluZ1ZhbHVlEjwKFnJlcGVhdGVkX2J5dGVzX3dyYXBwZXIY2wEgAygLMhsu", + "Z29vZ2xlLnByb3RvYnVmLkJ5dGVzVmFsdWUSNQoRb3B0aW9uYWxfZHVyYXRp", + "b24YrQIgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEjcKEm9wdGlv", + "bmFsX3RpbWVzdGFtcBiuAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0", + "YW1wEjgKE29wdGlvbmFsX2ZpZWxkX21hc2sYrwIgASgLMhouZ29vZ2xlLnBy", + "b3RvYnVmLkZpZWxkTWFzaxIxCg9vcHRpb25hbF9zdHJ1Y3QYsAIgASgLMhcu", + "Z29vZ2xlLnByb3RvYnVmLlN0cnVjdBIrCgxvcHRpb25hbF9hbnkYsQIgASgL", + "MhQuZ29vZ2xlLnByb3RvYnVmLkFueRIvCg5vcHRpb25hbF92YWx1ZRiyAiAB", + "KAsyFi5nb29nbGUucHJvdG9idWYuVmFsdWUSNQoRcmVwZWF0ZWRfZHVyYXRp", + "b24YtwIgAygLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEjcKEnJlcGVh", + "dGVkX3RpbWVzdGFtcBi4AiADKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0", + "YW1wEjcKEnJlcGVhdGVkX2ZpZWxkbWFzaxi5AiADKAsyGi5nb29nbGUucHJv", + "dG9idWYuRmllbGRNYXNrEjEKD3JlcGVhdGVkX3N0cnVjdBjEAiADKAsyFy5n", + "b29nbGUucHJvdG9idWYuU3RydWN0EisKDHJlcGVhdGVkX2FueRi7AiADKAsy", + "FC5nb29nbGUucHJvdG9idWYuQW55Ei8KDnJlcGVhdGVkX3ZhbHVlGLwCIAMo", + "CzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZRITCgpmaWVsZG5hbWUxGJEDIAEo", + "BRIUCgtmaWVsZF9uYW1lMhiSAyABKAUSFQoMX2ZpZWxkX25hbWUzGJMDIAEo", + "BRIWCg1maWVsZF9fbmFtZTRfGJQDIAEoBRIUCgtmaWVsZDBuYW1lNRiVAyAB", + "KAUSFgoNZmllbGRfMF9uYW1lNhiWAyABKAUSEwoKZmllbGROYW1lNxiXAyAB", + "KAUSEwoKRmllbGROYW1lOBiYAyABKAUSFAoLZmllbGRfTmFtZTkYmQMgASgF", + "EhUKDEZpZWxkX05hbWUxMBiaAyABKAUSFQoMRklFTERfTkFNRTExGJsDIAEo", + "BRIVCgxGSUVMRF9uYW1lMTIYnAMgASgFEhcKDl9fZmllbGRfbmFtZTEzGJ0D", + "IAEoBRIXCg5fX0ZpZWxkX25hbWUxNBieAyABKAUSFgoNZmllbGRfX25hbWUx", + "NRifAyABKAUSFgoNZmllbGRfX05hbWUxNhigAyABKAUSFwoOZmllbGRfbmFt", + "ZTE3X18YoQMgASgFEhcKDkZpZWxkX25hbWUxOF9fGKIDIAEoBRpiCg1OZXN0", + "ZWRNZXNzYWdlEgkKAWEYASABKAUSRgoLY29yZWN1cnNpdmUYAiABKAsyMS5w", + "cm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXNQcm90", + "bzMaNAoSTWFwSW50MzJJbnQzMkVudHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1", + "ZRgCIAEoBToCOAEaNAoSTWFwSW50NjRJbnQ2NEVudHJ5EgsKA2tleRgBIAEo", + "AxINCgV2YWx1ZRgCIAEoAzoCOAEaNgoUTWFwVWludDMyVWludDMyRW50cnkS", + "CwoDa2V5GAEgASgNEg0KBXZhbHVlGAIgASgNOgI4ARo2ChRNYXBVaW50NjRV", + "aW50NjRFbnRyeRILCgNrZXkYASABKAQSDQoFdmFsdWUYAiABKAQ6AjgBGjYK", + "FE1hcFNpbnQzMlNpbnQzMkVudHJ5EgsKA2tleRgBIAEoERINCgV2YWx1ZRgC", + "IAEoEToCOAEaNgoUTWFwU2ludDY0U2ludDY0RW50cnkSCwoDa2V5GAEgASgS", + "Eg0KBXZhbHVlGAIgASgSOgI4ARo4ChZNYXBGaXhlZDMyRml4ZWQzMkVudHJ5", + "EgsKA2tleRgBIAEoBxINCgV2YWx1ZRgCIAEoBzoCOAEaOAoWTWFwRml4ZWQ2", + "NEZpeGVkNjRFbnRyeRILCgNrZXkYASABKAYSDQoFdmFsdWUYAiABKAY6AjgB", + "GjoKGE1hcFNmaXhlZDMyU2ZpeGVkMzJFbnRyeRILCgNrZXkYASABKA8SDQoF", + "dmFsdWUYAiABKA86AjgBGjoKGE1hcFNmaXhlZDY0U2ZpeGVkNjRFbnRyeRIL", + "CgNrZXkYASABKBASDQoFdmFsdWUYAiABKBA6AjgBGjQKEk1hcEludDMyRmxv", + "YXRFbnRyeRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiABKAI6AjgBGjUKE01h", + "cEludDMyRG91YmxlRW50cnkSCwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgB", + "OgI4ARoyChBNYXBCb29sQm9vbEVudHJ5EgsKA2tleRgBIAEoCBINCgV2YWx1", + "ZRgCIAEoCDoCOAEaNgoUTWFwU3RyaW5nU3RyaW5nRW50cnkSCwoDa2V5GAEg", + "ASgJEg0KBXZhbHVlGAIgASgJOgI4ARo1ChNNYXBTdHJpbmdCeXRlc0VudHJ5", + "EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoCOAEafgobTWFwU3RyaW5n", + "TmVzdGVkTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRJOCgV2YWx1ZRgCIAEo", + "CzI/LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBl", + "c1Byb3RvMy5OZXN0ZWRNZXNzYWdlOgI4ARptChxNYXBTdHJpbmdGb3JlaWdu", + "TWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRI8CgV2YWx1ZRgCIAEoCzItLnBy", + "b3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLkZvcmVpZ25NZXNzYWdlOgI4", + "ARp4ChhNYXBTdHJpbmdOZXN0ZWRFbnVtRW50cnkSCwoDa2V5GAEgASgJEksK", + "BXZhbHVlGAIgASgOMjwucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMu", + "VGVzdEFsbFR5cGVzUHJvdG8zLk5lc3RlZEVudW06AjgBGmcKGU1hcFN0cmlu", "Z0ZvcmVpZ25FbnVtRW50cnkSCwoDa2V5GAEgASgJEjkKBXZhbHVlGAIgASgO", "MioucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMuRm9yZWlnbkVudW06", "AjgBIjkKCk5lc3RlZEVudW0SBwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAIS", @@ -200,7 +204,7 @@ namespace ProtobufTestMessages.Proto3 { descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufTestMessages.Proto3.ForeignEnum), }, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypes), global::ProtobufTestMessages.Proto3.TestAllTypes.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage), global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.ForeignMessage), global::ProtobufTestMessages.Proto3.ForeignMessage.Parser, new[]{ "C" }, null, null, null) })); @@ -227,10 +231,10 @@ namespace ProtobufTestMessages.Proto3 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - public sealed partial class TestAllTypes : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); + public sealed partial class TestAllTypesProto3 : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto3()); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -243,14 +247,14 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TestAllTypes() { + public TestAllTypesProto3() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TestAllTypes(TestAllTypes other) : this() { + public TestAllTypesProto3(TestAllTypesProto3 other) : this() { optionalInt32_ = other.optionalInt32_; optionalInt64_ = other.optionalInt64_; optionalUint32_ = other.optionalUint32_; @@ -394,8 +398,8 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TestAllTypes Clone() { - return new TestAllTypes(this); + public TestAllTypesProto3 Clone() { + return new TestAllTypesProto3(this); } /// Field number for the "optional_int32" field. @@ -568,9 +572,9 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "optional_nested_message" field. public const int OptionalNestedMessageFieldNumber = 18; - private global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage optionalNestedMessage_; + private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { optionalNestedMessage_ = value; @@ -590,9 +594,9 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "optional_nested_enum" field. public const int OptionalNestedEnumFieldNumber = 21; - private global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = 0; + private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum optionalNestedEnum_ = 0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum OptionalNestedEnum { get { return optionalNestedEnum_; } set { optionalNestedEnum_ = value; @@ -634,9 +638,9 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "recursive_message" field. public const int RecursiveMessageFieldNumber = 27; - private global::ProtobufTestMessages.Proto3.TestAllTypes recursiveMessage_; + private global::ProtobufTestMessages.Proto3.TestAllTypesProto3 recursiveMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ProtobufTestMessages.Proto3.TestAllTypes RecursiveMessage { + public global::ProtobufTestMessages.Proto3.TestAllTypesProto3 RecursiveMessage { get { return recursiveMessage_; } set { recursiveMessage_ = value; @@ -798,11 +802,11 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "repeated_nested_message" field. public const int RepeatedNestedMessageFieldNumber = 48; - private static readonly pb::FieldCodec _repeated_repeatedNestedMessage_codec - = pb::FieldCodec.ForMessage(386, global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage.Parser); - private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_repeatedNestedMessage_codec + = pb::FieldCodec.ForMessage(386, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser); + private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField RepeatedNestedMessage { + public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -818,11 +822,11 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "repeated_nested_enum" field. public const int RepeatedNestedEnumFieldNumber = 51; - private static readonly pb::FieldCodec _repeated_repeatedNestedEnum_codec - = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum) x); - private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_repeatedNestedEnum_codec + = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); + private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField RepeatedNestedEnum { + public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -1011,11 +1015,11 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "map_string_nested_message" field. public const int MapStringNestedMessageFieldNumber = 71; - private static readonly pbc::MapField.Codec _map_mapStringNestedMessage_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage.Parser), 570); - private readonly pbc::MapField mapStringNestedMessage_ = new pbc::MapField(); + private static readonly pbc::MapField.Codec _map_mapStringNestedMessage_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser), 570); + private readonly pbc::MapField mapStringNestedMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField MapStringNestedMessage { + public pbc::MapField MapStringNestedMessage { get { return mapStringNestedMessage_; } } @@ -1031,11 +1035,11 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "map_string_nested_enum" field. public const int MapStringNestedEnumFieldNumber = 73; - private static readonly pbc::MapField.Codec _map_mapStringNestedEnum_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum) x), 586); - private readonly pbc::MapField mapStringNestedEnum_ = new pbc::MapField(); + private static readonly pbc::MapField.Codec _map_mapStringNestedEnum_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x), 586); + private readonly pbc::MapField mapStringNestedEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField MapStringNestedEnum { + public pbc::MapField MapStringNestedEnum { get { return mapStringNestedEnum_; } } @@ -1063,8 +1067,8 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage) oneofField_ : null; } + public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage OneofNestedMessage { + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage) oneofField_ : null; } set { oneofField_ = value; oneofFieldCase_ = value == null ? OneofFieldOneofCase.None : OneofFieldOneofCase.OneofNestedMessage; @@ -1140,8 +1144,8 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_enum" field. public const int OneofEnumFieldNumber = 119; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum OneofEnum { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum ? (global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum) oneofField_ : 0; } + public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum OneofEnum { + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) oneofField_ : 0; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; @@ -1705,11 +1709,11 @@ namespace ProtobufTestMessages.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as TestAllTypes); + return Equals(other as TestAllTypesProto3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TestAllTypes other) { + public bool Equals(TestAllTypesProto3 other) { if (ReferenceEquals(other, null)) { return false; } @@ -2530,7 +2534,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TestAllTypes other) { + public void MergeFrom(TestAllTypesProto3 other) { if (other == null) { return; } @@ -2581,7 +2585,7 @@ namespace ProtobufTestMessages.Proto3 { } if (other.optionalNestedMessage_ != null) { if (optionalNestedMessage_ == null) { - optionalNestedMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage(); + optionalNestedMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); } OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); } @@ -2605,7 +2609,7 @@ namespace ProtobufTestMessages.Proto3 { } if (other.recursiveMessage_ != null) { if (recursiveMessage_ == null) { - recursiveMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypes(); + recursiveMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); } RecursiveMessage.MergeFrom(other.RecursiveMessage); } @@ -2901,7 +2905,7 @@ namespace ProtobufTestMessages.Proto3 { } case 146: { if (optionalNestedMessage_ == null) { - optionalNestedMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage(); + optionalNestedMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); } input.ReadMessage(optionalNestedMessage_); break; @@ -2914,7 +2918,7 @@ namespace ProtobufTestMessages.Proto3 { break; } case 168: { - optionalNestedEnum_ = (global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + optionalNestedEnum_ = (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) input.ReadEnum(); break; } case 176: { @@ -2931,7 +2935,7 @@ namespace ProtobufTestMessages.Proto3 { } case 218: { if (recursiveMessage_ == null) { - recursiveMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypes(); + recursiveMessage_ = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); } input.ReadMessage(recursiveMessage_); break; @@ -3116,7 +3120,7 @@ namespace ProtobufTestMessages.Proto3 { break; } case 898: { - global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto3.TestAllTypes.Types.NestedMessage(); + global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { subBuilder.MergeFrom(OneofNestedMessage); } @@ -3395,7 +3399,7 @@ namespace ProtobufTestMessages.Proto3 { } #region Nested types - /// Container for nested types declared in the TestAllTypes message type. + /// Container for nested types declared in the TestAllTypesProto3 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { public enum NestedEnum { @@ -3415,7 +3419,7 @@ namespace ProtobufTestMessages.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto3.TestAllTypes.Descriptor.NestedTypes[0]; } + get { return global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3454,9 +3458,9 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "corecursive" field. public const int CorecursiveFieldNumber = 2; - private global::ProtobufTestMessages.Proto3.TestAllTypes corecursive_; + private global::ProtobufTestMessages.Proto3.TestAllTypesProto3 corecursive_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ProtobufTestMessages.Proto3.TestAllTypes Corecursive { + public global::ProtobufTestMessages.Proto3.TestAllTypesProto3 Corecursive { get { return corecursive_; } set { corecursive_ = value; @@ -3528,7 +3532,7 @@ namespace ProtobufTestMessages.Proto3 { } if (other.corecursive_ != null) { if (corecursive_ == null) { - corecursive_ = new global::ProtobufTestMessages.Proto3.TestAllTypes(); + corecursive_ = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); } Corecursive.MergeFrom(other.Corecursive); } @@ -3548,7 +3552,7 @@ namespace ProtobufTestMessages.Proto3 { } case 18: { if (corecursive_ == null) { - corecursive_ = new global::ProtobufTestMessages.Proto3.TestAllTypes(); + corecursive_ = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); } input.ReadMessage(corecursive_); break; From 7339c25d120246d711486f458cd098a94f8b2455 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 5 Jul 2017 09:49:11 -0700 Subject: [PATCH 49/61] delete backup files --- .../Google.Protobuf.Conformance/Program.cs~ | 155 ------------------ 1 file changed, 155 deletions(-) delete mode 100644 csharp/src/Google.Protobuf.Conformance/Program.cs~ diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs~ b/csharp/src/Google.Protobuf.Conformance/Program.cs~ deleted file mode 100644 index 96dc354e99..0000000000 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs~ +++ /dev/null @@ -1,155 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#endregion - -using Conformance; -using Google.Protobuf.Reflection; -using System; -using System.IO; - -namespace Google.Protobuf.Conformance -{ - /// - /// Conformance tests. The test runner will provide JSON or proto data on stdin, - /// and this program will produce its output on stdout. - /// - class Program - { - private static void Main(string[] args) - { - // This way we get the binary streams instead of readers/writers. - var input = new BinaryReader(Console.OpenStandardInput()); - var output = new BinaryWriter(Console.OpenStandardOutput()); - var typeRegistry = TypeRegistry.FromMessages(ProtobufTestMessages.Proto3.TestAllTypesProto3.Descriptor); - - int count = 0; - while (RunTest(input, output, typeRegistry)) - { - count++; - } - Console.Error.WriteLine("Received EOF after {0} tests", count); - } - - private static bool RunTest(BinaryReader input, BinaryWriter output, TypeRegistry typeRegistry) - { - int? size = ReadInt32(input); - if (size == null) - { - return false; - } - byte[] inputData = input.ReadBytes(size.Value); - if (inputData.Length != size.Value) - { - throw new EndOfStreamException("Read " + inputData.Length + " bytes of data when expecting " + size); - } - ConformanceRequest request = ConformanceRequest.Parser.ParseFrom(inputData); - ConformanceResponse response = PerformRequest(request, typeRegistry); - byte[] outputData = response.ToByteArray(); - output.Write(outputData.Length); - output.Write(outputData); - // Ready for another test... - return true; - } - - private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry) - { - ProtobufTestMessages.Proto3.TestAllTypesProto3 message; - try - { - switch (request.PayloadCase) - { - case ConformanceRequest.PayloadOneofCase.JsonPayload: - var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); - message = parser.Parse(request.JsonPayload); - break; - case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - { - if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3")) - { - message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); - } - else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) - { - return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" }; - } - else - { - throw new Exception(" Protobuf request doesn't have specific payload type"); - } - break; - } - default: - throw new Exception("Unsupported request payload: " + request.PayloadCase); - } - } - catch (InvalidProtocolBufferException e) - { - return new ConformanceResponse { ParseError = e.Message }; - } - catch (InvalidJsonException e) - { - return new ConformanceResponse { ParseError = e.Message }; - } - try - { - switch (request.RequestedOutputFormat) - { - case global::Conformance.WireFormat.Json: - var formatter = new JsonFormatter(new JsonFormatter.Settings(false, typeRegistry)); - return new ConformanceResponse { JsonPayload = formatter.Format(message) }; - case global::Conformance.WireFormat.Protobuf: - return new ConformanceResponse { ProtobufPayload = message.ToByteString() }; - default: - throw new Exception("Unsupported request output format: " + request.PayloadCase); - } - } - catch (InvalidOperationException e) - { - return new ConformanceResponse { SerializeError = e.Message }; - } - } - - private static int? ReadInt32(BinaryReader input) - { - byte[] bytes = input.ReadBytes(4); - if (bytes.Length == 0) - { - // Cleanly reached the end of the stream - return null; - } - if (bytes.Length != 4) - { - throw new EndOfStreamException("Read " + bytes.Length + " bytes of size when expecting 4"); - } - return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24); - } - } -} From 32c8ed3b44cdb26316de3400e2eaab3e8b4670ce Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 5 Jul 2017 11:07:49 -0700 Subject: [PATCH 50/61] change csharp failure list --- conformance/failure_list_csharp.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/conformance/failure_list_csharp.txt b/conformance/failure_list_csharp.txt index d215235a8c..55e63922b9 100644 --- a/conformance/failure_list_csharp.txt +++ b/conformance/failure_list_csharp.txt @@ -2,7 +2,4 @@ Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_0 Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_1 Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_2 Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_3 -Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_0 -Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_1 -Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_2 -Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_3 + From bceb830c396e3370d4cc15e0d4f96ed1819dcca9 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Wed, 5 Jul 2017 12:15:53 -0700 Subject: [PATCH 51/61] add comments in makefile.am --- conformance/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conformance/Makefile.am b/conformance/Makefile.am index dcd1714c1c..9fad5409ae 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -4,8 +4,9 @@ conformance_protoc_inputs = \ conformance.proto \ $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto +# proto2 input files, should be separated with proto3, as we +# can't generate proto2 files for ruby, php and objc conformance_proto2_protoc_inputs = \ - conformance.proto \ $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto well_known_type_protoc_inputs = \ From e05e777d468c2486cea53764f1ac70859b5e98c4 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Thu, 30 Mar 2017 14:12:44 +0200 Subject: [PATCH 52/61] Windows: support long paths Add implementations of open(2), mkdir(2), stat(2), etc. that support long paths under Windows (paths longer than MAX_PATH in , which is 260 characters). The implementations are in a separate namespace (google::protobuf::internal::win32), so they won't collide with the standard implementations in , but after importing them with `using` they can be drop-in replacements. Fixes https://github.com/bazelbuild/bazel/issues/2634 Fixes https://github.com/google/protobuf/issues/2891 --- BUILD | 14 + cmake/extract_includes.bat.in | 1 + cmake/libprotobuf-lite.cmake | 1 + cmake/libprotoc.cmake | 1 + cmake/tests.cmake | 3 + src/Makefile.am | 3 + .../compiler/command_line_interface.cc | 38 +- .../command_line_interface_unittest.cc | 28 +- src/google/protobuf/compiler/importer.cc | 18 +- .../compiler/objectivec/objectivec_helpers.cc | 11 +- src/google/protobuf/compiler/plugin.cc | 17 +- .../protobuf/io/zero_copy_stream_impl.cc | 13 +- .../protobuf/io/zero_copy_stream_unittest.cc | 11 +- src/google/protobuf/message_unittest.cc | 12 +- src/google/protobuf/stubs/io_win32.cc | 362 +++++++++++++++++ src/google/protobuf/stubs/io_win32.h | 96 +++++ .../protobuf/stubs/io_win32_unittest.cc | 367 ++++++++++++++++++ src/google/protobuf/testing/file.cc | 19 +- src/google/protobuf/testing/googletest.cc | 36 +- 19 files changed, 970 insertions(+), 81 deletions(-) create mode 100644 src/google/protobuf/stubs/io_win32.cc create mode 100644 src/google/protobuf/stubs/io_win32.h create mode 100644 src/google/protobuf/stubs/io_win32_unittest.cc diff --git a/BUILD b/BUILD index 5102d6ff69..3ddd7b58fa 100644 --- a/BUILD +++ b/BUILD @@ -108,6 +108,7 @@ cc_library( "src/google/protobuf/stubs/bytestream.cc", "src/google/protobuf/stubs/common.cc", "src/google/protobuf/stubs/int128.cc", + "src/google/protobuf/stubs/io_win32.cc", "src/google/protobuf/stubs/once.cc", "src/google/protobuf/stubs/status.cc", "src/google/protobuf/stubs/statusor.cc", @@ -159,6 +160,7 @@ cc_library( "src/google/protobuf/service.cc", "src/google/protobuf/source_context.pb.cc", "src/google/protobuf/struct.pb.cc", + "src/google/protobuf/stubs/io_win32.cc", "src/google/protobuf/stubs/mathlimits.cc", "src/google/protobuf/stubs/substitute.cc", "src/google/protobuf/text_format.cc", @@ -470,6 +472,7 @@ COMMON_TEST_SRCS = [ # AUTOGEN(common_test_srcs) "src/google/protobuf/arena_test_util.cc", "src/google/protobuf/map_test_util.cc", + "src/google/protobuf/stubs/io_win32.cc", "src/google/protobuf/test_util.cc", "src/google/protobuf/testing/file.cc", "src/google/protobuf/testing/googletest.cc", @@ -490,6 +493,16 @@ cc_binary( ], ) +cc_test( + name = "win32_test", + srcs = ["src/google/protobuf/stubs/io_win32_unittest.cc"], + deps = [ + ":protobuf_lite", + "//external:gtest_main", + ], + tags = ["manual", "windows"], +) + cc_test( name = "protobuf_test", srcs = COMMON_TEST_SRCS + [ @@ -536,6 +549,7 @@ cc_test( "src/google/protobuf/stubs/bytestream_unittest.cc", "src/google/protobuf/stubs/common_unittest.cc", "src/google/protobuf/stubs/int128_unittest.cc", + "src/google/protobuf/stubs/io_win32_unittest.cc", "src/google/protobuf/stubs/once_unittest.cc", "src/google/protobuf/stubs/status_test.cc", "src/google/protobuf/stubs/statusor_test.cc", diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index 1278ee8704..549736a624 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -99,6 +99,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" includ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\io_win32.h" include\google\protobuf\stubs\io_win32.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index 1ee9b9c5df..cf72e2fe7d 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -13,6 +13,7 @@ set(libprotobuf_lite_files ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc ${protobuf_source_dir}/src/google/protobuf/stubs/common.cc ${protobuf_source_dir}/src/google/protobuf/stubs/int128.cc + ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc ${protobuf_source_dir}/src/google/protobuf/stubs/once.cc ${protobuf_source_dir}/src/google/protobuf/stubs/status.cc ${protobuf_source_dir}/src/google/protobuf/stubs/statusor.cc diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake index 5122654030..8ac8d479e1 100644 --- a/cmake/libprotoc.cmake +++ b/cmake/libprotoc.cmake @@ -93,6 +93,7 @@ set(libprotoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.cc ${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.cc ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc + ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc ) set(libprotoc_headers diff --git a/cmake/tests.cmake b/cmake/tests.cmake index 38dc0b522d..31f225753e 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -160,6 +160,8 @@ set(tests_files ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream_unittest.cc ${protobuf_source_dir}/src/google/protobuf/stubs/common_unittest.cc ${protobuf_source_dir}/src/google/protobuf/stubs/int128_unittest.cc + ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc + ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32_unittest.cc ${protobuf_source_dir}/src/google/protobuf/stubs/once_unittest.cc ${protobuf_source_dir}/src/google/protobuf/stubs/status_test.cc ${protobuf_source_dir}/src/google/protobuf/stubs/statusor_test.cc @@ -198,6 +200,7 @@ target_link_libraries(tests libprotoc libprotobuf gmock_main) set(test_plugin_files ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.cc + ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc ${protobuf_source_dir}/src/google/protobuf/testing/file.cc ${protobuf_source_dir}/src/google/protobuf/testing/file.h ${protobuf_source_dir}/src/google/protobuf/compiler/test_plugin.cc diff --git a/src/Makefile.am b/src/Makefile.am index 45a8a79b61..8d48f29375 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -198,6 +198,8 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/stubs/hash.h \ google/protobuf/stubs/int128.cc \ google/protobuf/stubs/int128.h \ + google/protobuf/stubs/io_win32.cc \ + google/protobuf/stubs/io_win32.h \ google/protobuf/stubs/map_util.h \ google/protobuf/stubs/mathutil.h \ google/protobuf/stubs/once.cc \ @@ -761,6 +763,7 @@ protobuf_test_SOURCES = \ google/protobuf/stubs/bytestream_unittest.cc \ google/protobuf/stubs/common_unittest.cc \ google/protobuf/stubs/int128_unittest.cc \ + google/protobuf/stubs/io_win32_unittest.cc \ google/protobuf/stubs/once_unittest.cc \ google/protobuf/stubs/statusor_test.cc \ google/protobuf/stubs/status_test.cc \ diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index df03907de3..4d894c82e1 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -45,10 +45,7 @@ #endif #include #include -#ifdef _MSC_VER -#include -#include -#else +#ifndef _MSC_VER #include #endif #include @@ -80,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -91,22 +89,6 @@ namespace google { namespace protobuf { namespace compiler { -#if defined(_WIN32) -#define mkdir(name, mode) mkdir(name) -#ifndef W_OK -#define W_OK 02 // not defined by MSVC for whatever reason -#endif -#ifndef F_OK -#define F_OK 00 // not defined by MSVC for whatever reason -#endif -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#endif - #ifndef O_BINARY #ifdef _O_BINARY #define O_BINARY _O_BINARY @@ -118,6 +100,14 @@ namespace compiler { namespace { #if defined(_WIN32) && !defined(__CYGWIN__) static const char* kPathSeparator = ";"; +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::access; +using google::protobuf::internal::win32::close; +using google::protobuf::internal::win32::mkdir; +using google::protobuf::internal::win32::open; +using google::protobuf::internal::win32::setmode; +using google::protobuf::internal::win32::write; #else static const char* kPathSeparator = ":"; #endif @@ -141,9 +131,9 @@ static bool IsWindowsAbsolutePath(const string& text) { void SetFdToTextMode(int fd) { #ifdef _WIN32 - if (_setmode(fd, _O_TEXT) == -1) { + if (setmode(fd, _O_TEXT) == -1) { // This should never happen, I think. - GOOGLE_LOG(WARNING) << "_setmode(" << fd << ", _O_TEXT): " << strerror(errno); + GOOGLE_LOG(WARNING) << "setmode(" << fd << ", _O_TEXT): " << strerror(errno); } #endif // (Text and binary are the same on non-Windows platforms.) @@ -151,9 +141,9 @@ void SetFdToTextMode(int fd) { void SetFdToBinaryMode(int fd) { #ifdef _WIN32 - if (_setmode(fd, _O_BINARY) == -1) { + if (setmode(fd, _O_BINARY) == -1) { // This should never happen, I think. - GOOGLE_LOG(WARNING) << "_setmode(" << fd << ", _O_BINARY): " << strerror(errno); + GOOGLE_LOG(WARNING) << "setmode(" << fd << ", _O_BINARY): " << strerror(errno); } #endif // (Text and binary are the same on non-Windows platforms.) diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index 366e623f1e..5fbb37a404 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -35,9 +35,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else +#ifndef _MSC_VER #include #endif #include @@ -65,27 +63,27 @@ #include #include +#include namespace google { namespace protobuf { namespace compiler { +#if defined(_WIN32) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::access; +using google::protobuf::internal::win32::dup; +using google::protobuf::internal::win32::dup2; +using google::protobuf::internal::win32::close; +using google::protobuf::internal::win32::open; +using google::protobuf::internal::win32::write; +#endif + // Disable the whole test when we use tcmalloc for "draconian" heap checks, in // which case tcmalloc will print warnings that fail the plugin tests. #if !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN -#if defined(_WIN32) -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef F_OK -#define F_OK 00 // not defined by MSVC for whatever reason -#endif -#endif - namespace { bool FileExists(const string& path) { diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc index 844edc1c8e..71e3c6de3e 100644 --- a/src/google/protobuf/compiler/importer.cc +++ b/src/google/protobuf/compiler/importer.cc @@ -33,7 +33,7 @@ // Sanjay Ghemawat, Jeff Dean, and others. #ifdef _MSC_VER -#include +#include #else #include #endif @@ -53,19 +53,21 @@ #include #include #include +#include #include -namespace google { -namespace protobuf { -namespace compiler { - #ifdef _WIN32 -#ifndef F_OK -#define F_OK 00 // not defined by MSVC for whatever reason -#endif #include +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::access; +using google::protobuf::internal::win32::open; #endif +namespace google { +namespace protobuf { +namespace compiler { + // Returns true if the text looks like a Windows-style absolute path, starting // with a drive letter. Example: "C:\foo". TODO(kenton): Share this with // copy in command_line_interface.cc? diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc index e347ef1eca..72b5d5f5f1 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc @@ -28,9 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifdef _MSC_VER -#include -#else +#ifndef _MSC_VER #include #endif #include @@ -49,8 +47,15 @@ #include #include #include +#include #include +#if defined(_WIN32) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::open; +#endif + // NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some // error cases, so it seems to be ok to use as a back door for errors. diff --git a/src/google/protobuf/compiler/plugin.cc b/src/google/protobuf/compiler/plugin.cc index 3848101d1f..e8ffbb5129 100644 --- a/src/google/protobuf/compiler/plugin.cc +++ b/src/google/protobuf/compiler/plugin.cc @@ -36,18 +36,12 @@ #include #ifdef _WIN32 -#include #include -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif #else #include #endif +#include #include #include #include @@ -55,6 +49,11 @@ #include #include +#if defined(_WIN32) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::setmode; +#endif namespace google { namespace protobuf { @@ -150,8 +149,8 @@ int PluginMain(int argc, char* argv[], const CodeGenerator* generator) { } #ifdef _WIN32 - _setmode(STDIN_FILENO, _O_BINARY); - _setmode(STDOUT_FILENO, _O_BINARY); + setmode(STDIN_FILENO, _O_BINARY); + setmode(STDOUT_FILENO, _O_BINARY); #endif CodeGeneratorRequest request; diff --git a/src/google/protobuf/io/zero_copy_stream_impl.cc b/src/google/protobuf/io/zero_copy_stream_impl.cc index 109c55c16f..c7372ac2cb 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl.cc +++ b/src/google/protobuf/io/zero_copy_stream_impl.cc @@ -32,9 +32,7 @@ // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. -#ifdef _MSC_VER -#include -#else +#ifndef _MSC_VER #include #include #include @@ -43,9 +41,9 @@ #include #include #include - #include #include +#include #include #include @@ -58,6 +56,13 @@ namespace io { // Win32 lseek is broken: If invoked on a non-seekable file descriptor, its // return value is undefined. We re-define it to always produce an error. #define lseek(fd, offset, origin) ((off_t)-1) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::access; +using google::protobuf::internal::win32::close; +using google::protobuf::internal::win32::open; +using google::protobuf::internal::win32::read; +using google::protobuf::internal::win32::write; #endif namespace { diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc index 235cbca405..f375408702 100644 --- a/src/google/protobuf/io/zero_copy_stream_unittest.cc +++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc @@ -47,9 +47,7 @@ // implementations. -#ifdef _MSC_VER -#include -#else +#ifndef _MSC_VER #include #endif #include @@ -72,6 +70,7 @@ #endif #include +#include #include #include #include @@ -84,6 +83,12 @@ namespace { #ifdef _WIN32 #define pipe(fds) _pipe(fds, 4096, O_BINARY) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::access; +using google::protobuf::internal::win32::mkdir; +using google::protobuf::internal::win32::open; +using google::protobuf::internal::win32::close; #endif #ifndef O_BINARY diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc index 0469f4caa2..cbf9051a9f 100644 --- a/src/google/protobuf/message_unittest.cc +++ b/src/google/protobuf/message_unittest.cc @@ -37,9 +37,7 @@ #include #include #include -#ifdef _MSC_VER -#include -#else +#ifndef _MSC_VER #include #endif #include @@ -56,6 +54,7 @@ #include #include +#include #include #include #include @@ -63,6 +62,13 @@ namespace google { namespace protobuf { +#if defined(_WIN32) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::close; +using google::protobuf::internal::win32::open; +#endif + #ifndef O_BINARY #ifdef _O_BINARY #define O_BINARY _O_BINARY diff --git a/src/google/protobuf/stubs/io_win32.cc b/src/google/protobuf/stubs/io_win32.cc new file mode 100644 index 0000000000..6f0295e121 --- /dev/null +++ b/src/google/protobuf/stubs/io_win32.cc @@ -0,0 +1,362 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: laszlocsomor@google.com (Laszlo Csomor) +// +// Implementation for long-path-aware open/mkdir/etc. on Windows. +// +// These functions convert the input path to an absolute Windows path +// with "\\?\" prefix if necessary, then pass that to _wopen/_wmkdir/etc. +// (declared in ) respectively. This allows working with files/directories +// whose paths are longer than MAX_PATH (260 chars). +// +// This file is only used on Windows, it's empty on other platforms. + +#if defined(_WIN32) + +// Comment this out to fall back to using the ANSI versions (open, mkdir, ...) +// instead of the Unicode ones (_wopen, _wmkdir, ...). Doing so can be useful to +// debug failing tests if that's caused by the long path support. +#define SUPPORT_LONGPATHS + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +namespace google { +namespace protobuf { +namespace internal { +namespace win32 { +namespace { + +using std::string; +using std::unique_ptr; +using std::wstring; + +template +struct CharTraits { + static bool is_alpha(char_type ch); +}; + +template <> +struct CharTraits { + static bool is_alpha(char ch) { return isalpha(ch); } +}; + +template <> +struct CharTraits { + static bool is_alpha(wchar_t ch) { return iswalpha(ch); } +}; + +// Returns true if the path starts with a drive letter, e.g. "c:". +// Note that this won't check for the "\" after the drive letter, so this also +// returns true for "c:foo" (which is "c:\${PWD}\foo"). +// This check requires that a path not have a longpath prefix ("\\?\"). +template +bool has_drive_letter(const char_type* ch) { + return CharTraits::is_alpha(ch[0]) && ch[1] == ':'; +} + +// Returns true if the path starts with a longpath prefix ("\\?\"). +template +bool has_longpath_prefix(const char_type* path) { + return path[0] == '\\' && path[1] == '\\' && path[2] == '?' && + path[3] == '\\'; +} + +// Returns true if the path starts with a drive specifier (e.g. "c:\"). +template +bool is_path_absolute(const char_type* path) { + return has_drive_letter(path) && is_separator(path[2]); +} + +template +bool is_separator(char_type c) { + return c == '/' || c == '\\'; +} + +template +bool is_drive_relative(const char_type* path) { + return has_drive_letter(path) && (path[2] == 0 || !is_separator(path[2])); +} + +template +void replace_directory_separators(char_type* p) { + for (; *p; ++p) { + if (*p == '/') { + *p = '\\'; + } + } +} + +string join_paths(const string& path1, const string& path2) { + if (path1.empty() || is_path_absolute(path2.c_str()) || + has_longpath_prefix(path2.c_str())) { + return path2; + } + if (path2.empty()) { + return path1; + } + + if (is_separator(path1.back())) { + return is_separator(path2.front()) ? (path1 + path2.substr(1)) + : (path1 + path2); + } else { + return is_separator(path2.front()) ? (path1 + path2) + : (path1 + '\\' + path2); + } +} + +string normalize(string path) { + if (has_longpath_prefix(path.c_str())) { + path = path.substr(4); + } + + static const string dot("."); + static const string dotdot(".."); + + std::vector segments; + int segment_start = -1; + // Find the path segments in `path` (separated by "/"). + for (int i = 0;; ++i) { + if (!is_separator(path[i]) && path[i] != '\0') { + // The current character does not end a segment, so start one unless it's + // already started. + if (segment_start < 0) { + segment_start = i; + } + } else if (segment_start >= 0 && i > segment_start) { + // The current character is "/" or "\0", so this ends a segment. + // Add that to `segments` if there's anything to add; handle "." and "..". + string segment(path, segment_start, i - segment_start); + segment_start = -1; + if (segment == dotdot) { + if (!segments.empty() && + (!has_drive_letter(segments[0].c_str()) || segments.size() > 1)) { + segments.pop_back(); + } + } else if (segment != dot && !segment.empty()) { + segments.push_back(segment); + } + } + if (path[i] == '\0') { + break; + } + } + + // Handle the case when `path` is just a drive specifier (or some degenerate + // form of it, e.g. "c:\.."). + if (segments.size() == 1 && segments[0].size() == 2 && + has_drive_letter(segments[0].c_str())) { + return segments[0] + '\\'; + } + + // Join all segments. + bool first = true; + std::ostringstream result; + for (const auto& s : segments) { + if (!first) { + result << '\\'; + } + first = false; + result << s; + } + // Preserve trailing separator if the input contained it. + if (is_separator(path.back())) { + result << '\\'; + } + return result.str(); +} + +std::unique_ptr as_wstring(const string& s) { + int len = ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), NULL, 0); + std::unique_ptr result(new WCHAR[len + 1]); + ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), result.get(), len + 1); + result.get()[len] = 0; + return std::move(result); +} + +wstring as_wchar_path(const string& path) { + std::unique_ptr wbuf(as_wstring(path)); + replace_directory_separators(wbuf.get()); + return wstring(wbuf.get()); +} + +bool as_windows_path(const string& path, wstring* result) { + if (path.empty()) { + result->clear(); + return true; + } + if (is_separator(path[0]) || is_drive_relative(path.c_str())) { + return false; + } + + string mutable_path = path; + if (!is_path_absolute(mutable_path.c_str()) && + !has_longpath_prefix(mutable_path.c_str())) { + char cwd[MAX_PATH]; + ::GetCurrentDirectoryA(MAX_PATH, cwd); + mutable_path = join_paths(cwd, mutable_path); + } + *result = as_wchar_path(normalize(mutable_path)); + if (!has_longpath_prefix(result->c_str())) { + // Add the "\\?\" prefix unconditionally. This way we prevent the Win32 API + // from processing the path and "helpfully" removing trailing dots from the + // path, for example. + // See https://github.com/bazelbuild/bazel/issues/2935 + *result = wstring(L"\\\\?\\") + *result; + } + return true; +} + +} // namespace + +int open(const char* path, int flags, int mode) { +#ifdef SUPPORT_LONGPATHS + wstring wpath; + if (!as_windows_path(path, &wpath)) { + errno = ENOENT; + return -1; + } + return ::_wopen(wpath.c_str(), flags, mode); +#else + return ::_open(path, flags, mode); +#endif +} + +int mkdir(const char* path, int _mode) { +#ifdef SUPPORT_LONGPATHS + wstring wpath; + if (!as_windows_path(path, &wpath)) { + errno = ENOENT; + return -1; + } + return ::_wmkdir(wpath.c_str()); +#else // not SUPPORT_LONGPATHS + return ::_mkdir(path); +#endif // not SUPPORT_LONGPATHS +} + +int access(const char* path, int mode) { +#ifdef SUPPORT_LONGPATHS + wstring wpath; + if (!as_windows_path(path, &wpath)) { + errno = ENOENT; + return -1; + } + return ::_waccess(wpath.c_str(), mode); +#else + return ::_access(path, mode); +#endif +} + +int chdir(const char* path) { +#ifdef SUPPORT_LONGPATHS + wstring wpath; + if (!as_windows_path(path, &wpath)) { + errno = ENOENT; + return -1; + } + return ::_wchdir(wpath.c_str()); +#else + return ::_chdir(path); +#endif +} + +int stat(const char* path, struct _stat* buffer) { +#ifdef SUPPORT_LONGPATHS + wstring wpath; + if (!as_windows_path(path, &wpath)) { + errno = ENOENT; + return -1; + } + return ::_wstat(wpath.c_str(), buffer); +#else // not SUPPORT_LONGPATHS + return ::_stat(path, buffer); +#endif // not SUPPORT_LONGPATHS +} + +FILE* fopen(const char* path, const char* mode) { +#ifdef SUPPORT_LONGPATHS + wstring wpath; + if (!as_windows_path(path, &wpath)) { + errno = ENOENT; + return NULL; + } + std::unique_ptr wmode(as_wstring(mode)); + return ::_wfopen(wpath.c_str(), wmode.get()); +#else + return ::fopen(path, mode); +#endif +} + +int close(int fd) { return ::close(fd); } + +int dup(int fd) { return ::_dup(fd); } + +int dup2(int fd1, int fd2) { return ::_dup2(fd1, fd2); } + +int read(int fd, void* buffer, size_t size) { + return ::_read(fd, buffer, size); +} + +int setmode(int fd, int mode) { return ::_setmode(fd, mode); } + +int write(int fd, const void* buffer, size_t size) { + return ::_write(fd, buffer, size); +} + +wstring testonly_path_to_winpath(const string& path) { + wstring wpath; + as_windows_path(path, &wpath); + return wpath; +} + +} // namespace win32 +} // namespace internal +} // namespace protobuf +} // namespace google + +#endif // defined(_WIN32) + diff --git a/src/google/protobuf/stubs/io_win32.h b/src/google/protobuf/stubs/io_win32.h new file mode 100644 index 0000000000..daccf16c7c --- /dev/null +++ b/src/google/protobuf/stubs/io_win32.h @@ -0,0 +1,96 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: laszlocsomor@google.com (Laszlo Csomor) +// +// This file contains the declarations for Windows implementations of +// commonly used POSIX functions such as open(2) and access(2), as well +// as macro definitions for flags of these functions. +// +// By including this file you'll redefine open/access/etc. to +// ::google::protobuf::internal::win32::{open/access/etc.}. +// Make sure you don't include a header that attempts to redeclare or +// redefine these functions, that'll lead to confusing compilation +// errors. It's best to #include this file as the last one to ensure that. +// +// This file is only used on Windows, it's empty on other platforms. + +#ifndef GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__ +#define GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__ + +#if defined(_WIN32) + +#include + +namespace google { +namespace protobuf { +namespace internal { +namespace win32 { + +FILE* fopen(const char* path, const char* mode); +int access(const char* path, int mode); +int chdir(const char* path); +int close(int fd); +int dup(int fd); +int dup2(int fd1, int fd2); +int mkdir(const char* path, int _mode); +int open(const char* path, int flags, int mode = 0); +int read(int fd, void* buffer, size_t size); +int setmode(int fd, int mode); +int stat(const char* path, struct _stat* buffer); +int write(int fd, const void* buffer, size_t size); +std::wstring testonly_path_to_winpath(const std::string& path); + +} // namespace win32 +} // namespace internal +} // namespace protobuf +} // namespace google + +#ifndef W_OK +#define W_OK 02 // not defined by MSVC for whatever reason +#endif + +#ifndef F_OK +#define F_OK 00 // not defined by MSVC for whatever reason +#endif + +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif + +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif + +#endif // defined(_WIN32) + +#endif // GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__ + + diff --git a/src/google/protobuf/stubs/io_win32_unittest.cc b/src/google/protobuf/stubs/io_win32_unittest.cc new file mode 100644 index 0000000000..90bd9c9601 --- /dev/null +++ b/src/google/protobuf/stubs/io_win32_unittest.cc @@ -0,0 +1,367 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: laszlocsomor@google.com (Laszlo Csomor) +// +// Unit tests for long-path-aware open/mkdir/access on Windows. +// +// This file is only used on Windows, it's empty on other platforms. + +#if defined(_WIN32) + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +namespace google { +namespace protobuf { +namespace internal { +namespace win32 { +namespace { + +using std::string; +using std::unique_ptr; +using std::wstring; + +class IoWin32Test : public ::testing::Test { + public: + void SetUp() override; + void TearDown() override; + + protected: + bool CreateAllUnder(wstring path); + bool DeleteAllUnder(wstring path); + + string test_tmpdir; + wstring wtest_tmpdir; +}; + +#define ASSERT_INITIALIZED \ + { \ + EXPECT_FALSE(test_tmpdir.empty()); \ + EXPECT_FALSE(wtest_tmpdir.empty()); \ + } + +void IoWin32Test::SetUp() { + test_tmpdir = string(TestTempDir()); + wtest_tmpdir.clear(); + if (test_tmpdir.empty()) { + const char* test_tmpdir_env = getenv("TEST_TMPDIR"); + if (test_tmpdir_env != nullptr && *test_tmpdir_env) { + test_tmpdir = string(test_tmpdir_env); + } + + // Only Bazel defines TEST_TMPDIR, CMake does not, so look for other + // suitable environment variables. + if (test_tmpdir.empty()) { + for (const char* name : {"TEMP", "TMP"}) { + test_tmpdir_env = getenv(name); + if (test_tmpdir_env != nullptr && *test_tmpdir_env) { + test_tmpdir = string(test_tmpdir_env); + break; + } + } + } + + // No other temp directory was found. Use the current director + if (test_tmpdir.empty()) { + char buffer[MAX_PATH]; + // Use GetCurrentDirectoryA instead of GetCurrentDirectoryW, because the + // current working directory must always be shorter than MAX_PATH, even + // with + // "\\?\" prefix (except on Windows 10 version 1607 and beyond, after + // opting in to long paths by default [1]). + // + // [1] https://msdn.microsoft.com/en-us/library/windows/ \ + // desktop/aa365247(v=vs.85).aspx#maxpath + DWORD result = ::GetCurrentDirectoryA(MAX_PATH, buffer); + if (result > 0) { + test_tmpdir = string(buffer); + } else { + // Using assertions in SetUp/TearDown seems to confuse the test + // framework, so just leave the member variables empty in case of + // failure. + GOOGLE_CHECK_OK(false); + return; + } + } + } + + while (test_tmpdir.back() == '/' || test_tmpdir.back() == '\\') { + test_tmpdir.pop_back(); + } + test_tmpdir += "\\io_win32_unittest.tmp"; + + // CreateDirectoryA's limit is 248 chars, see MSDN. + // https://msdn.microsoft.com/en-us/library/windows/ \ + // desktop/aa363855(v=vs.85).aspx + wtest_tmpdir = testonly_path_to_winpath(test_tmpdir); + if (!DeleteAllUnder(wtest_tmpdir) || !CreateAllUnder(wtest_tmpdir)) { + GOOGLE_CHECK_OK(false); + test_tmpdir.clear(); + wtest_tmpdir.clear(); + } +} + +void IoWin32Test::TearDown() { + if (!wtest_tmpdir.empty()) { + DeleteAllUnder(wtest_tmpdir); + } +} + +bool IoWin32Test::CreateAllUnder(wstring path) { + // Prepend UNC prefix if the path doesn't have it already. Don't bother + // checking if the path is shorter than MAX_PATH, let's just do it + // unconditionally. + if (path.find(L"\\\\?\\") != 0) { + path = wstring(L"\\\\?\\") + path; + } + if (::CreateDirectoryW(path.c_str(), NULL) || + GetLastError() == ERROR_ALREADY_EXISTS || + GetLastError() == ERROR_ACCESS_DENIED) { + return true; + } + if (GetLastError() == ERROR_PATH_NOT_FOUND) { + size_t pos = path.find_last_of(L'\\'); + if (pos != wstring::npos) { + wstring parent(path, 0, pos); + if (CreateAllUnder(parent) && CreateDirectoryW(path.c_str(), NULL)) { + return true; + } + } + } + return false; +} + +bool IoWin32Test::DeleteAllUnder(wstring path) { + static const wstring kDot(L"."); + static const wstring kDotDot(L".."); + + // Prepend UNC prefix if the path doesn't have it already. Don't bother + // checking if the path is shorter than MAX_PATH, let's just do it + // unconditionally. + if (path.find(L"\\\\?\\") != 0) { + path = wstring(L"\\\\?\\") + path; + } + // Append "\" if necessary. + if (path.back() != '\\') { + path.push_back('\\'); + } + + WIN32_FIND_DATAW metadata; + HANDLE handle = ::FindFirstFileW((path + L"*").c_str(), &metadata); + if (handle == INVALID_HANDLE_VALUE) { + return true; // directory doesn't exist + } + + bool result = true; + do { + wstring childname = metadata.cFileName; + if (kDot != childname && kDotDot != childname) { + wstring childpath = path + childname; + if ((metadata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { + // If this is not a junction, delete its contents recursively. + // Finally delete this directory/junction too. + if (((metadata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) == 0 && + !DeleteAllUnder(childpath)) || + !::RemoveDirectoryW(childpath.c_str())) { + result = false; + break; + } + } else { + if (!::DeleteFileW(childpath.c_str())) { + result = false; + break; + } + } + } + } while (::FindNextFileW(handle, &metadata)); + ::FindClose(handle); + return result; +} + +TEST_F(IoWin32Test, AccessTest) { + ASSERT_INITIALIZED; + + string path = test_tmpdir; + while (path.size() < MAX_PATH - 30) { + path += "\\accesstest"; + EXPECT_EQ(mkdir(path.c_str(), 0644), 0); + } + string file = path + "\\file.txt"; + int fd = open(file.c_str(), O_CREAT | O_WRONLY, 0644); + if (fd > 0) { + EXPECT_EQ(close(fd), 0); + } else { + EXPECT_TRUE(false); + } + + EXPECT_EQ(access(test_tmpdir.c_str(), F_OK), 0); + EXPECT_EQ(access(path.c_str(), F_OK), 0); + EXPECT_EQ(access(path.c_str(), W_OK), 0); + EXPECT_EQ(access(file.c_str(), F_OK | W_OK), 0); + EXPECT_NE(access((file + ".blah").c_str(), F_OK), 0); + EXPECT_NE(access((file + ".blah").c_str(), W_OK), 0); + + EXPECT_EQ(access(".", F_OK), 0); + EXPECT_EQ(access(".", W_OK), 0); + EXPECT_EQ(access((test_tmpdir + "/accesstest").c_str(), F_OK | W_OK), 0); + ASSERT_EQ(access((test_tmpdir + "/./normalize_me/.././accesstest").c_str(), + F_OK | W_OK), + 0); + EXPECT_NE(access("io_win32_unittest.AccessTest.nonexistent", F_OK), 0); + EXPECT_NE(access("io_win32_unittest.AccessTest.nonexistent", W_OK), 0); + + ASSERT_EQ(access("c:bad", F_OK), -1); + ASSERT_EQ(errno, ENOENT); + ASSERT_EQ(access("/tmp/bad", F_OK), -1); + ASSERT_EQ(errno, ENOENT); + ASSERT_EQ(access("\\bad", F_OK), -1); + ASSERT_EQ(errno, ENOENT); +} + +TEST_F(IoWin32Test, OpenTest) { + ASSERT_INITIALIZED; + + string path = test_tmpdir; + while (path.size() < MAX_PATH) { + path += "\\opentest"; + EXPECT_EQ(mkdir(path.c_str(), 0644), 0); + } + string file = path + "\\file.txt"; + int fd = open(file.c_str(), O_CREAT | O_WRONLY, 0644); + if (fd > 0) { + EXPECT_EQ(write(fd, "hello", 5), 5); + EXPECT_EQ(close(fd), 0); + } else { + EXPECT_TRUE(false); + } + + ASSERT_EQ(open("c:bad.txt", O_CREAT | O_WRONLY, 0644), -1); + ASSERT_EQ(errno, ENOENT); + ASSERT_EQ(open("/tmp/bad.txt", O_CREAT | O_WRONLY, 0644), -1); + ASSERT_EQ(errno, ENOENT); + ASSERT_EQ(open("\\bad.txt", O_CREAT | O_WRONLY, 0644), -1); + ASSERT_EQ(errno, ENOENT); +} + +TEST_F(IoWin32Test, MkdirTest) { + ASSERT_INITIALIZED; + + string path = test_tmpdir; + do { + path += "\\mkdirtest"; + ASSERT_EQ(mkdir(path.c_str(), 0644), 0); + } while (path.size() <= MAX_PATH); + + ASSERT_EQ(mkdir("c:bad", 0644), -1); + ASSERT_EQ(errno, ENOENT); + ASSERT_EQ(mkdir("/tmp/bad", 0644), -1); + ASSERT_EQ(errno, ENOENT); + ASSERT_EQ(mkdir("\\bad", 0644), -1); + ASSERT_EQ(errno, ENOENT); +} + +TEST_F(IoWin32Test, ChdirTest) { + char owd[MAX_PATH]; + EXPECT_GT(::GetCurrentDirectoryA(MAX_PATH, owd), 0); + string path("C:\\"); + EXPECT_EQ(access(path.c_str(), F_OK), 0); + ASSERT_EQ(chdir(path.c_str()), 0); + EXPECT_TRUE(::SetCurrentDirectoryA(owd)); + + // Do not try to chdir into the test_tmpdir, it may already contain directory + // names with trailing dots. + // Instead test here with an obviously dot-trailed path. If the win32_chdir + // function would not convert the path to absolute and prefix with "\\?\" then + // the Win32 API would ignore the trailing dot, but because of the prefixing + // there'll be no path processing done, so we'll actually attempt to chdir + // into "C:\some\path\foo." + path = test_tmpdir + "/foo."; + EXPECT_EQ(mkdir(path.c_str(), 644), 0); + EXPECT_EQ(access(path.c_str(), F_OK), 0); + ASSERT_NE(chdir(path.c_str()), 0); +} + +TEST_F(IoWin32Test, AsWindowsPathTest) { + DWORD size = GetCurrentDirectoryW(0, NULL); + unique_ptr cwd_str(new wchar_t[size]); + EXPECT_GT(GetCurrentDirectoryW(size, cwd_str.get()), 0); + wstring cwd = wstring(L"\\\\?\\") + cwd_str.get(); + + ASSERT_EQ(testonly_path_to_winpath("relative_mkdirtest"), + cwd + L"\\relative_mkdirtest"); + ASSERT_EQ(testonly_path_to_winpath("preserve//\\trailing///"), + cwd + L"\\preserve\\trailing\\"); + ASSERT_EQ(testonly_path_to_winpath("./normalize_me\\/../blah"), + cwd + L"\\blah"); + std::ostringstream relpath; + for (wchar_t* p = cwd_str.get(); *p; ++p) { + if (*p == '/' || *p == '\\') { + relpath << "../"; + } + } + relpath << ".\\/../\\./beyond-toplevel"; + ASSERT_EQ(testonly_path_to_winpath(relpath.str()), + wstring(L"\\\\?\\") + cwd_str.get()[0] + L":\\beyond-toplevel"); + + // Absolute unix paths lack drive letters, driveless absolute windows paths + // do too. Neither can be converted to a drive-specifying absolute Windows + // path. + ASSERT_EQ(testonly_path_to_winpath("/absolute/unix/path"), L""); + // Though valid on Windows, we also don't support UNC paths (\\UNC\\blah). + ASSERT_EQ(testonly_path_to_winpath("\\driveless\\absolute"), L""); + // Though valid in cmd.exe, drive-relative paths are not supported. + ASSERT_EQ(testonly_path_to_winpath("c:foo"), L""); + ASSERT_EQ(testonly_path_to_winpath("c:/foo"), L"\\\\?\\c:\\foo"); +} + +} // namespace +} // namespace win32 +} // namespace internal +} // namespace protobuf +} // namespace google + +#endif // defined(_WIN32) + diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc index 470512edff..a1850e44a7 100644 --- a/src/google/protobuf/testing/file.cc +++ b/src/google/protobuf/testing/file.cc @@ -38,24 +38,28 @@ #ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN // yeah, right #include // Find*File(). :( -#include -#include +// #include #else #include #include #endif #include +#include + namespace google { namespace protobuf { #ifdef _WIN32 -#define mkdir(name, mode) mkdir(name) // Windows doesn't have symbolic links. #define lstat stat -#ifndef F_OK -#define F_OK 00 // not defined by MSVC for whatever reason -#endif +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::access; +using google::protobuf::internal::win32::chdir; +using google::protobuf::internal::win32::fopen; +using google::protobuf::internal::win32::mkdir; +using google::protobuf::internal::win32::stat; #endif bool File::Exists(const string& name) { @@ -113,6 +117,9 @@ void File::WriteStringToFileOrDie(const string& contents, const string& name) { } bool File::CreateDir(const string& name, int mode) { + if (!name.empty()) { + GOOGLE_CHECK_OK(name.back() != '.'); + } return mkdir(name.c_str(), mode) == 0; } diff --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc index d45706b654..c6fb00d43f 100644 --- a/src/google/protobuf/testing/googletest.cc +++ b/src/google/protobuf/testing/googletest.cc @@ -33,14 +33,14 @@ #include #include +#include #include #include #include #include #include #ifdef _MSC_VER -#include -#include +// #include #else #include #endif @@ -53,7 +53,13 @@ namespace google { namespace protobuf { #ifdef _WIN32 -#define mkdir(name, mode) mkdir(name) +// DO NOT include , instead create functions in io_win32.{h,cc} and import +// them like we do below. +using google::protobuf::internal::win32::close; +using google::protobuf::internal::win32::dup2; +using google::protobuf::internal::win32::dup; +using google::protobuf::internal::win32::mkdir; +using google::protobuf::internal::win32::open; #endif #ifndef O_BINARY @@ -111,14 +117,32 @@ string GetTemporaryDirectoryName() { char b[L_tmpnam + 1]; // HPUX multithread return 0 if s is 0 string result = tmpnam(b); #ifdef _WIN32 + // Avoid a trailing dot by changing it to an underscore. On Win32 the names of + // files and directories can, but should not, end with dot. + // + // In MS-DOS and FAT16 filesystem the filenames were 8dot3 style so it didn't + // make sense to have a name ending in dot without an extension, so the shell + // silently ignored trailing dots. To this day the Win32 API still maintains + // this behavior and silently ignores trailing dots in path arguments of + // functions such as CreateFile{A,W}. Even POSIX API function implementations + // seem to wrap the Win32 API functions (e.g. CreateDirectoryA) and behave + // this way. + // It's possible to avoid this behavior and create files / directories with + // trailing dots (using CreateFileW / CreateDirectoryW and prefixing the path + // with "\\?\") but these will be degenerate in the sense that you cannot + // chdir into such directories (or navigate into them with Windows Explorer) + // nor can you open such files with some programs (e.g. Notepad). + if (result.back() == '.') { + result[result.size() - 1] = '_'; + } // On Win32, tmpnam() returns a file prefixed with '\', but which is supposed // to be used in the current working directory. WTF? if (HasPrefixString(result, "\\")) { result.erase(0, 1); } - // The Win32 API accepts forward slashes as a path delimiter even though - // backslashes are standard. Let's avoid confusion and use only forward - // slashes. + // The Win32 API accepts forward slashes as a path delimiter as long as the + // path doesn't use the "\\?\" prefix. + // Let's avoid confusion and use only forward slashes. result = StringReplace(result, "\\", "/", true); #endif // _WIN32 return result; From aa61bb0d3cee089c37da32584d03132177dd847c Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 19 Jul 2017 14:57:34 -0700 Subject: [PATCH 53/61] compiles removal of newline (#3333) (#3370) --- php/src/Google/Protobuf/Internal/DescriptorProto.php | 1 - .../Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php | 1 - .../Google/Protobuf/Internal/DescriptorProto_ReservedRange.php | 1 - php/src/Google/Protobuf/Internal/EnumDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/EnumOptions.php | 1 - php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/EnumValueOptions.php | 1 - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/FieldOptions.php | 1 - php/src/Google/Protobuf/Internal/FileDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/FileDescriptorSet.php | 1 - php/src/Google/Protobuf/Internal/FileOptions.php | 1 - php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php | 1 - .../Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php | 1 - php/src/Google/Protobuf/Internal/MessageOptions.php | 1 - php/src/Google/Protobuf/Internal/MethodDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/MethodOptions.php | 1 - php/src/Google/Protobuf/Internal/OneofDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/OneofOptions.php | 1 - php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php | 1 - php/src/Google/Protobuf/Internal/ServiceOptions.php | 1 - php/src/Google/Protobuf/Internal/SourceCodeInfo.php | 1 - php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php | 1 - php/src/Google/Protobuf/Internal/UninterpretedOption.php | 1 - .../Google/Protobuf/Internal/UninterpretedOption_NamePart.php | 1 - 25 files changed, 25 deletions(-) diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto.php b/php/src/Google/Protobuf/Internal/DescriptorProto.php index 3f975b8aab..1d6959b71d 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/DescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php b/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php index bbd34824c9..51d5d3593f 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php +++ b/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php b/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php index 3d61313350..b1022d6154 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php +++ b/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php index adc21fc651..816fbae544 100644 --- a/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/EnumOptions.php b/php/src/Google/Protobuf/Internal/EnumOptions.php index 6067d5a09a..3f598a41e7 100644 --- a/php/src/Google/Protobuf/Internal/EnumOptions.php +++ b/php/src/Google/Protobuf/Internal/EnumOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php b/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php index b761fbcf11..e363220fc1 100644 --- a/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/EnumValueOptions.php b/php/src/Google/Protobuf/Internal/EnumValueOptions.php index b7bcd2379e..db8de174d7 100644 --- a/php/src/Google/Protobuf/Internal/EnumValueOptions.php +++ b/php/src/Google/Protobuf/Internal/EnumValueOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php b/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php index fbe4e1bff8..10c2759330 100644 --- a/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/FieldOptions.php b/php/src/Google/Protobuf/Internal/FieldOptions.php index 593536ff13..3144e67086 100644 --- a/php/src/Google/Protobuf/Internal/FieldOptions.php +++ b/php/src/Google/Protobuf/Internal/FieldOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/FileDescriptorProto.php b/php/src/Google/Protobuf/Internal/FileDescriptorProto.php index c61cf91756..9ee222d19b 100644 --- a/php/src/Google/Protobuf/Internal/FileDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/FileDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/FileDescriptorSet.php b/php/src/Google/Protobuf/Internal/FileDescriptorSet.php index 2b6ed0ab8f..0b2cf95766 100644 --- a/php/src/Google/Protobuf/Internal/FileDescriptorSet.php +++ b/php/src/Google/Protobuf/Internal/FileDescriptorSet.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/FileOptions.php b/php/src/Google/Protobuf/Internal/FileOptions.php index c7972ca794..c2dd5e08f3 100644 --- a/php/src/Google/Protobuf/Internal/FileOptions.php +++ b/php/src/Google/Protobuf/Internal/FileOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php index a69bef85ff..ae2ad74558 100644 --- a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php +++ b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php index 86c9f62932..22ac2337c6 100644 --- a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php +++ b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/MessageOptions.php b/php/src/Google/Protobuf/Internal/MessageOptions.php index 0a0bfb2d66..99ff3d0ee2 100644 --- a/php/src/Google/Protobuf/Internal/MessageOptions.php +++ b/php/src/Google/Protobuf/Internal/MessageOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php b/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php index 95b614f311..ccfce2dbd6 100644 --- a/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/MethodOptions.php b/php/src/Google/Protobuf/Internal/MethodOptions.php index 17a8b4532b..baa806b7aa 100644 --- a/php/src/Google/Protobuf/Internal/MethodOptions.php +++ b/php/src/Google/Protobuf/Internal/MethodOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php b/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php index 255ff57298..15ff061074 100644 --- a/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/OneofOptions.php b/php/src/Google/Protobuf/Internal/OneofOptions.php index fb8c3bfad0..e5b4633d59 100644 --- a/php/src/Google/Protobuf/Internal/OneofOptions.php +++ b/php/src/Google/Protobuf/Internal/OneofOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php b/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php index e10bd5331f..da88e9c444 100644 --- a/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/ServiceOptions.php b/php/src/Google/Protobuf/Internal/ServiceOptions.php index a231917033..3e7214a1eb 100644 --- a/php/src/Google/Protobuf/Internal/ServiceOptions.php +++ b/php/src/Google/Protobuf/Internal/ServiceOptions.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/SourceCodeInfo.php b/php/src/Google/Protobuf/Internal/SourceCodeInfo.php index d21fe8ebcd..6ce05ed420 100644 --- a/php/src/Google/Protobuf/Internal/SourceCodeInfo.php +++ b/php/src/Google/Protobuf/Internal/SourceCodeInfo.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php b/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php index 210bf0734a..19ed2bc229 100644 --- a/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php +++ b/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/UninterpretedOption.php b/php/src/Google/Protobuf/Internal/UninterpretedOption.php index daa730d0ec..4d342eb33b 100644 --- a/php/src/Google/Protobuf/Internal/UninterpretedOption.php +++ b/php/src/Google/Protobuf/Internal/UninterpretedOption.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** diff --git a/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php b/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php index 69a96d456e..c9a6fc3c7f 100644 --- a/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php +++ b/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php @@ -8,7 +8,6 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBWire; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\InputStream; - use Google\Protobuf\Internal\GPBUtil; /** From 417aae615489f6b6a0aa750a4c3b4affe597d923 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 19 Jul 2017 15:24:30 -0700 Subject: [PATCH 54/61] Fixed dynamic initialization for C++ lite An ifdef condition seems to have been inverted by mistake, causing the dynamic initialization to occur for lite if and only if the _NO_STATIC_INITIALIZER macro is set. This problem manifested itself as segfaults due to uninitialized empty strings: https://github.com/google/protobuf/issues/2839 Since no one complained about initialization not happening, it would appear that we can just disable this initialization for lite unconditionally, so that is what this change does. Instead of the default instance initialization happening pre-main, it now always happens lazily when needed. --- src/google/protobuf/any.pb.cc | 2 +- src/google/protobuf/api.pb.cc | 2 +- src/google/protobuf/compiler/cpp/cpp_file.cc | 31 ++++++++----------- .../protobuf/compiler/cpp/cpp_message.cc | 4 --- src/google/protobuf/compiler/plugin.pb.cc | 2 +- src/google/protobuf/compiler/profile.pb.cc | 2 +- src/google/protobuf/descriptor.pb.cc | 2 +- src/google/protobuf/duration.pb.cc | 4 +-- src/google/protobuf/empty.pb.cc | 4 +-- src/google/protobuf/field_mask.pb.cc | 2 +- src/google/protobuf/source_context.pb.cc | 2 +- src/google/protobuf/struct.pb.cc | 8 +---- src/google/protobuf/timestamp.pb.cc | 4 +-- src/google/protobuf/type.pb.cc | 12 +------ src/google/protobuf/wrappers.pb.cc | 20 +----------- 15 files changed, 26 insertions(+), 75 deletions(-) diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 419eb68314..e36ffb5fc6 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -123,7 +123,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 9a87faa965..766c7e0d72 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -182,7 +182,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 1f7a66c5eb..d79a3e73d3 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -526,11 +526,10 @@ class FileGenerator::ForwardDeclarations { void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // AddDescriptors() is a file-level procedure which adds the encoded // FileDescriptorProto for this .proto file to the global DescriptorPool for - // generated files (DescriptorPool::generated_pool()). It either runs at - // static initialization time (by default) or when default_instance() is - // called for the first time (in LITE_RUNTIME mode with - // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER flag enabled). This procedure also - // constructs default instances and registers extensions. + // generated files (DescriptorPool::generated_pool()). It ordinarily runs at + // static initialization time, but is not used at all in LITE_RUNTIME mode + // except when extensions are used. This procedure also constructs default + // instances and registers extensions. // // Its sibling, AssignDescriptors(), actually pulls the compiled // FileDescriptor from the DescriptorPool and uses it to populate all of @@ -889,19 +888,15 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { " ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);\n" "}\n"); - if (!StaticInitializersForced(file_, options_)) { - printer->Print("#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"); - } - printer->Print( - // With static initializers. - "// Force AddDescriptors() to be called at static initialization time.\n" - "struct StaticDescriptorInitializer {\n" - " StaticDescriptorInitializer() {\n" - " AddDescriptors();\n" - " }\n" - "} static_descriptor_initializer;\n"); - if (!StaticInitializersForced(file_, options_)) { - printer->Print("#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"); + if (StaticInitializersForced(file_, options_)) { + printer->Print( + "// Force AddDescriptors() to be called at dynamic initialization " + "time.\n" + "struct StaticDescriptorInitializer {\n" + " StaticDescriptorInitializer() {\n" + " AddDescriptors();\n" + " }\n" + "} static_descriptor_initializer;\n"); } } diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index 8ff03b39e3..33231ae383 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -2411,11 +2411,7 @@ GenerateStructors(io::Printer* printer) { printer->Print( "$classname$::$classname$(::google::protobuf::Arena* arena)\n" " : $initializer$ {\n" - // When arenas are used it's safe to assume we have finished - // static init time (protos with arenas are unsafe during static init) - "#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n" " $file_namespace$::InitDefaults();\n" - "#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n" " SharedCtor();\n" " RegisterArenaDtor(arena);\n" " // @@protoc_insertion_point(arena_constructor:$full_name$)\n" diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 8846bd746f..3842ef612f 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -201,7 +201,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/compiler/profile.pb.cc b/src/google/protobuf/compiler/profile.pb.cc index 7bc6ab507f..bf69f79d9b 100644 --- a/src/google/protobuf/compiler/profile.pb.cc +++ b/src/google/protobuf/compiler/profile.pb.cc @@ -167,7 +167,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 1c57ffb43d..04c6b8e1c6 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -820,7 +820,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index e460e1d0c8..3892b197a9 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -123,7 +123,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); @@ -151,9 +151,7 @@ Duration::Duration() Duration::Duration(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration) diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 01f8bbcf01..86a77b6116 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -120,7 +120,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); @@ -146,9 +146,7 @@ Empty::Empty() Empty::Empty(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Empty) diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index 7a3c49bd15..faba7a028c 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -122,7 +122,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index f8550583ac..d0c5882517 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -123,7 +123,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 8cdaf3b773..28cfd3bd55 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -193,7 +193,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); @@ -253,9 +253,7 @@ Struct::Struct(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), fields_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct) @@ -652,9 +650,7 @@ Value::Value() Value::Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Value) @@ -1562,9 +1558,7 @@ ListValue::ListValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), values_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue) diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index f40ec3c5b4..a8c3a1b476 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -123,7 +123,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); @@ -151,9 +151,7 @@ Timestamp::Timestamp() Timestamp::Timestamp(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp) diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 4516df259f..f07bb0c6b3 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -244,7 +244,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); @@ -406,9 +406,7 @@ Type::Type(::google::protobuf::Arena* arena) fields_(arena), oneofs_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Type) @@ -1171,9 +1169,7 @@ Field::Field(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Field) @@ -2245,9 +2241,7 @@ Enum::Enum(::google::protobuf::Arena* arena) _internal_metadata_(arena), enumvalue_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Enum) @@ -2885,9 +2879,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), options_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValue) @@ -3381,9 +3373,7 @@ Option::Option() Option::Option(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Option) diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc index eba8dfed43..9cd95c4113 100644 --- a/src/google/protobuf/wrappers.pb.cc +++ b/src/google/protobuf/wrappers.pb.cc @@ -240,7 +240,7 @@ void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -// Force AddDescriptors() to be called at static initialization time. +// Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); @@ -267,9 +267,7 @@ DoubleValue::DoubleValue() DoubleValue::DoubleValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.DoubleValue) @@ -532,9 +530,7 @@ FloatValue::FloatValue() FloatValue::FloatValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.FloatValue) @@ -797,9 +793,7 @@ Int64Value::Int64Value() Int64Value::Int64Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Int64Value) @@ -1064,9 +1058,7 @@ UInt64Value::UInt64Value() UInt64Value::UInt64Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.UInt64Value) @@ -1331,9 +1323,7 @@ Int32Value::Int32Value() Int32Value::Int32Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Int32Value) @@ -1598,9 +1588,7 @@ UInt32Value::UInt32Value() UInt32Value::UInt32Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.UInt32Value) @@ -1865,9 +1853,7 @@ BoolValue::BoolValue() BoolValue::BoolValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.BoolValue) @@ -2130,9 +2116,7 @@ StringValue::StringValue() StringValue::StringValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.StringValue) @@ -2468,9 +2452,7 @@ BytesValue::BytesValue() BytesValue::BytesValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { -#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults(); -#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.BytesValue) From d640cddf1984e2724656b37a40fe94a5483a44db Mon Sep 17 00:00:00 2001 From: Arnold Schrijver Date: Fri, 21 Jul 2017 13:06:04 +0200 Subject: [PATCH 55/61] Updated outdated hyperlink Github repo had moved, pointing to correct location. --- docs/third_party.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/third_party.md b/docs/third_party.md index 30dbd81373..4c9ffef33b 100644 --- a/docs/third_party.md +++ b/docs/third_party.md @@ -141,7 +141,7 @@ There are miscellaneous other things you may find useful as a Protocol Buffers d * http://igor-petruk.github.com/protobuf-maven-plugin/ * http://code.google.com/p/maven-protoc-plugin/ * https://github.com/os72/protoc-jar-maven-plugin -* [Documentation generator plugin (Markdown/HTML/DocBook/...)](https://github.com/estan/protoc-gen-doc) +* [Documentation generator plugin (Markdown/HTML/DocBook/...)](https://github.com/pseudomuto/protoc-gen-doc) * [DocBook generator for .proto files](http://code.google.com/p/protoc-gen-docbook/) * [Protobuf for nginx module](https://github.com/dbcode/protobuf-nginx/) * [RSpec matchers and Cucumber step defs for testing Protocol Buffers](https://github.com/connamara/protobuf_spec) From 668712c58fe518fdc997cc2103b848b043adceb6 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 21 Jul 2017 18:57:07 +0200 Subject: [PATCH 56/61] CMake: Install .pc Files Adds pkg-config (`.pc`) files for CMake based installs. --- cmake/install.cmake | 7 +++++++ cmake/protobuf-lite.pc.cmake | 11 +++++++++++ cmake/protobuf.pc.cmake | 11 +++++++++++ 3 files changed, 29 insertions(+) create mode 100644 cmake/protobuf-lite.pc.cmake create mode 100644 cmake/protobuf.pc.cmake diff --git a/cmake/install.cmake b/cmake/install.cmake index 28dc90dc3f..441bf5532a 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -1,5 +1,10 @@ include(GNUInstallDirs) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake + ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake + ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) + foreach(_library libprotobuf-lite libprotobuf @@ -17,6 +22,8 @@ endforeach() install(TARGETS protoc EXPORT protobuf-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + file(STRINGS extract_includes.bat.in _extract_strings REGEX "^copy") foreach(_extract_string ${_extract_strings}) diff --git a/cmake/protobuf-lite.pc.cmake b/cmake/protobuf-lite.pc.cmake new file mode 100644 index 0000000000..cbe5426afa --- /dev/null +++ b/cmake/protobuf-lite.pc.cmake @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: Protocol Buffers +Description: Google's Data Interchange Format +Version: @protobuf_VERSION@ +Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@ +Conflicts: protobuf diff --git a/cmake/protobuf.pc.cmake b/cmake/protobuf.pc.cmake new file mode 100644 index 0000000000..d33e98cca8 --- /dev/null +++ b/cmake/protobuf.pc.cmake @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: Protocol Buffers +Description: Google's Data Interchange Format +Version: @protobuf_VERSION@ +Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@ +Conflicts: protobuf-lite From 74dcf447af2ce8550cd175ca18d98005980a9120 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sun, 23 Jul 2017 19:34:24 +0200 Subject: [PATCH 57/61] Travis: Exclude CMake .pc files Exclude the unconfigured .pc input files of the CMake based install: they shall not be packed/distributed, only their outputs are --- tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests.sh b/tests.sh index c6eda93e2d..fa4a347941 100755 --- a/tests.sh +++ b/tests.sh @@ -63,6 +63,7 @@ build_cpp_distcheck() { # List all files that should be included in the distribution package. git ls-files | grep "^\(java\|python\|objectivec\|csharp\|js\|ruby\|php\|cmake\|examples\)" |\ grep -v ".gitignore" | grep -v "java/compatibility_tests" |\ + grep -v "cmake/protobuf.*\.pc\.cmake" |\ grep -v "python/compatibility_tests" | grep -v "csharp/compatibility_tests" > dist.lst # Unzip the dist tar file. DIST=`ls *.tar.gz` From 0d9a34c7b2c66ba324cdbe620a6013b037be3b5d Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Mon, 24 Jul 2017 11:48:55 -0500 Subject: [PATCH 58/61] Add -Werror=missing-declarations to test builds Treat missing declarations as an error for test builds, to prevent future updates which add functions without properly declaring them. This will prevent broken builds in more restrictive build environments. --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 754401a1db..18529dc898 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -925,7 +925,7 @@ no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \ ../gmock/gtest/lib/libgtest_main.la no_warning_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \ - -Wall -Wconversion -Werror + -Wall -Wconversion -Werror -Werror=missing-declarations nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs) TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \ From b6da2262e811d5c8d4b65d62756e9901a8dff48d Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Mon, 24 Jul 2017 16:52:04 -0500 Subject: [PATCH 59/61] Put AddDescriptorsImpl() in anonymous namespace AddDescriptorsImpl() is a private static implementation detail, and needs to be declared but won't be used from outside the source file. Place it inside an anonymous namespace to fix a previous build error that would result in more restrictive build enviornments that use -Werror=missing-declarations or similar compiler flags. --- src/google/protobuf/any.pb.cc | 2 ++ src/google/protobuf/api.pb.cc | 2 ++ src/google/protobuf/compiler/cpp/cpp_file.cc | 2 ++ src/google/protobuf/compiler/plugin.pb.cc | 2 ++ src/google/protobuf/compiler/profile.pb.cc | 2 ++ src/google/protobuf/descriptor.pb.cc | 2 ++ src/google/protobuf/duration.pb.cc | 2 ++ src/google/protobuf/empty.pb.cc | 2 ++ src/google/protobuf/field_mask.pb.cc | 2 ++ src/google/protobuf/source_context.pb.cc | 2 ++ src/google/protobuf/struct.pb.cc | 2 ++ src/google/protobuf/timestamp.pb.cc | 2 ++ src/google/protobuf/type.pb.cc | 2 ++ src/google/protobuf/wrappers.pb.cc | 2 ++ 14 files changed, 28 insertions(+) diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index e36ffb5fc6..948530ba33 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -102,6 +102,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -118,6 +119,7 @@ void AddDescriptorsImpl() { "google/protobuf/any.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 766c7e0d72..093bf1cb4e 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -146,6 +146,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -177,6 +178,7 @@ void AddDescriptorsImpl() { ::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors(); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index d79a3e73d3..feb8ba651e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -811,6 +811,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // Now generate the AddDescriptors() function. printer->Print( + "namespace {\n" "void AddDescriptorsImpl() {\n" " InitDefaults();\n"); @@ -882,6 +883,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { printer->Outdent(); printer->Print( "}\n" + "} // anonymous namespace\n" "\n" "void AddDescriptors() {\n" " static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n" diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 3842ef612f..516a5878fb 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -169,6 +169,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -196,6 +197,7 @@ void AddDescriptorsImpl() { ::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors(); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/compiler/profile.pb.cc b/src/google/protobuf/compiler/profile.pb.cc index bf69f79d9b..4616b51480 100644 --- a/src/google/protobuf/compiler/profile.pb.cc +++ b/src/google/protobuf/compiler/profile.pb.cc @@ -143,6 +143,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -162,6 +163,7 @@ void AddDescriptorsImpl() { "google/protobuf/compiler/profile.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 04c6b8e1c6..78935211ce 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -663,6 +663,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -815,6 +816,7 @@ void AddDescriptorsImpl() { "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index 3892b197a9..e3c522f5be 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -102,6 +102,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -118,6 +119,7 @@ void AddDescriptorsImpl() { "google/protobuf/duration.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 86a77b6116..9ff146f0d9 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -100,6 +100,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -115,6 +116,7 @@ void AddDescriptorsImpl() { "google/protobuf/empty.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index faba7a028c..5b29d247c1 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -101,6 +101,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -117,6 +118,7 @@ void AddDescriptorsImpl() { "google/protobuf/field_mask.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index d0c5882517..9d394f7044 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -101,6 +101,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -118,6 +119,7 @@ void AddDescriptorsImpl() { "google/protobuf/source_context.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 28cfd3bd55..a7ce00406f 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -161,6 +161,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -188,6 +189,7 @@ void AddDescriptorsImpl() { "google/protobuf/struct.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index a8c3a1b476..7c9d396eca 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -102,6 +102,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -118,6 +119,7 @@ void AddDescriptorsImpl() { "google/protobuf/timestamp.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index f07bb0c6b3..fe4220877c 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -187,6 +187,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -239,6 +240,7 @@ void AddDescriptorsImpl() { ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc index 9cd95c4113..8b8dc15011 100644 --- a/src/google/protobuf/wrappers.pb.cc +++ b/src/google/protobuf/wrappers.pb.cc @@ -213,6 +213,7 @@ void InitDefaults() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } +namespace { void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] = { @@ -235,6 +236,7 @@ void AddDescriptorsImpl() { "google/protobuf/wrappers.proto", &protobuf_RegisterTypes); ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); } +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); From 451d061141a14021ff95a093967827cd548720ba Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 25 Jul 2017 00:49:16 -0700 Subject: [PATCH 60/61] Fix cycle dependency for repeated field not collected by gc (#3399) --- php/ext/google/protobuf/array.c | 66 +++++++++++++------ php/ext/google/protobuf/encode_decode.c | 4 +- php/ext/google/protobuf/map.c | 8 +-- php/ext/google/protobuf/protobuf.c | 12 ++-- php/ext/google/protobuf/protobuf.h | 57 +++++++++++++--- php/ext/google/protobuf/storage.c | 88 +++++++++++++++++++++++-- php/tests/array_test.php | 49 ++++++++------ php/tests/map_field_test.php | 23 +++++++ 8 files changed, 243 insertions(+), 64 deletions(-) diff --git a/php/ext/google/protobuf/array.c b/php/ext/google/protobuf/array.c index e9f5f156ff..e69bef4299 100644 --- a/php/ext/google/protobuf/array.c +++ b/php/ext/google/protobuf/array.c @@ -142,12 +142,7 @@ static inline void php_proto_array_string_release(zval *value) { efree(ptr); } static inline void php_proto_array_object_release(zval *value) { - void* ptr = Z_PTR_P(value); - zend_object* object = *(zend_object**)ptr; - if(--GC_REFCOUNT(object) == 0) { - zend_objects_store_del(object); - } - efree(ptr); + zval_ptr_dtor(value); } static void php_proto_array_default_release(zval* value) { void* ptr = Z_PTR_P(value); @@ -210,7 +205,11 @@ static void repeated_field_write_dimension(zval *object, zval *offset, } } - php_proto_zend_hash_index_update(ht, index, memory, size, NULL); + if (intern->type == UPB_TYPE_MESSAGE) { + php_proto_zend_hash_index_update_zval(ht, index, *(zval**)memory); + } else { + php_proto_zend_hash_index_update_mem(ht, index, memory, size, NULL); + } } #if PHP_MAJOR_VERSION < 7 @@ -233,9 +232,18 @@ void *repeated_field_index_native(RepeatedField *intern, int index TSRMLS_DC) { HashTable *ht = PHP_PROTO_HASH_OF(intern->array); void *value; - if (php_proto_zend_hash_index_find(ht, index, (void **)&value) == FAILURE) { - zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); - return NULL; + if (intern->type == UPB_TYPE_MESSAGE) { + if (php_proto_zend_hash_index_find_zval(ht, index, (void **)&value) == + FAILURE) { + zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); + return NULL; + } + } else { + if (php_proto_zend_hash_index_find_mem(ht, index, (void **)&value) == + FAILURE) { + zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); + return NULL; + } } return value; @@ -244,7 +252,11 @@ void *repeated_field_index_native(RepeatedField *intern, int index TSRMLS_DC) { void repeated_field_push_native(RepeatedField *intern, void *value) { HashTable *ht = PHP_PROTO_HASH_OF(intern->array); int size = native_slot_size(intern->type); - php_proto_zend_hash_next_index_insert(ht, (void **)value, size, NULL); + if (intern->type == UPB_TYPE_MESSAGE) { + php_proto_zend_hash_next_index_insert_zval(ht, value); + } else { + php_proto_zend_hash_next_index_insert_mem(ht, (void **)value, size, NULL); + } } void repeated_field_create_with_field( @@ -367,11 +379,19 @@ PHP_METHOD(RepeatedField, offsetGet) { RepeatedField *intern = UNBOX(RepeatedField, getThis()); HashTable *table = PHP_PROTO_HASH_OF(intern->array); - if (php_proto_zend_hash_index_find(table, index, (void **)&memory) == FAILURE) { - zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index); - return; + if (intern->type == UPB_TYPE_MESSAGE) { + if (php_proto_zend_hash_index_find_zval(table, index, (void **)&memory) == + FAILURE) { + zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index); + return; + } + } else { + if (php_proto_zend_hash_index_find_mem(table, index, (void **)&memory) == + FAILURE) { + zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index); + return; + } } - native_slot_get_by_array(intern->type, memory, ZVAL_PTR_TO_CACHED_PTR(return_value) TSRMLS_CC); } @@ -491,10 +511,18 @@ PHP_METHOD(RepeatedFieldIter, current) { HashTable *table = PHP_PROTO_HASH_OF(repeated_field->array); - if (php_proto_zend_hash_index_find(table, intern->position, (void **)&memory) == - FAILURE) { - zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index); - return; + if (repeated_field->type == UPB_TYPE_MESSAGE) { + if (php_proto_zend_hash_index_find_zval(table, intern->position, + (void **)&memory) == FAILURE) { + zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); + return; + } + } else { + if (php_proto_zend_hash_index_find_mem(table, intern->position, + (void **)&memory) == FAILURE) { + zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index); + return; + } } native_slot_get_by_array(repeated_field->type, memory, ZVAL_PTR_TO_CACHED_PTR(return_value) TSRMLS_CC); diff --git a/php/ext/google/protobuf/encode_decode.c b/php/ext/google/protobuf/encode_decode.c index ef3d4cf6ca..4cb8997db5 100644 --- a/php/ext/google/protobuf/encode_decode.c +++ b/php/ext/google/protobuf/encode_decode.c @@ -354,7 +354,7 @@ static size_t zendstringdata_handler(void* closure, const void* hd, HashTable *ht = PHP_PROTO_HASH_OF(intern->array); int index = zend_hash_num_elements(ht) - 1; - php_proto_zend_hash_index_update( + php_proto_zend_hash_index_update_mem( ht, index, memory, sizeof(zend_string*), NULL); return len; @@ -1401,7 +1401,7 @@ static void putarray(zval* array, const upb_fielddef* f, upb_sink* sink, MessageHeader *submsg = UNBOX(MessageHeader, *(zval**)memory); #else MessageHeader *submsg = - (MessageHeader*)((char*)(*(zend_object**)memory) - + (MessageHeader*)((char*)(Z_OBJ_P((zval*)memory)) - XtOffsetOf(MessageHeader, std)); #endif putrawsubmsg(submsg, f, &subsink, depth TSRMLS_CC); diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c index 4a52486400..2680b5478c 100644 --- a/php/ext/google/protobuf/map.c +++ b/php/ext/google/protobuf/map.c @@ -285,7 +285,7 @@ static bool map_field_read_dimension(zval *object, zval *key, int type, if (upb_strtable_lookup2(&intern->table, keyval, length, &v)) { void* mem = upb_value_memory(&v); - native_slot_get_by_array(intern->value_type, mem, retval TSRMLS_CC); + native_slot_get_by_map_value(intern->value_type, mem, retval TSRMLS_CC); return true; } else { zend_error(E_USER_ERROR, "Given key doesn't exist."); @@ -318,7 +318,7 @@ static void map_field_write_dimension(zval *object, zval *key, mem = upb_value_memory(&v); memset(mem, 0, native_slot_size(intern->value_type)); - if (!native_slot_set_by_array(intern->value_type, intern->msg_ce, mem, + if (!native_slot_set_by_map(intern->value_type, intern->msg_ce, mem, value TSRMLS_CC)) { return; } @@ -535,8 +535,8 @@ PHP_METHOD(MapFieldIter, current) { upb_value value = map_iter_value(intern, &value_length); void* mem = upb_value_memory(&value); - native_slot_get_by_array(map_field->value_type, mem, - ZVAL_PTR_TO_CACHED_PTR(return_value) TSRMLS_CC); + native_slot_get_by_map_value(map_field->value_type, mem, + ZVAL_PTR_TO_CACHED_PTR(return_value) TSRMLS_CC); } PHP_METHOD(MapFieldIter, key) { diff --git a/php/ext/google/protobuf/protobuf.c b/php/ext/google/protobuf/protobuf.c index 5de9cfe941..2b5b58c682 100644 --- a/php/ext/google/protobuf/protobuf.c +++ b/php/ext/google/protobuf/protobuf.c @@ -55,13 +55,13 @@ static void add_to_table(HashTable* t, const void* def, void* value) { uint nIndex = (ulong)def & t->nTableMask; zval* pDest = NULL; - php_proto_zend_hash_index_update(t, (zend_ulong)def, &value, sizeof(zval*), - (void**)&pDest); + php_proto_zend_hash_index_update_mem(t, (zend_ulong)def, &value, + sizeof(zval*), (void**)&pDest); } static void* get_from_table(const HashTable* t, const void* def) { void** value; - if (php_proto_zend_hash_index_find(t, (zend_ulong)def, (void**)&value) == + if (php_proto_zend_hash_index_find_mem(t, (zend_ulong)def, (void**)&value) == FAILURE) { zend_error(E_ERROR, "PHP object not found for given definition.\n"); return NULL; @@ -71,13 +71,13 @@ static void* get_from_table(const HashTable* t, const void* def) { static bool exist_in_table(const HashTable* t, const void* def) { void** value; - return (php_proto_zend_hash_index_find(t, (zend_ulong)def, (void**)&value) == - SUCCESS); + return (php_proto_zend_hash_index_find_mem(t, (zend_ulong)def, + (void**)&value) == SUCCESS); } static void add_to_list(HashTable* t, void* value) { zval* pDest = NULL; - php_proto_zend_hash_next_index_insert(t, &value, sizeof(void*), + php_proto_zend_hash_next_index_insert_mem(t, &value, sizeof(void*), (void**)&pDest); } diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 33787e8639..c00cd917b2 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -74,13 +74,22 @@ #define PHP_PROTO_HASH_OF(array) Z_ARRVAL_P(array) -#define php_proto_zend_hash_index_update(ht, h, pData, nDataSize, pDest) \ +#define php_proto_zend_hash_index_update_zval(ht, h, pData) \ + zend_hash_index_update(ht, h, &(pData), sizeof(void*), NULL) + +#define php_proto_zend_hash_index_update_mem(ht, h, pData, nDataSize, pDest) \ zend_hash_index_update(ht, h, pData, nDataSize, pDest) -#define php_proto_zend_hash_index_find(ht, h, pDest) \ +#define php_proto_zend_hash_index_find_zval(ht, h, pDest) \ + zend_hash_index_find(ht, h, pDest) + +#define php_proto_zend_hash_index_find_mem(ht, h, pDest) \ zend_hash_index_find(ht, h, pDest) -#define php_proto_zend_hash_next_index_insert(ht, pData, nDataSize, pDest) \ +#define php_proto_zend_hash_next_index_insert_zval(ht, pData) \ + zend_hash_next_index_insert(ht, pData, sizeof(void*), NULL) + +#define php_proto_zend_hash_next_index_insert_mem(ht, pData, nDataSize, pDest) \ zend_hash_next_index_insert(ht, pData, nDataSize, pDest) #define php_proto_zend_hash_get_current_data_ex(ht, pDest, pos) \ @@ -217,7 +226,14 @@ #define PHP_PROTO_HASH_OF(array) Z_ARRVAL_P(&array) -static inline int php_proto_zend_hash_index_update(HashTable* ht, ulong h, +static inline int php_proto_zend_hash_index_update_zval(HashTable* ht, ulong h, + zval* pData) { + void* result = NULL; + result = zend_hash_index_update(ht, h, pData); + return result != NULL ? SUCCESS : FAILURE; +} + +static inline int php_proto_zend_hash_index_update_mem(HashTable* ht, ulong h, void* pData, uint nDataSize, void** pDest) { void* result = NULL; @@ -226,18 +242,33 @@ static inline int php_proto_zend_hash_index_update(HashTable* ht, ulong h, return result != NULL ? SUCCESS : FAILURE; } -static inline int php_proto_zend_hash_index_find(const HashTable* ht, ulong h, - void** pDest) { +static inline int php_proto_zend_hash_index_find_zval(const HashTable* ht, + ulong h, void** pDest) { + zval* result = zend_hash_index_find(ht, h); + if (pDest != NULL) *pDest = result; + return result != NULL ? SUCCESS : FAILURE; +} + +static inline int php_proto_zend_hash_index_find_mem(const HashTable* ht, + ulong h, void** pDest) { void* result = NULL; result = zend_hash_index_find_ptr(ht, h); if (pDest != NULL) *pDest = result; return result != NULL ? SUCCESS : FAILURE; } -static inline int php_proto_zend_hash_next_index_insert(HashTable* ht, - void* pData, - uint nDataSize, - void** pDest) { +static inline int php_proto_zend_hash_next_index_insert_zval(HashTable* ht, + void* pData) { + zval tmp; + ZVAL_OBJ(&tmp, *(zend_object**)pData); + zval* result = zend_hash_next_index_insert(ht, &tmp); + return result != NULL ? SUCCESS : FAILURE; +} + +static inline int php_proto_zend_hash_next_index_insert_mem(HashTable* ht, + void* pData, + uint nDataSize, + void** pDest) { void* result = NULL; result = zend_hash_next_index_insert_mem(ht, pData, nDataSize); if (pDest != NULL) *pDest = result; @@ -640,6 +671,8 @@ bool native_slot_set(upb_fieldtype_t type, const zend_class_entry* klass, bool native_slot_set_by_array(upb_fieldtype_t type, const zend_class_entry* klass, void* memory, zval* value TSRMLS_DC); +bool native_slot_set_by_map(upb_fieldtype_t type, const zend_class_entry* klass, + void* memory, zval* value TSRMLS_DC); void native_slot_init(upb_fieldtype_t type, void* memory, CACHED_VALUE* cache); // For each property, in order to avoid conversion between the zval object and // the actual data type during parsing/serialization, the containing message @@ -654,6 +687,10 @@ void native_slot_get(upb_fieldtype_t type, const void* memory, // So we need to make a special method to handle that. void native_slot_get_by_array(upb_fieldtype_t type, const void* memory, CACHED_VALUE* cache TSRMLS_DC); +void native_slot_get_by_map_key(upb_fieldtype_t type, const void* memory, + int length, CACHED_VALUE* cache TSRMLS_DC); +void native_slot_get_by_map_value(upb_fieldtype_t type, const void* memory, + CACHED_VALUE* cache TSRMLS_DC); void native_slot_get_default(upb_fieldtype_t type, CACHED_VALUE* cache TSRMLS_DC); diff --git a/php/ext/google/protobuf/storage.c b/php/ext/google/protobuf/storage.c index 6c789bcb68..e46dbf7030 100644 --- a/php/ext/google/protobuf/storage.c +++ b/php/ext/google/protobuf/storage.c @@ -198,6 +198,57 @@ bool native_slot_set_by_array(upb_fieldtype_t type, DEREF(memory, zval*) = value; Z_ADDREF_P(value); } +#else + DEREF(memory, zval*) = value; + ++GC_REFCOUNT(Z_OBJ_P(value)); +#endif + break; + } + default: + return native_slot_set(type, klass, memory, value TSRMLS_CC); + } + return true; +} + +bool native_slot_set_by_map(upb_fieldtype_t type, const zend_class_entry* klass, + void* memory, zval* value TSRMLS_DC) { + switch (type) { + case UPB_TYPE_STRING: + case UPB_TYPE_BYTES: { + if (!protobuf_convert_to_string(value)) { + return false; + } + if (type == UPB_TYPE_STRING && + !is_structurally_valid_utf8(Z_STRVAL_P(value), Z_STRLEN_P(value))) { + zend_error(E_USER_ERROR, "Given string is not UTF8 encoded."); + return false; + } + + // Handles repeated/map string field. Memory provided by + // RepeatedField/Map is not initialized. +#if PHP_MAJOR_VERSION < 7 + MAKE_STD_ZVAL(DEREF(memory, zval*)); + PHP_PROTO_ZVAL_STRINGL(DEREF(memory, zval*), Z_STRVAL_P(value), + Z_STRLEN_P(value), 1); +#else + *(zend_string**)memory = zend_string_dup(Z_STR_P(value), 0); +#endif + break; + } + case UPB_TYPE_MESSAGE: { + if (Z_TYPE_P(value) != IS_OBJECT) { + zend_error(E_USER_ERROR, "Given value is not message."); + return false; + } + if (Z_TYPE_P(value) == IS_OBJECT && klass != Z_OBJCE_P(value)) { + zend_error(E_USER_ERROR, "Given message does not have correct class."); + return false; + } +#if PHP_MAJOR_VERSION < 7 + if (EXPECTED(DEREF(memory, zval*) != value)) { + DEREF(memory, zval*) = value; + Z_ADDREF_P(value); + } #else DEREF(memory, zend_object*) = Z_OBJ_P(value); ++GC_REFCOUNT(Z_OBJ_P(value)); @@ -348,8 +399,7 @@ void native_slot_get_by_array(upb_fieldtype_t type, const void* memory, ZVAL_ZVAL(CACHED_PTR_TO_ZVAL_PTR(cache), value, 1, 0); } #else - ++GC_REFCOUNT(*(zend_object**)memory); - ZVAL_OBJ(cache, *(zend_object**)memory); + ZVAL_COPY(CACHED_PTR_TO_ZVAL_PTR(cache), memory); #endif return; } @@ -371,6 +421,26 @@ void native_slot_get_by_map_key(upb_fieldtype_t type, const void* memory, } } +void native_slot_get_by_map_value(upb_fieldtype_t type, const void* memory, + CACHED_VALUE* cache TSRMLS_DC) { + switch (type) { + case UPB_TYPE_MESSAGE: { +#if PHP_MAJOR_VERSION < 7 + zval* value = CACHED_PTR_TO_ZVAL_PTR((CACHED_VALUE*)memory); + if (EXPECTED(CACHED_PTR_TO_ZVAL_PTR(cache) != value)) { + ZVAL_ZVAL(CACHED_PTR_TO_ZVAL_PTR(cache), value, 1, 0); + } +#else + ++GC_REFCOUNT(*(zend_object**)memory); + ZVAL_OBJ(cache, *(zend_object**)memory); +#endif + return; + } + default: + native_slot_get_by_array(type, memory, cache TSRMLS_CC); + } +} + void native_slot_get_default(upb_fieldtype_t type, CACHED_VALUE* cache TSRMLS_DC) { switch (type) { @@ -952,8 +1022,18 @@ void layout_merge(MessageLayout* layout, MessageHeader* from, void* to_memory = ALLOC_N(char, native_slot_size(upb_fielddef_type(field))); memset(to_memory, 0, native_slot_size(upb_fielddef_type(field))); - php_proto_zend_hash_index_find(PHP_PROTO_HASH_OF(from_array->array), - j, (void**)&from_memory); + + if (to_array->type == UPB_TYPE_MESSAGE) { + php_proto_zend_hash_index_find_zval( + PHP_PROTO_HASH_OF(from_array->array), j, (void**)&from_memory); +#if PHP_MAJOR_VERSION >= 7 + from_memory = &Z_OBJ_P((zval*)from_memory); +#endif + } else { + php_proto_zend_hash_index_find_mem( + PHP_PROTO_HASH_OF(from_array->array), j, (void**)&from_memory); + } + native_slot_merge_by_array(field, from_memory, to_memory PHP_PROTO_TSRMLS_CC); repeated_field_push_native(to_array, to_memory); diff --git a/php/tests/array_test.php b/php/tests/array_test.php index e57f0a7ec5..1a26d72a88 100644 --- a/php/tests/array_test.php +++ b/php/tests/array_test.php @@ -471,6 +471,18 @@ class RepeatedFieldTest extends PHPUnit_Framework_TestCase $sub_m->setA(2); $arr[0] = $sub_m; $this->assertSame(2, $arr[0]->getA()); + + // Test foreach. + $arr = new RepeatedField(GPBType::MESSAGE, TestMessage_Sub::class); + for ($i = 0; $i < 3; $i++) { + $arr[] = new TestMessage_Sub(); + $arr[$i]->setA($i); + } + $i = 0; + foreach ($arr as $val) { + $this->assertSame($i++, $val->getA()); + } + $this->assertSame(3, $i); } ######################################################### @@ -521,23 +533,22 @@ class RepeatedFieldTest extends PHPUnit_Framework_TestCase # Test memory leak ######################################################### - // COMMENTED OUT BY @bshaffer - // @see https://github.com/google/protobuf/pull/3344#issuecomment-315162761 - // public function testCycleLeak() - // { - // $arr = new RepeatedField(GPBType::MESSAGE, TestMessage::class); - // $arr[] = new TestMessage; - // $arr[0]->SetRepeatedRecursive($arr); - - // // Clean up memory before test. - // gc_collect_cycles(); - // $start = memory_get_usage(); - // unset($arr); - - // // Explicitly trigger garbage collection. - // gc_collect_cycles(); - - // $end = memory_get_usage(); - // $this->assertLessThan($start, $end); - // } + public function testCycleLeak() + { + gc_collect_cycles(); + $arr = new RepeatedField(GPBType::MESSAGE, TestMessage::class); + $arr[] = new TestMessage; + $arr[0]->SetRepeatedRecursive($arr); + + // Clean up memory before test. + gc_collect_cycles(); + $start = memory_get_usage(); + unset($arr); + + // Explicitly trigger garbage collection. + gc_collect_cycles(); + + $end = memory_get_usage(); + $this->assertLessThan($start, $end); + } } diff --git a/php/tests/map_field_test.php b/php/tests/map_field_test.php index 120b1bde81..cffa2526d0 100644 --- a/php/tests/map_field_test.php +++ b/php/tests/map_field_test.php @@ -417,6 +417,29 @@ class MapFieldTest extends PHPUnit_Framework_TestCase { $this->assertSame(1, $arr[0]->getA()); $this->assertEquals(1, count($arr)); + + // Test foreach. + $arr = new MapField(GPBType::INT32, + GPBType::MESSAGE, TestMessage_Sub::class); + for ($i = 0; $i < 3; $i++) { + $arr[$i] = new TestMessage_Sub();; + $arr[$i]->setA($i); + } + $i = 0; + $key_test = []; + $value_test = []; + foreach ($arr as $key => $val) { + $key_test[] = $key; + $value_test[] = $val->getA(); + $i++; + } + $this->assertTrue(isset($key_test['0'])); + $this->assertTrue(isset($key_test['1'])); + $this->assertTrue(isset($key_test['2'])); + $this->assertTrue(isset($value_test['0'])); + $this->assertTrue(isset($value_test['1'])); + $this->assertTrue(isset($value_test['2'])); + $this->assertSame(3, $i); } ######################################################### From bb8664419b7d0dd4a94cc1242a2d77bf5e8f567b Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 25 Jul 2017 20:40:10 +0300 Subject: [PATCH 61/61] need for php math functions. used in mergeFromJsonString (#3409) --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 5b6c7ee239..80d90eabf3 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,9 @@ "require-dev": { "phpunit/phpunit": ">=4.8.0" }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, "autoload": { "psr-4": { "Google\\Protobuf\\Internal\\": "php/src/Google/Protobuf/Internal",