diff options
author | Nikias Bassen | 2022-02-07 09:36:16 +0100 |
---|---|---|
committer | Nikias Bassen | 2022-02-07 09:36:16 +0100 |
commit | b8e9fedc5f1694164707c810dd9dae3f6468edb6 (patch) | |
tree | 5e84bba02328f44e8a51a5d9a4f2a91373adc772 /test | |
parent | 2727078f8f2d94cd03344a3c83672b543d726b39 (diff) | |
download | libplist-b8e9fedc5f1694164707c810dd9dae3f6468edb6.tar.gz libplist-b8e9fedc5f1694164707c810dd9dae3f6468edb6.tar.bz2 |
test: Add int64 min/max testcase for JSON parser
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 6 | ||||
-rw-r--r-- | test/data/int64_min_max.json | 1 | ||||
-rwxr-xr-x | test/json-int64-min-max.test | 19 |
3 files changed, 24 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 0d99d92..cd3b940 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -53,7 +53,8 @@ TESTS = \ json1.test \ json2.test \ json3.test \ - json-invalid-types.test + json-invalid-types.test \ + json-int64-min-max.test EXTRA_DIST = \ $(TESTS) \ @@ -100,7 +101,8 @@ EXTRA_DIST = \ data/uid.bplist \ data/data.bplist \ data/j1.json \ - data/j2.json + data/j2.json \ + data/int64_min_max.json TESTS_ENVIRONMENT = \ top_srcdir=$(top_srcdir) \ diff --git a/test/data/int64_min_max.json b/test/data/int64_min_max.json new file mode 100644 index 0000000..7707090 --- /dev/null +++ b/test/data/int64_min_max.json @@ -0,0 +1 @@ +{"INT64_MIN":-9223372036854775808,"INT64_MAX":9223372036854775807}
\ No newline at end of file diff --git a/test/json-int64-min-max.test b/test/json-int64-min-max.test new file mode 100755 index 0000000..f6ed731 --- /dev/null +++ b/test/json-int64-min-max.test @@ -0,0 +1,19 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +DATAOUT=$top_builddir/test/data +TESTFILE=int64_min_max.json + +if ! test -d "$DATAOUT"; then + mkdir -p $DATAOUT +fi + +export PLIST_JSON_DEBUG=1 + +echo "Converting" +$top_builddir/test/plist_jtest $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out + +echo "Comparing" +$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out |