unittest_issues.proto 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. // Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
  9. // New issue 309: https://github.com/google/protobuf/issues/309
  10. // message A {
  11. // optional int32 _A = 1;
  12. // }
  13. // message B {
  14. // optional int32 B_ = 1;
  15. // }
  16. //message AB {
  17. // optional int32 a_b = 1;
  18. //}
  19. // Similar issue with numeric names
  20. // Java code failed too, so probably best for this to be a restriction.
  21. // See https://github.com/google/protobuf/issues/308
  22. // message NumberField {
  23. // optional int32 _01 = 1;
  24. // }
  25. // issue 19 - negative enum values
  26. enum NegativeEnum {
  27. NEGATIVE_ENUM_ZERO = 0;
  28. FiveBelow = -5;
  29. MinusOne = -1;
  30. }
  31. message NegativeEnumMessage {
  32. NegativeEnum value = 1;
  33. repeated NegativeEnum values = 2 [packed = false];
  34. repeated NegativeEnum packed_values = 3 [packed=true];
  35. }
  36. // Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21
  37. // Decorate fields with [deprecated=true] as [System.Obsolete]
  38. message DeprecatedChild {
  39. }
  40. enum DeprecatedEnum {
  41. DEPRECATED_ZERO = 0;
  42. one = 1;
  43. }
  44. message DeprecatedFieldsMessage {
  45. int32 PrimitiveValue = 1 [deprecated = true];
  46. repeated int32 PrimitiveArray = 2 [deprecated = true];
  47. DeprecatedChild MessageValue = 3 [deprecated = true];
  48. repeated DeprecatedChild MessageArray = 4 [deprecated = true];
  49. DeprecatedEnum EnumValue = 5 [deprecated = true];
  50. repeated DeprecatedEnum EnumArray = 6 [deprecated = true];
  51. }
  52. // Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
  53. message ItemField {
  54. int32 item = 1;
  55. }