diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-12-21 12:41:20 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-12-21 12:41:20 +0200 |
commit | cd9004089fd4ae42cc68fd15f085f42c48494cb4 (patch) | |
tree | f0b690d8866e2f4ae84a0f5cdf9a0a02d3755ec7 /tests/field_size_16 | |
parent | ee5b12c537115b113ce01708d4a86a4062cdb182 (diff) |
Add test for extreme integer values (INT32_MAX etc.) in AllTypes.
Diffstat (limited to 'tests/field_size_16')
-rw-r--r-- | tests/field_size_16/alltypes.proto | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/field_size_16/alltypes.proto b/tests/field_size_16/alltypes.proto index b981760d..7494853d 100644 --- a/tests/field_size_16/alltypes.proto +++ b/tests/field_size_16/alltypes.proto @@ -8,6 +8,24 @@ message EmptyMessage { } +enum HugeEnum { + Negative = -2147483647; /* protoc doesn't accept -2147483648 here */ + Positive = 2147483647; +} + +message Limits { + required int32 int32_min = 1; + required int32 int32_max = 2; + required uint32 uint32_min = 3; + required uint32 uint32_max = 4; + required int64 int64_min = 5; + required int64 int64_max = 6; + required uint64 uint64_min = 7; + required uint64 uint64_max = 8; + required HugeEnum enum_min = 9; + required HugeEnum enum_max = 10; +} + enum MyEnum { Zero = 0; First = 1; @@ -83,6 +101,9 @@ message AllTypes { optional MyEnum opt_enum = 10057 [default = Second]; optional EmptyMessage opt_emptymsg = 10058; + // Check that extreme integer values are handled correctly + required Limits req_limits = 98; + // Just to make sure that the size of the fields has been calculated // properly, i.e. otherwise a bug in last field might not be detected. required int32 end = 10099; |