Bladeren bron

Merge pull request #720 from jtattermusch/csharp_fixes

C# fix for TypeInitializer exception.
Jon Skeet 10 jaren geleden
bovenliggende
commit
0cb84ee31f

+ 0 - 1
csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs

@@ -244,7 +244,6 @@ namespace Google.Protobuf
         [TestCase(null, "{ }")]
         [TestCase("x", "{ 'fooString': 'x' }")]
         [TestCase("", "{ 'fooString': '' }")]
-        [TestCase(null, "{ }")]
         public void Oneof(string fooStringValue, string expectedJson)
         {
             var message = new TestOneof();

+ 7 - 0
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs

@@ -251,5 +251,12 @@ namespace Google.Protobuf.Reflection
             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));
         }
+
+
+        [Test]
+        public void DescriptorProtoFileDescriptor()
+        {
+            var descriptor = Google.Protobuf.Reflection.FileDescriptor.DescriptorProtoFileDescriptor;
+        }
     }
 }

File diff suppressed because it is too large
+ 164 - 137
csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs


+ 1 - 1
src/google/protobuf/compiler/csharp/csharp_field_base.cc

@@ -67,7 +67,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
     tag_bytes += ", " + SimpleItoa(tag_array[i]);
   }
 
-  (*variables)["access_level"] = class_access_level();
+  (*variables)["access_level"] = "public";
   (*variables)["tag"] = SimpleItoa(tag);
   (*variables)["tag_size"] = SimpleItoa(tag_size);
   (*variables)["tag_bytes"] = tag_bytes;

Some files were not shown because too many files changed in this diff