From 388d4de833cf4e2127b2ab0489cb6b14ecc0cbb5 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 26 Sep 2013 10:23:37 +0300 Subject: Add #defines for the maximum encoded message size. Update issue 89 Status: FixedInGit --- tests/encode_unittests/encode_unittests.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/encode_unittests/encode_unittests.c') diff --git a/tests/encode_unittests/encode_unittests.c b/tests/encode_unittests/encode_unittests.c index c3634ac8..32a37bf1 100644 --- a/tests/encode_unittests/encode_unittests.c +++ b/tests/encode_unittests/encode_unittests.c @@ -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"); -- cgit 1.2.3-korg