unittest_issues.proto 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. syntax = "proto3";
  2. // These proto descriptors have at one time been reported as an issue or defect.
  3. // They are kept here to replicate the issue, and continue to verify the fix.
  4. // Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified
  5. option csharp_namespace = "UnitTest.Issues.TestProtos";
  6. package unittest_issues;
  7. option optimize_for = SPEED;
  8. // Issue 307: when generating doubly-nested types, any references
  9. // should be of the form A.Types.B.Types.C.
  10. message Issue307 {
  11. message NestedOnce {
  12. message NestedTwice {
  13. }
  14. }
  15. }
  16. // Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
  17. // New issue 309: https://github.com/google/protobuf/issues/309
  18. // message A {
  19. // optional int32 _A = 1;
  20. // }
  21. // message B {
  22. // optional int32 B_ = 1;
  23. // }
  24. //message AB {
  25. // optional int32 a_b = 1;
  26. //}
  27. // Similar issue with numeric names
  28. // Java code failed too, so probably best for this to be a restriction.
  29. // See https://github.com/google/protobuf/issues/308
  30. // message NumberField {
  31. // optional int32 _01 = 1;
  32. // }
  33. // issue 19 - negative enum values
  34. enum NegativeEnum {
  35. NEGATIVE_ENUM_ZERO = 0;
  36. FiveBelow = -5;
  37. MinusOne = -1;
  38. }
  39. message NegativeEnumMessage {
  40. NegativeEnum value = 1;
  41. repeated NegativeEnum values = 2 [packed = false];
  42. repeated NegativeEnum packed_values = 3 [packed=true];
  43. }
  44. // Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21
  45. // Decorate fields with [deprecated=true] as [System.Obsolete]
  46. message DeprecatedChild {
  47. }
  48. enum DeprecatedEnum {
  49. DEPRECATED_ZERO = 0;
  50. one = 1;
  51. }
  52. message DeprecatedFieldsMessage {
  53. int32 PrimitiveValue = 1 [deprecated = true];
  54. repeated int32 PrimitiveArray = 2 [deprecated = true];
  55. DeprecatedChild MessageValue = 3 [deprecated = true];
  56. repeated DeprecatedChild MessageArray = 4 [deprecated = true];
  57. DeprecatedEnum EnumValue = 5 [deprecated = true];
  58. repeated DeprecatedEnum EnumArray = 6 [deprecated = true];
  59. }
  60. // Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
  61. message ItemField {
  62. int32 item = 1;
  63. }