unittest_issues.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. }
  70. // issue 19 - negative enum values
  71. enum NegativeEnum {
  72. FiveBelow = -5;
  73. MinusOne = -1;
  74. Zero = 0;
  75. }
  76. message NegativeEnumMessage {
  77. optional NegativeEnum value = 1;
  78. repeated NegativeEnum values = 2;
  79. repeated NegativeEnum packed_values = 3 [packed=true];
  80. }