Commit 10ad653c authored by Jon Skeet's avatar Jon Skeet

Reflect Java source code.

parent 40c2221e
...@@ -295,5 +295,20 @@ namespace Google.ProtocolBuffers { ...@@ -295,5 +295,20 @@ namespace Google.ProtocolBuffers {
} }
} }
[Test]
public void LargeVarint() {
ByteString data =
UnknownFieldSet.CreateBuilder()
.AddField(1,
UnknownField.CreateBuilder()
.AddVarint(0x7FFFFFFFFFFFFFFFL)
.Build())
.Build()
.ToByteString();
UnknownFieldSet parsed = UnknownFieldSet.ParseFrom(data);
UnknownField field = parsed[1];
Assert.AreEqual(1, field.VarintList.Count);
Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]);
}
} }
} }
...@@ -314,7 +314,6 @@ namespace Google.ProtocolBuffers { ...@@ -314,7 +314,6 @@ namespace Google.ProtocolBuffers {
int number = WireFormat.GetTagFieldNumber(tag); int number = WireFormat.GetTagFieldNumber(tag);
switch (WireFormat.GetTagWireType(tag)) { switch (WireFormat.GetTagWireType(tag)) {
case WireFormat.WireType.Varint: case WireFormat.WireType.Varint:
// TODO(jonskeet): Check this is correct (different to Java)
GetFieldBuilder(number).AddVarint(input.ReadUInt64()); GetFieldBuilder(number).AddVarint(input.ReadUInt64());
return true; return true;
case WireFormat.WireType.Fixed64: case WireFormat.WireType.Fixed64:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment