summaryrefslogtreecommitdiffstats
path: root/tests/test_encode2.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-03-09 14:49:15 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-03-09 14:49:15 +0200
commit03526471189711f6656dfa074fc6a8fd7f3d340b (patch)
tree12e1969b04909547bf32309cfcc4c9409e24fbbc /tests/test_encode2.c
parent9b6641ac643af4f301e05421f2b228084dcc8693 (diff)
Implement error message support for the encoder side.
Update issue 7 Status: FixedInGit
Diffstat (limited to 'tests/test_encode2.c')
-rw-r--r--tests/test_encode2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_encode2.c b/tests/test_encode2.c
index b1105ce6..fd25c6cb 100644
--- a/tests/test_encode2.c
+++ b/tests/test_encode2.c
@@ -26,7 +26,12 @@ int main()
/* Now encode it and check if we succeeded. */
if (pb_encode(&stream, Person_fields, &person))
+ {
return 0; /* Success */
+ }
else
+ {
+ fprintf(stderr, "Encoding failed: %s\n", PB_GET_ERROR(&stream));
return 1; /* Failure */
+ }
}