aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-06-03 14:15:21 -0500
committerrogerk <devnull@localhost>2011-06-03 14:15:21 -0500
commit123e534914df3dbdcd918ec4f8d79c47a3bf85e5 (patch)
tree036d1f3d61f9a5eb3dcb6950f35a0bd32022058e /src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
parentffafdaa0f9a96d17d456c844a3e554512a5c121d (diff)
downloadprotobuf-123e534914df3dbdcd918ec4f8d79c47a3bf85e5.tar.gz
protobuf-123e534914df3dbdcd918ec4f8d79c47a3bf85e5.tar.bz2
protobuf-123e534914df3dbdcd918ec4f8d79c47a3bf85e5.zip
Canged CodedInputStream.ReadTag to use boolean result with out params to
support reading a field name rather than a field tag.
Diffstat (limited to 'src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs')
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
index 2002d8df..db26d728 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
@@ -207,11 +207,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -226,6 +227,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}