public void PackedParsingOfUnpackedInputExtensions()
        {
            byte[]            bytes    = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray();
            ExtensionRegistry registry = ExtensionRegistry.CreateInstance();

            UnitTestProtoFile.RegisterAllExtensions(registry);
            TestPackedExtensions message = TestPackedExtensions.ParseFrom(bytes, registry);

            TestUtil.AssertPackedExtensionsSet(message);
        }
Exemple #2
0
        public void ParsePackedExtensions()
        {
            // Ensure that packed extensions can be properly parsed.
            TestPackedExtensions message  = TestUtil.GetPackedExtensionsSet();
            ByteString           rawBytes = message.ToByteString();

            ExtensionRegistry registry = TestUtil.CreateExtensionRegistry();

            TestPackedExtensions message2 = TestPackedExtensions.ParseFrom(rawBytes, registry);

            TestUtil.AssertPackedExtensionsSet(message2);
        }