summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2017-03-02 21:51:31 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2017-03-02 22:20:47 +0200
commitfde887cdd96a1bf64980bad8ecb67c32bae1fbdd (patch)
tree481b5cd3e59f347a7306248c563a1149440d6841 /tests
parentac6405b4b8c7b3f449bd19bc3f8b84e6bc9fff77 (diff)
Fix bug in alltypes_callback test case
Diffstat (limited to 'tests')
-rw-r--r--tests/alltypes_callback/alltypes.options1
-rw-r--r--tests/alltypes_callback/decode_alltypes_callback.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/alltypes_callback/alltypes.options b/tests/alltypes_callback/alltypes.options
index 74d7a9c0..f01cc9d5 100644
--- a/tests/alltypes_callback/alltypes.options
+++ b/tests/alltypes_callback/alltypes.options
@@ -2,6 +2,7 @@
AllTypes.* type:FT_CALLBACK
SubMessage.substuff1 max_size:16
AllTypes.oneof no_unions:true
+* packed:true
# With FT_CALLBACK, these options should get ignored
*.*fbytes fixed_length:true max_size:4
diff --git a/tests/alltypes_callback/decode_alltypes_callback.c b/tests/alltypes_callback/decode_alltypes_callback.c
index ec946909..2cdffafa 100644
--- a/tests/alltypes_callback/decode_alltypes_callback.c
+++ b/tests/alltypes_callback/decode_alltypes_callback.c
@@ -74,7 +74,7 @@ static bool read_submsg(pb_istream_t *stream, const pb_field_t *field, void **ar
if (!pb_decode(stream, SubMessage_fields, &submsg))
return false;
- TEST(memcmp(&submsg, *arg, sizeof(submsg)));
+ TEST(memcmp(&submsg, *arg, sizeof(submsg)) == 0);
return true;
}
@@ -184,7 +184,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
uint64_t req_fixed64 = 1011;
int64_t req_sfixed64 = -1012;
double req_double = 1013.0;
- SubMessage req_submsg = {"1016", 1016};
+ SubMessage req_submsg = {"1016", 1016, false, 3};
int32_t rep_int32[5] = {0, 0, 0, 0, -2001};
int32_t rep_int64[5] = {0, 0, 0, 0, -2002};
@@ -214,9 +214,9 @@ bool check_alltypes(pb_istream_t *stream, int mode)
uint64_t opt_fixed64 = 3051;
int64_t opt_sfixed64 = 3052;
double opt_double = 3053.0f;
- SubMessage opt_submsg = {"3056", 3056};
+ SubMessage opt_submsg = {"3056", 3056, false, 3};
- SubMessage oneof_msg1 = {"4059", 4059};
+ SubMessage oneof_msg1 = {"4059", 4059, false, 3};
/* Bind callbacks for required fields */
AllTypes alltypes = AllTypes_init_zero;