aboutsummaryrefslogtreecommitdiffstats
path: root/tests/encode_unittests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-26 10:23:37 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-26 10:23:37 +0300
commit388d4de833cf4e2127b2ab0489cb6b14ecc0cbb5 (patch)
treef02cca531cd6ad210b1d3e57627e84f8feb3ac3a /tests/encode_unittests
parent2363af29a238fb4fa17474c979a0f45cde617a9e (diff)
Add #defines for the maximum encoded message size.
Update issue 89 Status: FixedInGit
Diffstat (limited to 'tests/encode_unittests')
-rw-r--r--tests/encode_unittests/encode_unittests.c13
1 files changed, 13 insertions, 0 deletions
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");