diff options
| author | 2016-06-29 05:49:53 +0200 | |
|---|---|---|
| committer | 2016-06-29 05:49:53 +0200 | |
| commit | 02bd8acd41d1ed7891100fa0057981e98a0dbdad (patch) | |
| tree | d15490d7fa4f6d951d70d34cae166445c8983896 | |
| parent | acd226d1f71a78dd23b47a9a5c4ca8cf8068d509 (diff) | |
| download | libplist-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.
| -rw-r--r-- | test/Makefile.am | 1 | ||||
| -rw-r--r-- | test/data/signedunsigned.bplist | bin | 0 -> 113 bytes | |||
| -rw-r--r-- | test/data/signedunsigned.plist | 11 | ||||
| -rwxr-xr-x | test/signedunsigned3.test | 23 |
4 files changed, 35 insertions, 0 deletions
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 = \ | |||
| 26 | timezone2.test \ | 26 | timezone2.test \ |
| 27 | signedunsigned1.test \ | 27 | signedunsigned1.test \ |
| 28 | signedunsigned2.test \ | 28 | signedunsigned2.test \ |
| 29 | signedunsigned3.test \ | ||
| 29 | hex.test \ | 30 | hex.test \ |
| 30 | order.test \ | 31 | order.test \ |
| 31 | recursion.test \ | 32 | recursion.test \ |
diff --git a/test/data/signedunsigned.bplist b/test/data/signedunsigned.bplist new file mode 100644 index 0000000..f361063 --- /dev/null +++ b/test/data/signedunsigned.bplist | |||
| Binary files 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 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | <plist version="1.0"> | ||
| 4 | <array> | ||
| 5 | <integer>-1</integer> | ||
| 6 | <integer>18446744073709551615</integer> | ||
| 7 | <integer>9223372036854775807</integer> | ||
| 8 | <integer>-9223372036854775808</integer> | ||
| 9 | <integer>9223372036854775808</integer> | ||
| 10 | </array> | ||
| 11 | </plist> | ||
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 @@ | |||
| 1 | ## -*- sh -*- | ||
| 2 | |||
| 3 | set -e | ||
| 4 | |||
| 5 | DATASRC=$top_srcdir/test/data | ||
| 6 | TESTFILE0=signedunsigned.plist | ||
| 7 | TESTFILE1=signedunsigned.bplist | ||
| 8 | DATAIN0=$DATASRC/$TESTFILE0 | ||
| 9 | DATAIN1=$DATASRC/$TESTFILE1 | ||
| 10 | |||
| 11 | CMPFILE0=signedunsigned.bplist | ||
| 12 | CMPFILE1=signedunsigned.plist | ||
| 13 | DATACMP0=$DATASRC/$CMPFILE0 | ||
| 14 | DATACMP1=$DATASRC/$CMPFILE1 | ||
| 15 | |||
| 16 | DATAOUT0=$top_builddir/test/data/$TESTFILE0.bin | ||
| 17 | DATAOUT1=$top_builddir/test/data/$TESTFILE1.xml | ||
| 18 | |||
| 19 | $top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0 | ||
| 20 | $top_builddir/tools/plistutil -i $DATAIN1 -o $DATAOUT1 | ||
| 21 | |||
| 22 | diff $DATACMP0 $DATAOUT0 | ||
| 23 | diff $DATACMP1 $DATAOUT1 | ||
