diff options
author | Peter Seiderer <ps.report@gmx.net> | 2021-03-06 13:54:50 +0300 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2021-03-09 23:53:14 +0300 |
commit | 551d75b5662cccd0466b990d58136bdf799a804d (patch) | |
tree | 9f26910d224b6af2ee68a2e120fc39a4549c95a9 /tests/cram | |
parent | 4d8995e91d56ee7629842afee2194bfe4c89854c (diff) |
libubox: tests: add more blobmsg/json test cases
* add mixed int/double tests
* add blobmsg_cast_u64/blobmsg_cast_s64 tests
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Diffstat (limited to 'tests/cram')
-rw-r--r-- | tests/cram/test_blobmsg_types.t | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/cram/test_blobmsg_types.t b/tests/cram/test_blobmsg_types.t new file mode 100644 index 0000000..190e1f2 --- /dev/null +++ b/tests/cram/test_blobmsg_types.t @@ -0,0 +1,82 @@ +check that blobmsg is producing expected results: + + $ [ -n "$TEST_BIN_DIR" ] && export PATH="$TEST_BIN_DIR:$PATH" + + $ valgrind --quiet --leak-check=full test-blobmsg-types + [*] blobmsg dump: + string: Hello, world! + int64_max: 9223372036854775807 + int64_min: -9223372036854775808 + int32_max: 2147483647 + int32_min: -2147483648 + int16_max: 32767 + int16_min: -32768 + int8_max: 127 + int8_min: -128 + double_max: 1.797693e+308 + double_min: 2.225074e-308 + [*] blobmsg dump cast_u64: + string: Hello, world! + int64_max: 9223372036854775807 + int64_min: 9223372036854775808 + int32_max: 2147483647 + int32_min: 2147483648 + int16_max: 32767 + int16_min: 32768 + int8_max: 127 + int8_min: 128 + double_max: 1.797693e+308 + double_min: 2.225074e-308 + [*] blobmsg dump cast_s64: + string: Hello, world! + int64_max: 9223372036854775807 + int64_min: -9223372036854775808 + int32_max: 2147483647 + int32_min: -2147483648 + int16_max: 32767 + int16_min: -32768 + int8_max: 127 + int8_min: -128 + double_max: 1.797693e+308 + double_min: 2.225074e-308 + + [*] blobmsg to json: {"string":"Hello, world!","int64_max":9223372036854775807,"int64_min":-9223372036854775808,"int32_max":2147483647,"int32_min":-2147483648,"int16_max":32767,"int16_min":-32768,"int8_max":true,"int8_min":true,"double_max":179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000,"double_min":0.000000} + + [*] blobmsg from json: + string: Hello, world! + int64_max: 9223372036854775807 + int64_min: -9223372036854775808 + int32_max: 2147483647 + int32_min: -2147483648 + int16_max: 32767 + int16_min: -32768 + int8_max: 1 + int8_min: 1 + double_max: 1.797693e+308 + double_min: 0.000000e+00 + + [*] blobmsg from json/cast_u64: + string: Hello, world! + int64_max: 9223372036854775807 + int64_min: 9223372036854775808 + int32_max: 2147483647 + int32_min: 2147483648 + int16_max: 32767 + int16_min: 4294934528 + int8_max: 1 + int8_min: 1 + double_max: 1.797693e+308 + double_min: 0.000000e+00 + + [*] blobmsg from json/cast_s64: + string: Hello, world! + int64_max: 9223372036854775807 + int64_min: -9223372036854775808 + int32_max: 2147483647 + int32_min: -2147483648 + int16_max: 32767 + int16_min: -32768 + int8_max: 1 + int8_min: 1 + double_max: 1.797693e+308 + double_min: 0.000000e+00 |