diff options
author | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:33:35 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:33:35 +0100 |
commit | c0daf107249d95f454d489613de09a4898cefb20 (patch) | |
tree | bb95ccdec5b2b6156709ac29febf99ee73087e78 /csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs | |
parent | 800f65e20915d3cda9b6b681013dc0a5dd5ddee2 (diff) | |
download | protobuf-c0daf107249d95f454d489613de09a4898cefb20.tar.gz protobuf-c0daf107249d95f454d489613de09a4898cefb20.tar.bz2 protobuf-c0daf107249d95f454d489613de09a4898cefb20.zip |
Changed fixed size methods to return unsigned integers. Finished FieldSet. Introduced mapping from FieldType to WireType and MappedType.
Diffstat (limited to 'csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs')
-rw-r--r-- | csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs b/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs index 0e97f2fd..f2f00dfe 100644 --- a/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs +++ b/csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs @@ -106,7 +106,7 @@ namespace Google.ProtocolBuffers { AssertWriteVarint( Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); + (0x43UL << 28) | (0x49L << 35) | (0x24UL << 42) | (0x49UL << 49)); // 11964378330978735131 AssertWriteVarint( Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), @@ -120,7 +120,7 @@ namespace Google.ProtocolBuffers { /// Parses the given bytes using WriteRawLittleEndian32() and checks /// that the result matches the given value. /// </summary> - private static void AssertWriteLittleEndian32(byte[] data, int value) { + private static void AssertWriteLittleEndian32(byte[] data, uint value) { MemoryStream rawOutput = new MemoryStream(); CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); output.WriteRawLittleEndian32(value); @@ -141,7 +141,7 @@ namespace Google.ProtocolBuffers { /// Parses the given bytes using WriteRawLittleEndian64() and checks /// that the result matches the given value. /// </summary> - private static void AssertWriteLittleEndian64(byte[] data, long value) { + private static void AssertWriteLittleEndian64(byte[] data, ulong value) { MemoryStream rawOutput = new MemoryStream(); CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); output.WriteRawLittleEndian64(value); @@ -164,14 +164,14 @@ namespace Google.ProtocolBuffers { [Test] public void WriteLittleEndian() { AssertWriteLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); - AssertWriteLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), unchecked((int)0x9abcdef0)); + AssertWriteLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); AssertWriteLittleEndian64( Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), 0x123456789abcdef0L); AssertWriteLittleEndian64( Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), - unchecked((long)0x9abcdef012345678L)); + 0x9abcdef012345678UL); } /* TODO(jonskeet): Put this back when we've got the rest working! |