Commit 0cb84ee3 authored by Jon Skeet's avatar Jon Skeet

Merge pull request #720 from jtattermusch/csharp_fixes

C# fix for TypeInitializer exception.
parents 5c370cc5 fa2fe35d
...@@ -244,7 +244,6 @@ namespace Google.Protobuf ...@@ -244,7 +244,6 @@ namespace Google.Protobuf
[TestCase(null, "{ }")] [TestCase(null, "{ }")]
[TestCase("x", "{ 'fooString': 'x' }")] [TestCase("x", "{ 'fooString': 'x' }")]
[TestCase("", "{ 'fooString': '' }")] [TestCase("", "{ 'fooString': '' }")]
[TestCase(null, "{ }")]
public void Oneof(string fooStringValue, string expectedJson) public void Oneof(string fooStringValue, string expectedJson)
{ {
var message = new TestOneof(); var message = new TestOneof();
......
...@@ -251,5 +251,12 @@ namespace Google.Protobuf.Reflection ...@@ -251,5 +251,12 @@ namespace Google.Protobuf.Reflection
Assert.AreEqual(new[] { 11, 1, 101, 200 }, fields.InDeclarationOrder().Select(x => x.FieldNumber)); Assert.AreEqual(new[] { 11, 1, 101, 200 }, fields.InDeclarationOrder().Select(x => x.FieldNumber));
Assert.AreEqual(new[] { 1, 11, 101, 200 }, fields.InFieldNumberOrder().Select(x => x.FieldNumber)); Assert.AreEqual(new[] { 1, 11, 101, 200 }, fields.InFieldNumberOrder().Select(x => x.FieldNumber));
} }
[Test]
public void DescriptorProtoFileDescriptor()
{
var descriptor = Google.Protobuf.Reflection.FileDescriptor.DescriptorProtoFileDescriptor;
}
} }
} }
...@@ -67,7 +67,7 @@ void FieldGeneratorBase::SetCommonFieldVariables( ...@@ -67,7 +67,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
tag_bytes += ", " + SimpleItoa(tag_array[i]); tag_bytes += ", " + SimpleItoa(tag_array[i]);
} }
(*variables)["access_level"] = class_access_level(); (*variables)["access_level"] = "public";
(*variables)["tag"] = SimpleItoa(tag); (*variables)["tag"] = SimpleItoa(tag);
(*variables)["tag_size"] = SimpleItoa(tag_size); (*variables)["tag_size"] = SimpleItoa(tag_size);
(*variables)["tag_bytes"] = tag_bytes; (*variables)["tag_bytes"] = tag_bytes;
......
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