diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-02-18 14:38:06 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-02-18 14:38:06 -0800 |
commit | c003abb40d64ecd6694fab239d3fc126b31eee0d (patch) | |
tree | 9b5b5686c38a73dc8f393f91ba215ba24facc94b /csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs | |
parent | 4ab918674368e237e1cf6be467c1c4223dd2b510 (diff) | |
parent | 9bdc848832b6f6e27ea4389a72c566ec43329114 (diff) | |
download | protobuf-c003abb40d64ecd6694fab239d3fc126b31eee0d.tar.gz protobuf-c003abb40d64ecd6694fab239d3fc126b31eee0d.tar.bz2 protobuf-c003abb40d64ecd6694fab239d3fc126b31eee0d.zip |
Merge pull request #1240 from jskeet/validate_group
Validate that end-group tags match their corresponding start-group tags
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs index 14cc6d19..67069954 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs @@ -679,21 +679,20 @@ namespace Google.Protobuf /// for details; we may want to change this.
/// </summary>
[Test]
- public void ExtraEndGroupSkipped()
+ public void ExtraEndGroupThrows()
{
var message = SampleMessages.CreateFullTestAllTypes();
var stream = new MemoryStream();
var output = new CodedOutputStream(stream);
- output.WriteTag(100, WireFormat.WireType.EndGroup);
output.WriteTag(TestAllTypes.SingleFixed32FieldNumber, WireFormat.WireType.Fixed32);
output.WriteFixed32(123);
+ output.WriteTag(100, WireFormat.WireType.EndGroup);
output.Flush();
stream.Position = 0;
- var parsed = TestAllTypes.Parser.ParseFrom(stream);
- Assert.AreEqual(new TestAllTypes { SingleFixed32 = 123 }, parsed);
+ Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseFrom(stream));
}
[Test]
|