summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-02-07 09:36:16 +0100
committerGravatar Nikias Bassen2022-02-07 09:36:16 +0100
commitb8e9fedc5f1694164707c810dd9dae3f6468edb6 (patch)
tree5e84bba02328f44e8a51a5d9a4f2a91373adc772 /test
parent2727078f8f2d94cd03344a3c83672b543d726b39 (diff)
downloadlibplist-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.am6
-rw-r--r--test/data/int64_min_max.json1
-rwxr-xr-xtest/json-int64-min-max.test19
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