From c5cfa7e119e301348a69d0480e6ad1d69baea3b3 Mon Sep 17 00:00:00 2001 From: Gabor Adam Toth Date: Thu, 2 Jun 2011 13:25:48 +0200 Subject: [PATCH] more test packets & additional testPsyc debug msgs --- test/packets/00-body-only | 4 ++++ test/packets/00-empty | 1 + test/packets/00-length-body-only | 4 ++++ test/packets/00-length-no-entity | 6 ++++++ test/packets/00-method-only-1 | 3 +++ test/testPsyc.c | 2 ++ 6 files changed, 20 insertions(+) create mode 100644 test/packets/00-body-only create mode 100644 test/packets/00-empty create mode 100644 test/packets/00-length-body-only create mode 100644 test/packets/00-length-no-entity create mode 100644 test/packets/00-method-only-1 diff --git a/test/packets/00-body-only b/test/packets/00-body-only new file mode 100644 index 0000000..116d391 --- /dev/null +++ b/test/packets/00-body-only @@ -0,0 +1,4 @@ + +_message_private +OHAI +| diff --git a/test/packets/00-empty b/test/packets/00-empty new file mode 100644 index 0000000..948cf94 --- /dev/null +++ b/test/packets/00-empty @@ -0,0 +1 @@ +| diff --git a/test/packets/00-length-body-only b/test/packets/00-length-body-only new file mode 100644 index 0000000..22e96eb --- /dev/null +++ b/test/packets/00-length-body-only @@ -0,0 +1,4 @@ +22 +_message_private +OHAI +| diff --git a/test/packets/00-length-no-entity b/test/packets/00-length-no-entity new file mode 100644 index 0000000..27785b5 --- /dev/null +++ b/test/packets/00-length-no-entity @@ -0,0 +1,6 @@ +:_source psyc://foo.example.com/ +:_target psyc://bar.example.com/ +22 +_message_private +OHAI +| diff --git a/test/packets/00-method-only-1 b/test/packets/00-method-only-1 new file mode 100644 index 0000000..0da4d2f --- /dev/null +++ b/test/packets/00-method-only-1 @@ -0,0 +1,3 @@ + +_ +| diff --git a/test/testPsyc.c b/test/testPsyc.c index 087beaf..f49922a 100644 --- a/test/testPsyc.c +++ b/test/testPsyc.c @@ -80,6 +80,8 @@ int test_input (int i, char *recvbuf, size_t nbytes) { value.length = 0; do { + if (verbose >= 3) + printf("\n# buffer = [%.*s]\n# part = %d\n", (int)parsers[i].buffer.length, parsers[i].buffer.ptr, parsers[i].part); // Parse the next part of the packet (a routing/entity modifier or the body) ret = exit_code = psyc_parse(&parsers[i], &oper, &name, &value); if (verbose >= 2)