unittest_issues.proto 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // These proto descriptors have at one time been reported as an issue or defect.
  2. // They are kept here to replicate the issue, and continue to verify the fix.
  3. import "google/protobuf/csharp_options.proto";
  4. // Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified
  5. option (google.protobuf.csharp_file_options).namespace = "UnitTest.Issues.TestProtos";
  6. option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasIssuesProtoFile";
  7. package unittest_issues;
  8. option optimize_for = SPEED;
  9. // The following is a representative set of features
  10. /*
  11. enum EnumOptions {
  12. ONE = 0;
  13. TWO = 1;
  14. THREE = 2;
  15. }
  16. message TestBasicChild
  17. {
  18. repeated EnumOptions options = 3;
  19. optional bytes binary = 4;
  20. }
  21. message TestBasicNoFields {
  22. }
  23. message TestBasicRescursive {
  24. optional TestBasicRescursive child = 1;
  25. }
  26. message TestBasicMessage {
  27. optional int64 number = 6;
  28. repeated int32 numbers = 2;
  29. optional string text = 3;
  30. repeated string textlines = 700;
  31. optional bool valid = 5;
  32. optional TestBasicChild child = 1;
  33. repeated group Children = 401
  34. {
  35. repeated EnumOptions options = 3;
  36. optional bytes binary = 4;
  37. }
  38. extensions 100 to 199;
  39. }
  40. message TestBasicExtension {
  41. required int32 number = 1;
  42. }
  43. extend TestBasicMessage {
  44. optional EnumOptions extension_enum = 101;
  45. optional string extension_text = 102;
  46. repeated int32 extension_number = 103 [packed = true];
  47. optional TestBasicExtension extension_message = 199;
  48. }
  49. // Issue for non-qualified type reference in new services generation
  50. option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH;
  51. service TestGenericService {
  52. rpc Foo(TestBasicNoFields) returns (TestBasicMessage);
  53. rpc Bar(TestBasicNoFields) returns (TestBasicMessage);
  54. }
  55. */
  56. // Issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
  57. message A {
  58. optional int32 _A = 1;
  59. }
  60. message B {
  61. optional int32 B_ = 1;
  62. }
  63. message AB {
  64. optional int32 a_b = 1;
  65. }
  66. // Similar issue with numeric names
  67. message NumberField {
  68. optional int32 _01 = 1;
  69. }