summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2009-12-03 16:08:34 -0800
committerBen Pfaff <blp@nicira.com>2009-12-03 16:08:34 -0800
commit0bdf342a8c90c821d63da05b2cc9df159af03b75 (patch)
tree924da56d3e57aadba92286c787a048891f268c01 /tests
parentfa33d64a5797e59d61fd3d12257b27b5565fc587 (diff)
downloadopenvswitch-0bdf342a8c90c821d63da05b2cc9df159af03b75.tar.gz
json: Improve error reporting.
Diffstat (limited to 'tests')
-rw-r--r--tests/json.at14
-rw-r--r--tests/ovsdb-log.at2
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/json.at b/tests/json.at
index 54d4f8cf1..3096b2643 100644
--- a/tests/json.at
+++ b/tests/json.at
@@ -2,15 +2,19 @@ m4_define([JSON_CHECK_POSITIVE],
[AT_SETUP([$1])
AT_KEYWORDS([json positive])
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
- OVS_CHECK_LCOV([test-json $4 input], [0], [$3
-], [])
+ AT_CAPTURE_FILE([input])
+ OVS_CHECK_LCOV([test-json $4 input], [0], [stdout], [])
+ AT_CHECK([cat stdout], [0], [$3
+])
AT_CLEANUP])
m4_define([JSON_CHECK_NEGATIVE],
[AT_SETUP([$1])
AT_KEYWORDS([json negative])
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
- OVS_CHECK_LCOV([test-json $4 input], [1], [$3
+ AT_CAPTURE_FILE([input])
+ OVS_CHECK_LCOV([test-json $4 input], [1], [stdout], [])
+ AT_CHECK([[sed 's/^error: [^:]*:/error:/' < stdout]], [0], [$3
])
AT_CLEANUP])
@@ -72,7 +76,7 @@ JSON_CHECK_NEGATIVE([null bytes not allowed],
AT_SETUP([end of input in quoted string])
AT_KEYWORDS([json negative])
AT_CHECK([printf '\"xxx' | test-json -], [1],
- [error: unexpected end of input in quoted string
+ [error: line 0, column 4, byte 4: unexpected end of input in quoted string
])
AT_CLEANUP
@@ -259,7 +263,7 @@ JSON_CHECK_NEGATIVE([objects nesting too deep],
AT_SETUP([input may not be empty])
AT_KEYWORDS([json negative])
-AT_CHECK([test-json /dev/null], [1], [error: empty input stream
+AT_CHECK([test-json /dev/null], [1], [error: line 0, column 0, byte 0: empty input stream
])
AT_CLEANUP
diff --git a/tests/ovsdb-log.at b/tests/ovsdb-log.at
index b0c1c97bd..5a4846c85 100644
--- a/tests/ovsdb-log.at
+++ b/tests/ovsdb-log.at
@@ -266,7 +266,7 @@ OVS_CHECK_LCOV(
file: read: [0]
file: read: [1]
file: read: [2]
-file: read failed: syntax error: file: 5 bytes starting at offset 228 are not valid JSON (syntax error at beginning of input)
+file: read failed: syntax error: file: 5 bytes starting at offset 228 are not valid JSON (line 1, column 0, byte 5: syntax error at beginning of input)
file: write:["replacement data"] successful
]], [ignore])
OVS_CHECK_LCOV(