summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-08-24 21:22:20 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-08-24 21:22:20 +0300
commit0fb5e5e068326b23493952619d7efb640cb37377 (patch)
tree3f3bbb7e05c6c17984b13ab87104c235a61f22fd /tests
parentea57f74741b5b5ab3ab4a3e81d8b61811417b4c6 (diff)
Implement error messages in the decoder side.
Update issue 7 Status: Started
Diffstat (limited to 'tests')
-rw-r--r--tests/test_decode1.c2
-rw-r--r--tests/test_decode2.c2
-rw-r--r--tests/test_decode3.c2
-rw-r--r--tests/test_missing_fields.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_decode1.c b/tests/test_decode1.c
index 78781dd4..64eb4689 100644
--- a/tests/test_decode1.c
+++ b/tests/test_decode1.c
@@ -69,7 +69,7 @@ int main()
/* Decode and print out the stuff */
if (!print_person(&stream))
{
- printf("Parsing failed.\n");
+ printf("Parsing failed: %s\n", PB_GET_ERROR(&stream));
return 1;
} else {
return 0;
diff --git a/tests/test_decode2.c b/tests/test_decode2.c
index d38e6256..762b2b3f 100644
--- a/tests/test_decode2.c
+++ b/tests/test_decode2.c
@@ -82,7 +82,7 @@ int main()
pb_istream_t stream = {&callback, stdin, 10000};
if (!print_person(&stream))
{
- printf("Parsing failed.\n");
+ printf("Parsing failed: %s\n", PB_GET_ERROR(&stream));
return 1;
} else {
return 0;
diff --git a/tests/test_decode3.c b/tests/test_decode3.c
index 30a8afa7..4f55b558 100644
--- a/tests/test_decode3.c
+++ b/tests/test_decode3.c
@@ -89,7 +89,7 @@ int main()
/* Decode and print out the stuff */
if (!check_alltypes(&stream))
{
- printf("Parsing failed.\n");
+ printf("Parsing failed: %s\n", PB_GET_ERROR(&stream));
return 1;
} else {
return 0;
diff --git a/tests/test_missing_fields.c b/tests/test_missing_fields.c
index 46cd7d96..27741847 100644
--- a/tests/test_missing_fields.c
+++ b/tests/test_missing_fields.c
@@ -27,7 +27,7 @@ int main()
if (!pb_decode(&stream, MissingField_fields, &msg))
{
- printf("Decode failed.\n");
+ printf("Decode failed: %s\n", PB_GET_ERROR(&stream));
return 2;
}
}