summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2012-06-21 13:38:08 +0200
committerGergely Nagy <algernon@balabit.hu>2012-06-22 15:02:25 +0200
commit779645803fe70a389758b76ff01ba676b8a61999 (patch)
treed18ab12a5842e009d7768ec68d329dcd25794ca9 /t
parent57e8a2324deb11d76c4b9c176677afa9b98b2e50 (diff)
downloadlibumberlog-779645803fe70a389758b76ff01ba676b8a61999.tar.gz
libumberlog-779645803fe70a389758b76ff01ba676b8a61999.tar.xz
libumberlog-779645803fe70a389758b76ff01ba676b8a61999.zip
Test escaping of all control characters
... now that \f does not break the test. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 't')
-rw-r--r--t/test_umberlog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/test_umberlog.c b/t/test_umberlog.c
index 9818a35..9265c6a 100644
--- a/t/test_umberlog.c
+++ b/t/test_umberlog.c
@@ -193,6 +193,11 @@ END_TEST
START_TEST (test_json_escape)
{
+ static const char control_chars[] =
+ "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+ "\x20";
+
char *msg;
struct json_object *jo;
@@ -204,6 +209,7 @@ START_TEST (test_json_escape)
"control", "foo\nbar",
"utf8", "Árvíztűrő tükörfúrógép",
"junk", "\013foo",
+ "all_control", control_chars,
NULL);
jo = parse_msg (msg);
free (msg);
@@ -213,6 +219,7 @@ START_TEST (test_json_escape)
verify_value (jo, "control", "foo\nbar");
verify_value (jo, "utf8", "Árvíztűrő tükörfúrógép");
verify_value (jo, "junk", "\013foo");
+ verify_value (jo, "all_control", control_chars);
json_object_put (jo);