Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2017-12-11 08:42:16 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2017-12-11 08:42:16 +0300
commit2c61cf7e9ac7ba3a4f83370b79a22b22851faae6 (patch)
treee13299db2e67a61450b06cefc14ed4b9ed85cbcf /tests/alltypes
parent7bf377dea76158c734756af5d956f62cb5857ea2 (diff)
Extend alltypes test case to cover issue #295.
Diffstat (limited to 'tests/alltypes')
-rw-r--r--tests/alltypes/SConscript10
-rw-r--r--tests/alltypes/decode_alltypes.c208
-rw-r--r--tests/alltypes/encode_alltypes.c135
3 files changed, 222 insertions, 131 deletions
diff --git a/tests/alltypes/SConscript b/tests/alltypes/SConscript
index 6c6238c..13acd4e 100644
--- a/tests/alltypes/SConscript
+++ b/tests/alltypes/SConscript
@@ -32,4 +32,14 @@ env.Encode("optionals.output.recoded",
MESSAGE='AllTypes')
env.Compare(["optionals.output", "optionals.output.recoded"])
+# And for the _zero initializer
+env.RunTest("zeroinit.output", enc, ARGS = ['2'])
+env.RunTest("zeroinit.decout", [dec, "zeroinit.output"], ARGS = ['2'])
+env.Decode("zeroinit.output.decoded",
+ ["zeroinit.output", "alltypes.proto"],
+ MESSAGE='AllTypes')
+env.Encode("zeroinit.output.recoded",
+ ["zeroinit.output.decoded", "alltypes.proto"],
+ MESSAGE='AllTypes')
+env.Compare(["zeroinit.output", "zeroinit.output.recoded"])
diff --git a/tests/alltypes/decode_alltypes.c b/tests/alltypes/decode_alltypes.c
index 2e609e5..8d0c514 100644
--- a/tests/alltypes/decode_alltypes.c
+++ b/tests/alltypes/decode_alltypes.c
@@ -29,61 +29,75 @@ bool check_alltypes(pb_istream_t *stream, int mode)
if (!pb_decode(stream, AllTypes_fields, &alltypes))
return false;
- TEST(alltypes.req_int32 == -1001);
- TEST(alltypes.req_int64 == -1002);
- TEST(alltypes.req_uint32 == 1003);
- TEST(alltypes.req_uint64 == 1004);
- TEST(alltypes.req_sint32 == -1005);
- TEST(alltypes.req_sint64 == -1006);
- TEST(alltypes.req_bool == true);
-
- TEST(alltypes.req_fixed32 == 1008);
- TEST(alltypes.req_sfixed32 == -1009);
- TEST(alltypes.req_float == 1010.0f);
-
- TEST(alltypes.req_fixed64 == 1011);
- TEST(alltypes.req_sfixed64 == -1012);
- TEST(alltypes.req_double == 1013.0f);
-
- TEST(strcmp(alltypes.req_string, "1014") == 0);
- TEST(alltypes.req_bytes.size == 4);
- TEST(memcmp(alltypes.req_bytes.bytes, "1015", 4) == 0);
- TEST(strcmp(alltypes.req_submsg.substuff1, "1016") == 0);
- TEST(alltypes.req_submsg.substuff2 == 1016);
- TEST(alltypes.req_submsg.substuff3 == 3);
- TEST(alltypes.req_enum == MyEnum_Truth);
- TEST(memcmp(alltypes.req_fbytes, "1019", 4) == 0);
-
- TEST(alltypes.rep_int32_count == 5 && alltypes.rep_int32[4] == -2001 && alltypes.rep_int32[0] == 0);
- TEST(alltypes.rep_int64_count == 5 && alltypes.rep_int64[4] == -2002 && alltypes.rep_int64[0] == 0);
- TEST(alltypes.rep_uint32_count == 5 && alltypes.rep_uint32[4] == 2003 && alltypes.rep_uint32[0] == 0);
- TEST(alltypes.rep_uint64_count == 5 && alltypes.rep_uint64[4] == 2004 && alltypes.rep_uint64[0] == 0);
- TEST(alltypes.rep_sint32_count == 5 && alltypes.rep_sint32[4] == -2005 && alltypes.rep_sint32[0] == 0);
- TEST(alltypes.rep_sint64_count == 5 && alltypes.rep_sint64[4] == -2006 && alltypes.rep_sint64[0] == 0);
- TEST(alltypes.rep_bool_count == 5 && alltypes.rep_bool[4] == true && alltypes.rep_bool[0] == false);
-
- TEST(alltypes.rep_fixed32_count == 5 && alltypes.rep_fixed32[4] == 2008 && alltypes.rep_fixed32[0] == 0);
- TEST(alltypes.rep_sfixed32_count == 5 && alltypes.rep_sfixed32[4] == -2009 && alltypes.rep_sfixed32[0] == 0);
- TEST(alltypes.rep_float_count == 5 && alltypes.rep_float[4] == 2010.0f && alltypes.rep_float[0] == 0.0f);
-
- TEST(alltypes.rep_fixed64_count == 5 && alltypes.rep_fixed64[4] == 2011 && alltypes.rep_fixed64[0] == 0);
- TEST(alltypes.rep_sfixed64_count == 5 && alltypes.rep_sfixed64[4] == -2012 && alltypes.rep_sfixed64[0] == 0);
- TEST(alltypes.rep_double_count == 5 && alltypes.rep_double[4] == 2013.0 && alltypes.rep_double[0] == 0.0);
-
- TEST(alltypes.rep_string_count == 5 && strcmp(alltypes.rep_string[4], "2014") == 0 && alltypes.rep_string[0][0] == '\0');
- TEST(alltypes.rep_bytes_count == 5 && alltypes.rep_bytes[4].size == 4 && alltypes.rep_bytes[0].size == 0);
- TEST(memcmp(alltypes.rep_bytes[4].bytes, "2015", 4) == 0);
+ if (mode == 0 || mode == 1)
+ {
+ TEST(alltypes.req_int32 == -1001);
+ TEST(alltypes.req_int64 == -1002);
+ TEST(alltypes.req_uint32 == 1003);
+ TEST(alltypes.req_uint64 == 1004);
+ TEST(alltypes.req_sint32 == -1005);
+ TEST(alltypes.req_sint64 == -1006);
+ TEST(alltypes.req_bool == true);
+
+ TEST(alltypes.req_fixed32 == 1008);
+ TEST(alltypes.req_sfixed32 == -1009);
+ TEST(alltypes.req_float == 1010.0f);
+
+ TEST(alltypes.req_fixed64 == 1011);
+ TEST(alltypes.req_sfixed64 == -1012);
+ TEST(alltypes.req_double == 1013.0f);
+
+ TEST(strcmp(alltypes.req_string, "1014") == 0);
+ TEST(alltypes.req_bytes.size == 4);
+ TEST(memcmp(alltypes.req_bytes.bytes, "1015", 4) == 0);
+ TEST(strcmp(alltypes.req_submsg.substuff1, "1016") == 0);
+ TEST(alltypes.req_submsg.substuff2 == 1016);
+ TEST(alltypes.req_submsg.substuff3 == 3);
+ TEST(alltypes.req_enum == MyEnum_Truth);
+ TEST(memcmp(alltypes.req_fbytes, "1019", 4) == 0);
+
+ TEST(alltypes.rep_int32_count == 5 && alltypes.rep_int32[4] == -2001 && alltypes.rep_int32[0] == 0);
+ TEST(alltypes.rep_int64_count == 5 && alltypes.rep_int64[4] == -2002 && alltypes.rep_int64[0] == 0);
+ TEST(alltypes.rep_uint32_count == 5 && alltypes.rep_uint32[4] == 2003 && alltypes.rep_uint32[0] == 0);
+ TEST(alltypes.rep_uint64_count == 5 && alltypes.rep_uint64[4] == 2004 && alltypes.rep_uint64[0] == 0);
+ TEST(alltypes.rep_sint32_count == 5 && alltypes.rep_sint32[4] == -2005 && alltypes.rep_sint32[0] == 0);
+ TEST(alltypes.rep_sint64_count == 5 && alltypes.rep_sint64[4] == -2006 && alltypes.rep_sint64[0] == 0);
+ TEST(alltypes.rep_bool_count == 5 && alltypes.rep_bool[4] == true && alltypes.rep_bool[0] == false);
+
+ TEST(alltypes.rep_fixed32_count == 5 && alltypes.rep_fixed32[4] == 2008 && alltypes.rep_fixed32[0] == 0);
+ TEST(alltypes.rep_sfixed32_count == 5 && alltypes.rep_sfixed32[4] == -2009 && alltypes.rep_sfixed32[0] == 0);
+ TEST(alltypes.rep_float_count == 5 && alltypes.rep_float[4] == 2010.0f && alltypes.rep_float[0] == 0.0f);
+
+ TEST(alltypes.rep_fixed64_count == 5 && alltypes.rep_fixed64[4] == 2011 && alltypes.rep_fixed64[0] == 0);
+ TEST(alltypes.rep_sfixed64_count == 5 && alltypes.rep_sfixed64[4] == -2012 && alltypes.rep_sfixed64[0] == 0);
+ TEST(alltypes.rep_double_count == 5 && alltypes.rep_double[4] == 2013.0 && alltypes.rep_double[0] == 0.0);
+
+ TEST(alltypes.rep_string_count == 5 && strcmp(alltypes.rep_string[4], "2014") == 0 && alltypes.rep_string[0][0] == '\0');
+ TEST(alltypes.rep_bytes_count == 5 && alltypes.rep_bytes[4].size == 4 && alltypes.rep_bytes[0].size == 0);
+ TEST(memcmp(alltypes.rep_bytes[4].bytes, "2015", 4) == 0);
- TEST(alltypes.rep_submsg_count == 5);
- TEST(strcmp(alltypes.rep_submsg[4].substuff1, "2016") == 0 && alltypes.rep_submsg[0].substuff1[0] == '\0');
- TEST(alltypes.rep_submsg[4].substuff2 == 2016 && alltypes.rep_submsg[0].substuff2 == 0);
- TEST(alltypes.rep_submsg[4].substuff3 == 2016 && alltypes.rep_submsg[0].substuff3 == 3);
-
- TEST(alltypes.rep_enum_count == 5 && alltypes.rep_enum[4] == MyEnum_Truth && alltypes.rep_enum[0] == MyEnum_Zero);
- TEST(alltypes.rep_emptymsg_count == 5);
- TEST(alltypes.rep_fbytes_count == 5);
- TEST(alltypes.rep_fbytes[0][0] == 0 && alltypes.rep_fbytes[0][3] == 0);
- TEST(memcmp(alltypes.rep_fbytes[4], "2019", 4) == 0);
+ TEST(alltypes.rep_submsg_count == 5);
+ TEST(strcmp(alltypes.rep_submsg[4].substuff1, "2016") == 0 && alltypes.rep_submsg[0].substuff1[0] == '\0');
+ TEST(alltypes.rep_submsg[4].substuff2 == 2016 && alltypes.rep_submsg[0].substuff2 == 0);
+ TEST(alltypes.rep_submsg[4].substuff3 == 2016 && alltypes.rep_submsg[0].substuff3 == 3);
+
+ TEST(alltypes.rep_enum_count == 5 && alltypes.rep_enum[4] == MyEnum_Truth && alltypes.rep_enum[0] == MyEnum_Zero);
+ TEST(alltypes.rep_emptymsg_count == 5);
+ TEST(alltypes.rep_fbytes_count == 5);
+ TEST(alltypes.rep_fbytes[0][0] == 0 && alltypes.rep_fbytes[0][3] == 0);
+ TEST(memcmp(alltypes.rep_fbytes[4], "2019", 4) == 0);
+
+ TEST(alltypes.req_limits.int32_min == INT32_MIN);
+ TEST(alltypes.req_limits.int32_max == INT32_MAX);
+ TEST(alltypes.req_limits.uint32_min == 0);
+ TEST(alltypes.req_limits.uint32_max == UINT32_MAX);
+ TEST(alltypes.req_limits.int64_min == INT64_MIN);
+ TEST(alltypes.req_limits.int64_max == INT64_MAX);
+ TEST(alltypes.req_limits.uint64_min == 0);
+ TEST(alltypes.req_limits.uint64_max == UINT64_MAX);
+ TEST(alltypes.req_limits.enum_min == HugeEnum_Negative);
+ TEST(alltypes.req_limits.enum_max == HugeEnum_Positive);
+ }
if (mode == 0)
{
@@ -134,7 +148,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
TEST(alltypes.which_oneof == 0);
}
- else
+ else if (mode == 1)
{
/* Expect filled-in values */
TEST(alltypes.has_opt_int32 == true);
@@ -185,17 +199,81 @@ bool check_alltypes(pb_istream_t *stream, int mode)
TEST(strcmp(alltypes.oneof.oneof_msg1.substuff1, "4059") == 0);
TEST(alltypes.oneof.oneof_msg1.substuff2 == 4059);
}
+ else if (mode == 2)
+ {
+ /* Expect zero values */
+ TEST(alltypes.req_int32 == 0);
+ TEST(alltypes.req_int64 == 0);
+ TEST(alltypes.req_uint32 == 0);
+ TEST(alltypes.req_uint64 == 0);
+ TEST(alltypes.req_sint32 == 0);
+ TEST(alltypes.req_sint64 == 0);
+ TEST(alltypes.req_bool == false);
+
+ TEST(alltypes.req_fixed32 == 0);
+ TEST(alltypes.req_sfixed32 == 0);
+ TEST(alltypes.req_float == 0.0f);
+
+ TEST(alltypes.req_fixed64 == 0);
+ TEST(alltypes.req_sfixed64 == 0);
+ TEST(alltypes.req_double == 0.0f);
+
+ TEST(strcmp(alltypes.req_string, "") == 0);
+ TEST(alltypes.req_bytes.size == 0);
+ TEST(strcmp(alltypes.req_submsg.substuff1, "") == 0);
+ TEST(alltypes.req_submsg.substuff2 == 0);
+ TEST(alltypes.req_enum == MyEnum_Zero);
+
+ TEST(alltypes.rep_int32_count == 0);
+ TEST(alltypes.rep_int64_count == 0);
+ TEST(alltypes.rep_uint32_count == 0);
+ TEST(alltypes.rep_uint64_count == 0);
+ TEST(alltypes.rep_sint32_count == 0);
+ TEST(alltypes.rep_sint64_count == 0);
+ TEST(alltypes.rep_bool_count == 0);
+
+ TEST(alltypes.rep_fixed32_count == 0);
+ TEST(alltypes.rep_sfixed32_count == 0);
+ TEST(alltypes.rep_float_count == 0);
+
+ TEST(alltypes.rep_fixed64_count == 0);
+ TEST(alltypes.rep_sfixed64_count == 0);
+ TEST(alltypes.rep_double_count == 0);
+
+ TEST(alltypes.rep_string_count == 0);
+ TEST(alltypes.rep_bytes_count == 0);
+
+ TEST(alltypes.rep_submsg_count == 0);
+
+ TEST(alltypes.rep_enum_count == 0);
+ TEST(alltypes.rep_emptymsg_count == 0);
+ TEST(alltypes.rep_fbytes_count == 0);
- TEST(alltypes.req_limits.int32_min == INT32_MIN);
- TEST(alltypes.req_limits.int32_max == INT32_MAX);
- TEST(alltypes.req_limits.uint32_min == 0);
- TEST(alltypes.req_limits.uint32_max == UINT32_MAX);
- TEST(alltypes.req_limits.int64_min == INT64_MIN);
- TEST(alltypes.req_limits.int64_max == INT64_MAX);
- TEST(alltypes.req_limits.uint64_min == 0);
- TEST(alltypes.req_limits.uint64_max == UINT64_MAX);
- TEST(alltypes.req_limits.enum_min == HugeEnum_Negative);
- TEST(alltypes.req_limits.enum_max == HugeEnum_Positive);
+ TEST(alltypes.has_opt_int32 == false);
+ TEST(alltypes.has_opt_int64 == false);
+ TEST(alltypes.has_opt_uint32 == false);
+ TEST(alltypes.has_opt_uint64 == false);
+ TEST(alltypes.has_opt_sint32 == false);
+ TEST(alltypes.has_opt_sint64 == false);
+ TEST(alltypes.has_opt_bool == false);
+
+ TEST(alltypes.has_opt_fixed32 == false);
+ TEST(alltypes.has_opt_sfixed32 == false);
+ TEST(alltypes.has_opt_float == false);
+
+ TEST(alltypes.has_opt_fixed64 == false);
+ TEST(alltypes.has_opt_sfixed64 == false);
+ TEST(alltypes.has_opt_double == false);
+
+ TEST(alltypes.has_opt_string == false);
+ TEST(alltypes.has_opt_bytes == false);
+ TEST(alltypes.has_opt_submsg == false);
+ TEST(alltypes.has_opt_enum == false);
+ TEST(alltypes.has_opt_emptymsg == false);
+ TEST(alltypes.has_opt_fbytes == false);
+
+ TEST(alltypes.which_oneof == 0);
+ }
TEST(alltypes.end == 1099);
diff --git a/tests/alltypes/encode_alltypes.c b/tests/alltypes/encode_alltypes.c
index 1b86355..15ea7b8 100644
--- a/tests/alltypes/encode_alltypes.c
+++ b/tests/alltypes/encode_alltypes.c
@@ -15,74 +15,77 @@ int main(int argc, char **argv)
/* Initialize the structure with constants */
AllTypes alltypes = AllTypes_init_zero;
- alltypes.req_int32 = -1001;
- alltypes.req_int64 = -1002;
- alltypes.req_uint32 = 1003;
- alltypes.req_uint64 = 1004;
- alltypes.req_sint32 = -1005;
- alltypes.req_sint64 = -1006;
- alltypes.req_bool = true;
-
- alltypes.req_fixed32 = 1008;
- alltypes.req_sfixed32 = -1009;
- alltypes.req_float = 1010.0f;
-
- alltypes.req_fixed64 = 1011;
- alltypes.req_sfixed64 = -1012;
- alltypes.req_double = 1013.0;
-
- strcpy(alltypes.req_string, "1014");
- alltypes.req_bytes.size = 4;
- memcpy(alltypes.req_bytes.bytes, "1015", 4);
- strcpy(alltypes.req_submsg.substuff1, "1016");
- alltypes.req_submsg.substuff2 = 1016;
- alltypes.req_enum = MyEnum_Truth;
- memcpy(alltypes.req_fbytes, "1019", 4);
-
- alltypes.rep_int32_count = 5; alltypes.rep_int32[4] = -2001;
- alltypes.rep_int64_count = 5; alltypes.rep_int64[4] = -2002;
- alltypes.rep_uint32_count = 5; alltypes.rep_uint32[4] = 2003;
- alltypes.rep_uint64_count = 5; alltypes.rep_uint64[4] = 2004;
- alltypes.rep_sint32_count = 5; alltypes.rep_sint32[4] = -2005;
- alltypes.rep_sint64_count = 5; alltypes.rep_sint64[4] = -2006;
- alltypes.rep_bool_count = 5; alltypes.rep_bool[4] = true;
-
- alltypes.rep_fixed32_count = 5; alltypes.rep_fixed32[4] = 2008;
- alltypes.rep_sfixed32_count = 5; alltypes.rep_sfixed32[4] = -2009;
- alltypes.rep_float_count = 5; alltypes.rep_float[4] = 2010.0f;
-
- alltypes.rep_fixed64_count = 5; alltypes.rep_fixed64[4] = 2011;
- alltypes.rep_sfixed64_count = 5; alltypes.rep_sfixed64[4] = -2012;
- alltypes.rep_double_count = 5; alltypes.rep_double[4] = 2013.0;
-
- alltypes.rep_string_count = 5; strcpy(alltypes.rep_string[4], "2014");
- alltypes.rep_bytes_count = 5; alltypes.rep_bytes[4].size = 4;
- memcpy(alltypes.rep_bytes[4].bytes, "2015", 4);
+ if (mode == 0 || mode == 1)
+ {
+ alltypes.req_int32 = -1001;
+ alltypes.req_int64 = -1002;
+ alltypes.req_uint32 = 1003;
+ alltypes.req_uint64 = 1004;
+ alltypes.req_sint32 = -1005;
+ alltypes.req_sint64 = -1006;
+ alltypes.req_bool = true;
+
+ alltypes.req_fixed32 = 1008;
+ alltypes.req_sfixed32 = -1009;
+ alltypes.req_float = 1010.0f;
+
+ alltypes.req_fixed64 = 1011;
+ alltypes.req_sfixed64 = -1012;
+ alltypes.req_double = 1013.0;
+
+ strcpy(alltypes.req_string, "1014");
+ alltypes.req_bytes.size = 4;
+ memcpy(alltypes.req_bytes.bytes, "1015", 4);
+ strcpy(alltypes.req_submsg.substuff1, "1016");
+ alltypes.req_submsg.substuff2 = 1016;
+ alltypes.req_enum = MyEnum_Truth;
+ memcpy(alltypes.req_fbytes, "1019", 4);
+
+ alltypes.rep_int32_count = 5; alltypes.rep_int32[4] = -2001;
+ alltypes.rep_int64_count = 5; alltypes.rep_int64[4] = -2002;
+ alltypes.rep_uint32_count = 5; alltypes.rep_uint32[4] = 2003;
+ alltypes.rep_uint64_count = 5; alltypes.rep_uint64[4] = 2004;
+ alltypes.rep_sint32_count = 5; alltypes.rep_sint32[4] = -2005;
+ alltypes.rep_sint64_count = 5; alltypes.rep_sint64[4] = -2006;
+ alltypes.rep_bool_count = 5; alltypes.rep_bool[4] = true;
+
+ alltypes.rep_fixed32_count = 5; alltypes.rep_fixed32[4] = 2008;
+ alltypes.rep_sfixed32_count = 5; alltypes.rep_sfixed32[4] = -2009;
+ alltypes.rep_float_count = 5; alltypes.rep_float[4] = 2010.0f;
+
+ alltypes.rep_fixed64_count = 5; alltypes.rep_fixed64[4] = 2011;
+ alltypes.rep_sfixed64_count = 5; alltypes.rep_sfixed64[4] = -2012;
+ alltypes.rep_double_count = 5; alltypes.rep_double[4] = 2013.0;
+
+ alltypes.rep_string_count = 5; strcpy(alltypes.rep_string[4], "2014");
+ alltypes.rep_bytes_count = 5; alltypes.rep_bytes[4].size = 4;
+ memcpy(alltypes.rep_bytes[4].bytes, "2015", 4);
- alltypes.rep_submsg_count = 5;
- strcpy(alltypes.rep_submsg[4].substuff1, "2016");
- alltypes.rep_submsg[4].substuff2 = 2016;
- alltypes.rep_submsg[4].has_substuff3 = true;
- alltypes.rep_submsg[4].substuff3 = 2016;
-
- alltypes.rep_enum_count = 5; alltypes.rep_enum[4] = MyEnum_Truth;
- alltypes.rep_emptymsg_count = 5;
-
- alltypes.rep_fbytes_count = 5;
- memcpy(alltypes.rep_fbytes[4], "2019", 4);
-
- alltypes.req_limits.int32_min = INT32_MIN;
- alltypes.req_limits.int32_max = INT32_MAX;
- alltypes.req_limits.uint32_min = 0;
- alltypes.req_limits.uint32_max = UINT32_MAX;
- alltypes.req_limits.int64_min = INT64_MIN;
- alltypes.req_limits.int64_max = INT64_MAX;
- alltypes.req_limits.uint64_min = 0;
- alltypes.req_limits.uint64_max = UINT64_MAX;
- alltypes.req_limits.enum_min = HugeEnum_Negative;
- alltypes.req_limits.enum_max = HugeEnum_Positive;
+ alltypes.rep_submsg_count = 5;
+ strcpy(alltypes.rep_submsg[4].substuff1, "2016");
+ alltypes.rep_submsg[4].substuff2 = 2016;
+ alltypes.rep_submsg[4].has_substuff3 = true;
+ alltypes.rep_submsg[4].substuff3 = 2016;
+
+ alltypes.rep_enum_count = 5; alltypes.rep_enum[4] = MyEnum_Truth;
+ alltypes.rep_emptymsg_count = 5;
+
+ alltypes.rep_fbytes_count = 5;
+ memcpy(alltypes.rep_fbytes[4], "2019", 4);
+
+ alltypes.req_limits.int32_min = INT32_MIN;
+ alltypes.req_limits.int32_max = INT32_MAX;
+ alltypes.req_limits.uint32_min = 0;
+ alltypes.req_limits.uint32_max = UINT32_MAX;
+ alltypes.req_limits.int64_min = INT64_MIN;
+ alltypes.req_limits.int64_max = INT64_MAX;
+ alltypes.req_limits.uint64_min = 0;
+ alltypes.req_limits.uint64_max = UINT64_MAX;
+ alltypes.req_limits.enum_min = HugeEnum_Negative;
+ alltypes.req_limits.enum_max = HugeEnum_Positive;
+ }
- if (mode != 0)
+ if (mode == 1)
{
/* Fill in values for optional fields */
alltypes.has_opt_int32 = true;