unittest_preserve_unknown_enum.proto 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file or at
  6. // https://developers.google.com/open-source/licenses/bsd
  7. edition = "2023";
  8. package proto3_preserve_unknown_enum_unittest;
  9. // Treat all fields as implicit present by default (proto3 behavior).
  10. option features.field_presence = IMPLICIT;
  11. option objc_class_prefix = "UnknownEnums";
  12. option csharp_namespace = "Google.Protobuf.TestProtos";
  13. enum MyEnum {
  14. FOO = 0;
  15. BAR = 1;
  16. BAZ = 2;
  17. }
  18. enum MyEnumPlusExtra {
  19. E_FOO = 0;
  20. E_BAR = 1;
  21. E_BAZ = 2;
  22. E_EXTRA = 3;
  23. }
  24. message MyMessage {
  25. MyEnum e = 1;
  26. repeated MyEnum repeated_e = 2;
  27. repeated MyEnum repeated_packed_e = 3;
  28. repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4; // not packed
  29. oneof o {
  30. MyEnum oneof_e_1 = 5;
  31. MyEnum oneof_e_2 = 6;
  32. }
  33. }
  34. message MyMessagePlusExtra {
  35. MyEnumPlusExtra e = 1;
  36. repeated MyEnumPlusExtra repeated_e = 2;
  37. repeated MyEnumPlusExtra repeated_packed_e = 3;
  38. repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4;
  39. oneof o {
  40. MyEnumPlusExtra oneof_e_1 = 5;
  41. MyEnumPlusExtra oneof_e_2 = 6;
  42. }
  43. }