mirror of
https://github.com/google/pebble.git
synced 2025-08-21 02:17:20 -04:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
86
third_party/nanopb/tests/enum_sizes/enumsizes.proto
vendored
Normal file
86
third_party/nanopb/tests/enum_sizes/enumsizes.proto
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
/* Test handling of enums with different value ranges.
|
||||
* Depending on compiler and the packed_enum setting, the datatypes
|
||||
* for enums can be either signed or unsigned. In past this has caused
|
||||
* a bit of a problem for the encoder/decoder (issue #164).
|
||||
*/
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
import 'nanopb.proto';
|
||||
|
||||
option (nanopb_fileopt).long_names = false;
|
||||
|
||||
enum UnpackedUint8 {
|
||||
option (nanopb_enumopt).packed_enum = false;
|
||||
UU8_MIN = 0;
|
||||
UU8_MAX = 255;
|
||||
}
|
||||
|
||||
enum PackedUint8 {
|
||||
option (nanopb_enumopt).packed_enum = true;
|
||||
PU8_MIN = 0;
|
||||
PU8_MAX = 255;
|
||||
}
|
||||
|
||||
enum UnpackedInt8 {
|
||||
option (nanopb_enumopt).packed_enum = false;
|
||||
UI8_MIN = -128;
|
||||
UI8_MAX = 127;
|
||||
}
|
||||
|
||||
enum PackedInt8 {
|
||||
option (nanopb_enumopt).packed_enum = true;
|
||||
PI8_MIN = -128;
|
||||
PI8_MAX = 127;
|
||||
}
|
||||
|
||||
enum UnpackedUint16 {
|
||||
option (nanopb_enumopt).packed_enum = false;
|
||||
UU16_MIN = 0;
|
||||
UU16_MAX = 65535;
|
||||
}
|
||||
|
||||
enum PackedUint16 {
|
||||
option (nanopb_enumopt).packed_enum = true;
|
||||
PU16_MIN = 0;
|
||||
PU16_MAX = 65535;
|
||||
}
|
||||
|
||||
enum UnpackedInt16 {
|
||||
option (nanopb_enumopt).packed_enum = false;
|
||||
UI16_MIN = -32768;
|
||||
UI16_MAX = 32767;
|
||||
}
|
||||
|
||||
enum PackedInt16 {
|
||||
option (nanopb_enumopt).packed_enum = true;
|
||||
PI16_MIN = -32768;
|
||||
PI16_MAX = 32767;
|
||||
}
|
||||
|
||||
/* Protobuf supports enums up to 32 bits.
|
||||
* The 32 bit case is covered by HugeEnum in the alltypes test.
|
||||
*/
|
||||
|
||||
message PackedEnums {
|
||||
required PackedUint8 u8_min = 1;
|
||||
required PackedUint8 u8_max = 2;
|
||||
required PackedInt8 i8_min = 3;
|
||||
required PackedInt8 i8_max = 4;
|
||||
required PackedUint16 u16_min = 5;
|
||||
required PackedUint16 u16_max = 6;
|
||||
required PackedInt16 i16_min = 7;
|
||||
required PackedInt16 i16_max = 8;
|
||||
}
|
||||
|
||||
message UnpackedEnums {
|
||||
required UnpackedUint8 u8_min = 1;
|
||||
required UnpackedUint8 u8_max = 2;
|
||||
required UnpackedInt8 i8_min = 3;
|
||||
required UnpackedInt8 i8_max = 4;
|
||||
required UnpackedUint16 u16_min = 5;
|
||||
required UnpackedUint16 u16_max = 6;
|
||||
required UnpackedInt16 i16_min = 7;
|
||||
required UnpackedInt16 i16_max = 8;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue