summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-05-23 11:24:08 +0200
committerGravatar Nikias Bassen2014-05-23 11:24:08 +0200
commitf7c829297aa77e095511abb9b4ffaa68bd8bb443 (patch)
tree1b304c561f603ce67499814ffc66b9e727d7163c /test
parent769ee9ecdadcb75f421a7ebf18a2a43a13771966 (diff)
downloadlibplist-f7c829297aa77e095511abb9b4ffaa68bd8bb443.tar.gz
libplist-f7c829297aa77e095511abb9b4ffaa68bd8bb443.tar.bz2
test: Add test cases for integer nodes
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am7
-rw-r--r--test/data/hex.plist5
-rw-r--r--test/data/signed.bplistbin0 -> 50 bytes
-rw-r--r--test/data/signed.plist5
-rw-r--r--test/data/unsigned.bplistbin0 -> 58 bytes
-rw-r--r--test/data/unsigned.plist5
-rwxr-xr-xtest/hex.test12
-rwxr-xr-xtest/signedunsigned1.test23
-rwxr-xr-xtest/signedunsigned2.test23
9 files changed, 78 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 686947e..fee0cc5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,9 +23,12 @@ TESTS = \
hugecmp.test \
bigarraycmp.test \
timezone1.test \
- timezone2.test
+ timezone2.test \
+ signedunsigned1.test \
+ signedunsigned2.test \
+ hex.test
-EXTRA_DIST = $(TESTS) data/1.plist data/2.plist data/3.plist data/4.plist data/5.plist data/6.plist data/7.plist
+EXTRA_DIST = $(TESTS) data/1.plist data/2.plist data/3.plist data/4.plist data/5.plist data/6.plist data/7.plist data/signed.plist data/signed.bplist data/unsigned.plist data/unsigned.bplist data/hex.plist
TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir)
diff --git a/test/data/hex.plist b/test/data/hex.plist
new file mode 100644
index 0000000..ae2d2b0
--- /dev/null
+++ b/test/data/hex.plist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<integer>0x73709551615</integer>
+</plist>
diff --git a/test/data/signed.bplist b/test/data/signed.bplist
new file mode 100644
index 0000000..89bf362
--- /dev/null
+++ b/test/data/signed.bplist
Binary files differ
diff --git a/test/data/signed.plist b/test/data/signed.plist
new file mode 100644
index 0000000..c7d2991
--- /dev/null
+++ b/test/data/signed.plist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<integer>-1</integer>
+</plist>
diff --git a/test/data/unsigned.bplist b/test/data/unsigned.bplist
new file mode 100644
index 0000000..2b0a807
--- /dev/null
+++ b/test/data/unsigned.bplist
Binary files differ
diff --git a/test/data/unsigned.plist b/test/data/unsigned.plist
new file mode 100644
index 0000000..f08d1b7
--- /dev/null
+++ b/test/data/unsigned.plist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<integer>18446744073709551615</integer>
+</plist>
diff --git a/test/hex.test b/test/hex.test
new file mode 100755
index 0000000..99b88bc
--- /dev/null
+++ b/test/hex.test
@@ -0,0 +1,12 @@
+## -*- sh -*-
+
+set -e
+
+DATASRC=$top_srcdir/test/data
+TESTFILE=hex.plist
+DATAIN0=$DATASRC/$TESTFILE
+DATAOUT0=$top_builddir/test/data/$TESTFILE.bin
+
+$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0
+
+$top_builddir/test/plist_cmp $DATAIN0 $DATAOUT0
diff --git a/test/signedunsigned1.test b/test/signedunsigned1.test
new file mode 100755
index 0000000..dc752df
--- /dev/null
+++ b/test/signedunsigned1.test
@@ -0,0 +1,23 @@
+## -*- sh -*-
+
+set -e
+
+DATASRC=$top_srcdir/test/data
+TESTFILE0=signed.plist
+TESTFILE1=unsigned.plist
+DATAIN0=$DATASRC/$TESTFILE0
+DATAIN1=$DATASRC/$TESTFILE1
+
+CMPFILE0=signed.bplist
+CMPFILE1=unsigned.bplist
+DATACMP0=$DATASRC/$CMPFILE0
+DATACMP1=$DATASRC/$CMPFILE1
+
+DATAOUT0=$top_builddir/test/data/$TESTFILE0.bin
+DATAOUT1=$top_builddir/test/data/$TESTFILE1.bin
+
+$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0
+$top_builddir/tools/plistutil -i $DATAIN1 -o $DATAOUT1
+
+diff $DATACMP0 $DATAOUT0
+diff $DATACMP1 $DATAOUT1
diff --git a/test/signedunsigned2.test b/test/signedunsigned2.test
new file mode 100755
index 0000000..d51219f
--- /dev/null
+++ b/test/signedunsigned2.test
@@ -0,0 +1,23 @@
+## -*- sh -*-
+
+set -e
+
+DATASRC=$top_srcdir/test/data
+TESTFILE0=signed.bplist
+TESTFILE1=unsigned.bplist
+DATAIN0=$DATASRC/$TESTFILE0
+DATAIN1=$DATASRC/$TESTFILE1
+
+CMPFILE0=signed.plist
+CMPFILE1=unsigned.plist
+DATACMP0=$DATASRC/$CMPFILE0
+DATACMP1=$DATASRC/$CMPFILE1
+
+DATAOUT0=$top_builddir/test/data/$TESTFILE0.bin
+DATAOUT1=$top_builddir/test/data/$TESTFILE1.bin
+
+$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0
+$top_builddir/tools/plistutil -i $DATAIN1 -o $DATAOUT1
+
+diff $DATACMP0 $DATAOUT0
+diff $DATACMP1 $DATAOUT1