From ce66c5f1b99fe36b5b91e8b59cc75ce8a4e9cba5 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 28 Apr 2015 15:06:59 +0100 Subject: Updated set of unit tests and unit test protos. This commit includes changes to the C#-specific protos, and rebuilt versions of the "stock" protos. The stock protos have been locally updated to have a specific C# namespace, but this is expected to change soon, so hasn't been committed. Four areas are currently not tested: 1) Serialization - we may restore this at some point, possibly optionally. 2) Services - currently nothing is generated for this; will need to see how it interacts with GRPC 3) Fields beginning with _{digit} - see https://github.com/google/protobuf/issues/308 4) Fields with names which conflict with the declaring type in nasty ways - see https://github.com/google/protobuf/issues/309 --- csharp/protos/extest/unittest_issues.proto | 36 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'csharp/protos/extest/unittest_issues.proto') diff --git a/csharp/protos/extest/unittest_issues.proto b/csharp/protos/extest/unittest_issues.proto index cb803791..97249dff 100644 --- a/csharp/protos/extest/unittest_issues.proto +++ b/csharp/protos/extest/unittest_issues.proto @@ -1,10 +1,10 @@ +syntax = "proto2"; + // These proto descriptors have at one time been reported as an issue or defect. // They are kept here to replicate the issue, and continue to verify the fix. -import "google/protobuf/csharp_options.proto"; // Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified -option (google.protobuf.csharp_file_options).namespace = "UnitTest.Issues.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasIssuesProtoFile"; +option csharp_namespace = "UnitTest.Issues.TestProtos"; package unittest_issues; option optimize_for = SPEED; @@ -67,24 +67,28 @@ service TestGenericService { rpc Bar(TestBasicNoFields) returns (TestBasicMessage); } */ -// Issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 + +// Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 +// New issue 309: https://github.com/google/protobuf/issues/309 -message A { - optional int32 _A = 1; -} +// message A { +// optional int32 _A = 1; +// } -message B { - optional int32 B_ = 1; -} +// message B { +// optional int32 B_ = 1; +// } -message AB { - optional int32 a_b = 1; -} +//message AB { +// optional int32 a_b = 1; +//} // Similar issue with numeric names -message NumberField { - optional int32 _01 = 1; -} +// Java code failed too, so probably best for this to be a restriction. +// See https://github.com/google/protobuf/issues/308 +// message NumberField { +// optional int32 _01 = 1; +// } // Issue 28: Circular message dependencies result in null defaults for DefaultInstance -- cgit v1.2.3