summaryrefslogtreecommitdiffstats
path: root/test/signedunsigned3.test
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-06-29 05:49:53 +0200
committerGravatar Nikias Bassen2016-06-29 05:49:53 +0200
commit02bd8acd41d1ed7891100fa0057981e98a0dbdad (patch)
treed15490d7fa4f6d951d70d34cae166445c8983896 /test/signedunsigned3.test
parentacd226d1f71a78dd23b47a9a5c4ca8cf8068d509 (diff)
downloadlibplist-02bd8acd41d1ed7891100fa0057981e98a0dbdad.tar.gz
libplist-02bd8acd41d1ed7891100fa0057981e98a0dbdad.tar.bz2
test: Add another test case for signed/unsigned (multiple) integers
Apart from testing the actual integer signed vs. unsigned value storage and conversion, this test will check that the binary plist optimization is not re-using existing values. Basically it will test the fix that was introduced with commit acd226d1f71a78dd23b47a9a5c4ca8cf8068d509.
Diffstat (limited to 'test/signedunsigned3.test')
-rwxr-xr-xtest/signedunsigned3.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/signedunsigned3.test b/test/signedunsigned3.test
new file mode 100755
index 0000000..9bada3e
--- /dev/null
+++ b/test/signedunsigned3.test
@@ -0,0 +1,23 @@
+## -*- sh -*-
+
+set -e
+
+DATASRC=$top_srcdir/test/data
+TESTFILE0=signedunsigned.plist
+TESTFILE1=signedunsigned.bplist
+DATAIN0=$DATASRC/$TESTFILE0
+DATAIN1=$DATASRC/$TESTFILE1
+
+CMPFILE0=signedunsigned.bplist
+CMPFILE1=signedunsigned.plist
+DATACMP0=$DATASRC/$CMPFILE0
+DATACMP1=$DATASRC/$CMPFILE1
+
+DATAOUT0=$top_builddir/test/data/$TESTFILE0.bin
+DATAOUT1=$top_builddir/test/data/$TESTFILE1.xml
+
+$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0
+$top_builddir/tools/plistutil -i $DATAIN1 -o $DATAOUT1
+
+diff $DATACMP0 $DATAOUT0
+diff $DATACMP1 $DATAOUT1