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 --- .../protos/extest/unittest_generic_services.proto | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'csharp/protos/extest/unittest_generic_services.proto') diff --git a/csharp/protos/extest/unittest_generic_services.proto b/csharp/protos/extest/unittest_generic_services.proto index 3fe2e8eb..4e68ff0f 100644 --- a/csharp/protos/extest/unittest_generic_services.proto +++ b/csharp/protos/extest/unittest_generic_services.proto @@ -1,29 +1,30 @@ +syntax = "proto2"; + // Additional options required for C# generation. File from copyright // line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; import "google/protobuf/unittest.proto"; import "google/protobuf/unittest_custom_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGenericServices"; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + +// option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +package protobuf_unittest; -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - option optimize_for = SPEED; service TestGenericService { rpc Foo(FooRequest) returns (FooResponse); rpc Bar(BarRequest) returns (BarResponse); } - -service TestGenericServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - + +service TestGenericServiceWithCustomOptions { + option (service_opt1) = -9876543210; + + rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { + option (method_opt1) = METHODOPT1_VAL2; + } +} + -- cgit v1.2.3