summaryrefslogtreecommitdiffstats
path: root/tests/decode_unittests.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-07-06 16:16:00 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-07-06 16:16:00 +0300
commitbb985e99274b537ee662d630b02664a3825d8829 (patch)
treea6cf90d0005d2a1f1a66977a1a4e4901c9eb24a4 /tests/decode_unittests.c
parent314460c2a518bdfc4e5dfb87992d907461a7c0e6 (diff)
Add pb_decode_delimited and pb_encode_delimited wrapper functions.
Update issue 74 Status: FixedInGit
Diffstat (limited to 'tests/decode_unittests.c')
-rw-r--r--tests/decode_unittests.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/decode_unittests.c b/tests/decode_unittests.c
index 1e74c34d..6ad05f00 100644
--- a/tests/decode_unittests.c
+++ b/tests/decode_unittests.c
@@ -289,6 +289,16 @@ int main()
TEST((s = S("\x08"), !pb_decode(&s, IntegerArray_fields, &dest)))
}
+ {
+ pb_istream_t s;
+ IntegerContainer dest = {};
+
+ COMMENT("Testing pb_decode_delimited")
+ TEST((s = S("\x09\x0A\x07\x0A\x05\x01\x02\x03\x04\x05"),
+ pb_decode_delimited(&s, IntegerContainer_fields, &dest)) &&
+ dest.submsg.data_count == 5)
+ }
+
if (status != 0)
fprintf(stdout, "\n\nSome tests FAILED!\n");