Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDainis Jonitis <dainis.jonitis@ubnt.com>2020-01-10 17:41:04 +0300
committerPetr Štetiar <ynezz@true.cz>2020-01-20 18:16:49 +0300
commita36ee96618a9613c234d1f4404769becdf5c55e3 (patch)
tree4b848e874d01131afba6b67176a8907cbf98ce71 /tests
parentf0da3a4283b7d1192de5c7e620df9381cd5a724b (diff)
blobmsg: blobmsg_add_json_element() 64-bit values
libjson-c json_type_int values are stored as int64_t. Use json_object_get_int64() instead of json_object_get_int() to avoid clamping to INT32_MAX. Reviewed-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com> [fixed author to match SoB, added unit test results] Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'tests')
-rw-r--r--tests/cram/test_blobmsg.t32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/cram/test_blobmsg.t b/tests/cram/test_blobmsg.t
index 84ec143..74ad326 100644
--- a/tests/cram/test_blobmsg.t
+++ b/tests/cram/test_blobmsg.t
@@ -46,8 +46,8 @@ check that blobmsg is producing expected results:
32767 (i32)
-2147483648 (i32)
2147483647 (i32)
- -2147483648 (i32)
- 2147483647 (i32)
+ -9223372036854775808 (i64)
+ 9223372036854775807 (i64)
133.700000 (dbl)
}
Testdata: {
@@ -60,8 +60,8 @@ check that blobmsg is producing expected results:
\tbar-max : 32767 (i32) (esc)
\tbaz-min : -2147483648 (i32) (esc)
\tbaz-max : 2147483647 (i32) (esc)
- \ttaz-min : -2147483648 (i32) (esc)
- \ttaz-max : 2147483647 (i32) (esc)
+ \ttaz-min : -9223372036854775808 (i64) (esc)
+ \ttaz-max : 9223372036854775807 (i64) (esc)
\tworld : 2 (str) (esc)
}
@@ -109,8 +109,8 @@ check that blobmsg is producing expected results:
32767 (i32)
-2147483648 (i32)
2147483647 (i32)
- -2147483648 (i32)
- 2147483647 (i32)
+ -9223372036854775808 (i64)
+ 9223372036854775807 (i64)
133.700000 (dbl)
}
Testdata: {
@@ -123,8 +123,8 @@ check that blobmsg is producing expected results:
\tbar-max : 32767 (i32) (esc)
\tbaz-min : -2147483648 (i32) (esc)
\tbaz-max : 2147483647 (i32) (esc)
- \ttaz-min : -2147483648 (i32) (esc)
- \ttaz-max : 2147483647 (i32) (esc)
+ \ttaz-min : -9223372036854775808 (i64) (esc)
+ \ttaz-max : 9223372036854775807 (i64) (esc)
\tworld : 2 (str) (esc)
}
@@ -172,8 +172,8 @@ check that blobmsg is producing expected results:
32767 (i32)
-2147483648 (i32)
2147483647 (i32)
- -2147483648 (i32)
- 2147483647 (i32)
+ -9223372036854775808 (i64)
+ 9223372036854775807 (i64)
133.700000 (dbl)
}
Testdata: {
@@ -186,8 +186,8 @@ check that blobmsg is producing expected results:
\tbar-max : 32767 (i32) (esc)
\tbaz-min : -2147483648 (i32) (esc)
\tbaz-max : 2147483647 (i32) (esc)
- \ttaz-min : -2147483648 (i32) (esc)
- \ttaz-max : 2147483647 (i32) (esc)
+ \ttaz-min : -9223372036854775808 (i64) (esc)
+ \ttaz-max : 9223372036854775807 (i64) (esc)
\tworld : 2 (str) (esc)
}
@@ -235,8 +235,8 @@ check that blobmsg is producing expected results:
32767 (i32)
-2147483648 (i32)
2147483647 (i32)
- -2147483648 (i32)
- 2147483647 (i32)
+ -9223372036854775808 (i64)
+ 9223372036854775807 (i64)
133.700000 (dbl)
}
Testdata: {
@@ -249,7 +249,7 @@ check that blobmsg is producing expected results:
\tbar-max : 32767 (i32) (esc)
\tbaz-min : -2147483648 (i32) (esc)
\tbaz-max : 2147483647 (i32) (esc)
- \ttaz-min : -2147483648 (i32) (esc)
- \ttaz-max : 2147483647 (i32) (esc)
+ \ttaz-min : -9223372036854775808 (i64) (esc)
+ \ttaz-max : 9223372036854775807 (i64) (esc)
\tworld : 2 (str) (esc)
}