19 MyMessage msg = MyMessage_init_zero;
20 char *pStr, *pStrAligned;
22 COMMENT(
"Test for false negatives with pointer value low byte 0x00")
27 pStrAligned = (
char*)((uintptr_t)(pStr +
ALIGN) & ~(
ALIGN - 1));
30 msg.submessage.somestring = pStrAligned;
31 printf(
"%p: '%s'\n", msg.submessage.somestring, msg.submessage.somestring);
33 if (!
pb_encode(&ostream, MyMessage_fields, &msg)) {
39 msg.submessage.somestring =
NULL;
41 printf(
"response payload (%d):", (
int)ostream.bytes_written);
42 for (i = 0; i < ostream.bytes_written; i++) {
47 TEST(ostream.bytes_written != 0);
55 } msg = {MyMessage_init_zero, 0};
57 COMMENT(
"Test for false positives with data after end of struct")
62 if (!
pb_encode(&ostream, MyMessage_fields, &msg)) {
67 printf(
"response payload (%d):", (
int)ostream.bytes_written);
68 for (i = 0; i < ostream.bytes_written; i++) {
73 TEST(ostream.bytes_written == 0);