diff options
author | Jon Skeet <skeet@pobox.com> | 2009-02-18 16:06:22 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2009-02-18 16:06:22 +0000 |
commit | 25a28580a6f307cb8eb040367f5671e678e9896b (patch) | |
tree | 6ce918e09f644733ad514eac706208be2d5f7883 /src/ProtocolBuffers.Test/AbstractMessageTest.cs | |
parent | 0ca3fecfafe6b2f7b6de4a5e1b978353fcaae83b (diff) | |
download | protobuf-25a28580a6f307cb8eb040367f5671e678e9896b.tar.gz protobuf-25a28580a6f307cb8eb040367f5671e678e9896b.tar.bz2 protobuf-25a28580a6f307cb8eb040367f5671e678e9896b.zip |
Support packed primitive types
Diffstat (limited to 'src/ProtocolBuffers.Test/AbstractMessageTest.cs')
-rw-r--r-- | src/ProtocolBuffers.Test/AbstractMessageTest.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ProtocolBuffers.Test/AbstractMessageTest.cs b/src/ProtocolBuffers.Test/AbstractMessageTest.cs index 260ae28c..b77264f2 100644 --- a/src/ProtocolBuffers.Test/AbstractMessageTest.cs +++ b/src/ProtocolBuffers.Test/AbstractMessageTest.cs @@ -74,6 +74,20 @@ namespace Google.ProtocolBuffers { } [Test] + public void PackedSerialization() { + IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetPackedSet()); + TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseFrom(abstractMessage.ToByteString())); + Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), abstractMessage.ToByteString()); + } + + [Test] + public void PackedParsing() { + AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestPackedTypes.CreateBuilder()); + AbstractMessageWrapper message = builder.MergeFrom(TestUtil.GetPackedSet().ToByteString()).Build(); + TestUtil.AssertPackedFieldsSet((TestPackedTypes)message.WrappedMessage); + } + + [Test] public void OptimizedForSize() { // We're mostly only Checking that this class was compiled successfully. TestOptimizedForSize message = TestOptimizedForSize.CreateBuilder().SetI(1).Build(); |