summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-06-04 10:54:18 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-06-04 10:54:18 +0200
commit59d3e23fa40a2d313c840807f4ec052e2df07616 (patch)
tree6d38219e4125cd17fb062ab61d39cbb6719769f4
parente891f1f2e166a60cd29dd0998bd0fa63b05d30cd (diff)
downloadjson-dbus-bridge-59d3e23fa40a2d313c840807f4ec052e2df07616.tar.gz
json-dbus-bridge-59d3e23fa40a2d313c840807f4ec052e2df07616.tar.xz
[tests] add tests for 'null' values
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xtests/basic_int32_test.sh2
-rwxr-xr-xtests/complex_array_test.sh2
-rwxr-xr-xtests/complex_dict_test.sh1
3 files changed, 5 insertions, 0 deletions
diff --git a/tests/basic_int32_test.sh b/tests/basic_int32_test.sh
index 649a016..a8be873 100755
--- a/tests/basic_int32_test.sh
+++ b/tests/basic_int32_test.sh
@@ -15,5 +15,7 @@ jdb_test_echo EchoINT32 i -1 &&
jdb_test_echo EchoINT32 i 42 &&
jdb_test_echo EchoINT32 i 2147483647 &&
jdb_test_echo EchoINT32 i -2147483648 &&
+jdb_test_echo EchoINT32 i null null "Unexpected 'null' parameter found." &&
+jdb_test_echo SumINT32 ii "23, null" null "Unexpected 'null' parameter found." &&
jdb_test_echo EchoINT32 i '"foo"' null "integer value expected."
diff --git a/tests/complex_array_test.sh b/tests/complex_array_test.sh
index f868396..cabd81c 100755
--- a/tests/complex_array_test.sh
+++ b/tests/complex_array_test.sh
@@ -16,6 +16,8 @@ jdb_test_echo EchoArray ai "[ 1, 2, 3, 42, 99, \"foo\" ]" null "integer value ex
jdb_test_echo CountArray ai "[ 1, 2, 3, 42, 99, -42 ]" 6 &&
jdb_test_echo CountArray ai "[]" 0 &&
+jdb_test_echo CountArray ai "[ 1, null, 42]" null "unexpected 'null' element in json array." &&
+
args="42" &&
for i in `seq 1 10`; do
args="$args, $i, 1$i, 10$i, 100$i, 1000$i, 2$i, 20$i, 200$i, 2000$i, 3$i, 30$i, 300$i, 3000$i, 4$i, 40$i, 400$i, 4000$i, 5$i, 50$i, 500$i, 5000$i, $args"
diff --git a/tests/complex_dict_test.sh b/tests/complex_dict_test.sh
index da9621b..c3dd630 100755
--- a/tests/complex_dict_test.sh
+++ b/tests/complex_dict_test.sh
@@ -12,5 +12,6 @@
jdb_test_echo EchoDict 'a{si}' '{ "a": 1, "b": 2, "ff": 3, "y": 42, "x": 99, "foo": -42 }' &&
jdb_test_echo EchoDict 'a{si}' '{ "a": 1, "b": "2" }' null "integer value expected." &&
+jdb_test_echo EchoDict 'a{si}' '{ "a": 1, "b": null }' null "unexpected 'null' value in json object." &&
jdb_test_echo DictKeys 'a{si}' '{ "a": 1, "b": 2, "c": 55 }' '[ "a", "b", "c" ]'