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 protobuf_unittest; 11 12import "google/protobuf/unittest_lite.proto"; 13 14option features.enum_type = CLOSED; 15option features.utf8_validation = NONE; 16option cc_enable_arenas = true; 17option optimize_for = LITE_RUNTIME; 18 19message TestMapLite { 20 map<int32, int32> map_int32_int32 = 1; 21 map<int64, int64> map_int64_int64 = 2; 22 map<uint32, uint32> map_uint32_uint32 = 3; 23 map<uint64, uint64> map_uint64_uint64 = 4; 24 map<sint32, sint32> map_sint32_sint32 = 5; 25 map<sint64, sint64> map_sint64_sint64 = 6; 26 map<fixed32, fixed32> map_fixed32_fixed32 = 7; 27 map<fixed64, fixed64> map_fixed64_fixed64 = 8; 28 map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9; 29 map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10; 30 map<int32, float> map_int32_float = 11; 31 map<int32, double> map_int32_double = 12; 32 map<bool, bool> map_bool_bool = 13; 33 map<string, string> map_string_string = 14; 34 map<int32, bytes> map_int32_bytes = 15; 35 map<int32, MapEnumLite> map_int32_enum = 16; 36 map<int32, ForeignMessageLite> map_int32_foreign_message = 17; 37 map<int32, int32> teboring = 18; 38} 39 40message TestArenaMapLite { 41 map<int32, int32> map_int32_int32 = 1; 42 map<int64, int64> map_int64_int64 = 2; 43 map<uint32, uint32> map_uint32_uint32 = 3; 44 map<uint64, uint64> map_uint64_uint64 = 4; 45 map<sint32, sint32> map_sint32_sint32 = 5; 46 map<sint64, sint64> map_sint64_sint64 = 6; 47 map<fixed32, fixed32> map_fixed32_fixed32 = 7; 48 map<fixed64, fixed64> map_fixed64_fixed64 = 8; 49 map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9; 50 map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10; 51 map<int32, float> map_int32_float = 11; 52 map<int32, double> map_int32_double = 12; 53 map<bool, bool> map_bool_bool = 13; 54 map<string, string> map_string_string = 14; 55 map<int32, bytes> map_int32_bytes = 15; 56 map<int32, MapEnumLite> map_int32_enum = 16; 57 map<int32, ForeignMessageArenaLite> map_int32_foreign_message = 17; 58} 59 60// Test embedded message with required fields 61message TestRequiredMessageMapLite { 62 map<int32, TestRequiredLite> map_field = 1; 63} 64 65message TestEnumMapLite { 66 map<int32, Proto2MapEnumLite> known_map_field = 101; 67 map<int32, Proto2MapEnumLite> unknown_map_field = 102; 68} 69 70message TestEnumMapPlusExtraLite { 71 map<int32, Proto2MapEnumPlusExtraLite> known_map_field = 101; 72 map<int32, Proto2MapEnumPlusExtraLite> unknown_map_field = 102; 73} 74 75message TestMessageMapLite { 76 map<int32, TestAllTypesLite> map_int32_message = 1; 77} 78 79enum Proto2MapEnumLite { 80 PROTO2_MAP_ENUM_FOO_LITE = 0; 81 PROTO2_MAP_ENUM_BAR_LITE = 1; 82 PROTO2_MAP_ENUM_BAZ_LITE = 2; 83} 84 85enum Proto2MapEnumPlusExtraLite { 86 E_PROTO2_MAP_ENUM_FOO_LITE = 0; 87 E_PROTO2_MAP_ENUM_BAR_LITE = 1; 88 E_PROTO2_MAP_ENUM_BAZ_LITE = 2; 89 E_PROTO2_MAP_ENUM_EXTRA_LITE = 3; 90} 91 92enum MapEnumLite { 93 MAP_ENUM_FOO_LITE = 0; 94 MAP_ENUM_BAR_LITE = 1; 95 MAP_ENUM_BAZ_LITE = 2; 96} 97 98message TestRequiredLite { 99 int32 a = 1 [features.field_presence = LEGACY_REQUIRED]; 100 101 int32 b = 2 [features.field_presence = LEGACY_REQUIRED]; 102 103 int32 c = 3 [features.field_presence = LEGACY_REQUIRED]; 104 105 extend TestAllExtensionsLite { 106 TestRequiredLite single = 1000; 107 } 108} 109 110message ForeignMessageArenaLite { 111 int32 c = 1; 112} 113