Add #defines for the maximum encoded message size.
Update issue 89 Status: FixedInGit
This commit is contained in:
@@ -115,7 +115,7 @@ int main(int argc, char **argv)
|
||||
alltypes.end = 1099;
|
||||
|
||||
{
|
||||
uint8_t buffer[1024];
|
||||
uint8_t buffer[AllTypes_size];
|
||||
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
|
||||
|
||||
/* Now encode it and check if we succeeded. */
|
||||
|
||||
@@ -60,7 +60,7 @@ bool print_person(pb_istream_t *stream)
|
||||
|
||||
int main()
|
||||
{
|
||||
uint8_t buffer[512];
|
||||
uint8_t buffer[Person_size];
|
||||
pb_istream_t stream;
|
||||
size_t count;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
uint8_t buffer[512];
|
||||
uint8_t buffer[Person_size];
|
||||
pb_ostream_t stream;
|
||||
|
||||
/* Initialize the structure with constants */
|
||||
|
||||
@@ -280,6 +280,19 @@ int main()
|
||||
TEST(!pb_encode(&s, CallbackContainerContainer_fields, &msg2))
|
||||
}
|
||||
|
||||
{
|
||||
uint8_t buffer[StringMessage_size];
|
||||
pb_ostream_t s;
|
||||
StringMessage msg = {"0123456789"};
|
||||
|
||||
s = pb_ostream_from_buffer(buffer, sizeof(buffer));
|
||||
|
||||
COMMENT("Test that StringMessage_size is correct")
|
||||
|
||||
TEST(pb_encode(&s, StringMessage_fields, &msg));
|
||||
TEST(s.bytes_written == StringMessage_size);
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stdout, "\n\nSome tests FAILED!\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user