Upgrade linux protobuf from 3.19.1 -> 21.12

This commit is contained in:
John Colvin committed 2023-03-18 15:31:41 -04:00
1 parent 4a3e40193e
commit 01a4bb004a
554 files changed
+34981 -37969

No files matched your search

@@ -40,6 +40,7 @@ import textwrap
import unittest
from google.protobuf import any_pb2
from google.protobuf import struct_pb2
from google.protobuf import any_test_pb2
from google.protobuf import map_unittest_pb2
from google.protobuf import unittest_custom_options_pb2
@@ -48,6 +49,7 @@ from google.protobuf import unittest_pb2
from google.protobuf import unittest_proto3_arena_pb2
from google.protobuf import descriptor_pb2
from google.protobuf.internal import any_test_pb2 as test_extend_any
from google.protobuf.internal import api_implementation
from google.protobuf.internal import message_set_extensions_pb2
from google.protobuf.internal import test_proto3_optional_pb2
from google.protobuf.internal import test_util
@@ -582,6 +584,10 @@ class TextFormatMessageToStringTests(TextFormatBase):
text_format.Parse(expected_text, parsed_proto)
self.assertEqual(message_proto, parsed_proto)
@unittest.skipIf(
api_implementation.Type() == 'upb',
"upb API doesn't support old UnknownField API. The TextFormat library "
"needs to convert to the new API.")
def testPrintUnknownFieldsEmbeddedMessageInBytes(self, message_module):
inner_msg = message_module.TestAllTypes()
inner_msg.optional_int32 = 101
@@ -1470,9 +1476,11 @@ class Proto2Tests(TextFormatBase):
text = ('message_set {\n'
' [unknown_extension] {\n'
' i: 23\n'
' bin: "\xe0"'
' repeated_i: []\n'
' bin: "\xe0"\n'
' [nested_unknown_ext]: {\n'
' i: 23\n'
' repeated_i: [1, 2]\n'
' x: x\n'
' test: "test_string"\n'
' floaty_float: -0.315\n'
@@ -1485,6 +1493,7 @@ class Proto2Tests(TextFormatBase):
' i: 24\n'
' pointfloat: .3\n'
' test: "test_string"\n'
' repeated_test: ["test_string1", "test_string2"]\n'
' floaty_float: -0.315\n'
' num: -inf\n'
' long_string: "test" "test2" \n'
@@ -1931,6 +1940,16 @@ class Proto3Tests(unittest.TestCase):
text_format.Merge(text, message)
self.assertEqual(str(e.exception), '3:11 : Expected "}".')
def testParseExpandedAnyListValue(self):
any_msg = any_pb2.Any()
any_msg.Pack(struct_pb2.ListValue())
msg = any_test_pb2.TestAny(any_value=any_msg)
text = ('any_value {\n'
' [type.googleapis.com/google.protobuf.ListValue] {}\n'
'}\n')
parsed_msg = text_format.Parse(text, any_test_pb2.TestAny())
self.assertEqual(msg, parsed_msg)
def testProto3Optional(self):
msg = test_proto3_optional_pb2.TestProto3Optional()
self.assertEqual(text_format.MessageToString(msg), '')