• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8edition = "2023";
9
10package proto3_preserve_unknown_enum_unittest;
11
12// Treat all fields as implicit present by default (proto3 behavior).
13option features.field_presence = IMPLICIT;
14option objc_class_prefix = "UnknownEnums";
15option csharp_namespace = "Google.Protobuf.TestProtos";
16
17enum MyEnum {
18  FOO = 0;
19  BAR = 1;
20  BAZ = 2;
21}
22
23enum MyEnumPlusExtra {
24  E_FOO = 0;
25  E_BAR = 1;
26  E_BAZ = 2;
27  E_EXTRA = 3;
28}
29
30message MyMessage {
31  MyEnum e = 1;
32  repeated MyEnum repeated_e = 2;
33  repeated MyEnum repeated_packed_e = 3;
34  repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4;  // not packed
35  oneof o {
36    MyEnum oneof_e_1 = 5;
37    MyEnum oneof_e_2 = 6;
38  }
39}
40
41message MyMessagePlusExtra {
42  MyEnumPlusExtra e = 1;
43  repeated MyEnumPlusExtra repeated_e = 2;
44  repeated MyEnumPlusExtra repeated_packed_e = 3;
45  repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4;
46  oneof o {
47    MyEnumPlusExtra oneof_e_1 = 5;
48    MyEnumPlusExtra oneof_e_2 = 6;
49  }
50}
51