From 02bd8acd41d1ed7891100fa0057981e98a0dbdad Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 29 Jun 2016 05:49:53 +0200 Subject: 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. --- test/Makefile.am | 1 + test/data/signedunsigned.bplist | Bin 0 -> 113 bytes test/data/signedunsigned.plist | 11 +++++++++++ test/signedunsigned3.test | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 test/data/signedunsigned.bplist create mode 100644 test/data/signedunsigned.plist create mode 100755 test/signedunsigned3.test diff --git a/test/Makefile.am b/test/Makefile.am index 1f084db..522c499 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -26,6 +26,7 @@ TESTS = \ timezone2.test \ signedunsigned1.test \ signedunsigned2.test \ + signedunsigned3.test \ hex.test \ order.test \ recursion.test \ diff --git a/test/data/signedunsigned.bplist b/test/data/signedunsigned.bplist new file mode 100644 index 0000000..f361063 Binary files /dev/null and b/test/data/signedunsigned.bplist differ diff --git a/test/data/signedunsigned.plist b/test/data/signedunsigned.plist new file mode 100644 index 0000000..2942529 --- /dev/null +++ b/test/data/signedunsigned.plist @@ -0,0 +1,11 @@ + + + + + -1 + 18446744073709551615 + 9223372036854775807 + -9223372036854775808 + 9223372036854775808 + + 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 -- cgit v1.1-32-gdbae