diff options
author | Nikias Bassen | 2014-05-23 11:24:08 +0200 |
---|---|---|
committer | Nikias Bassen | 2014-05-23 11:24:08 +0200 |
commit | f7c829297aa77e095511abb9b4ffaa68bd8bb443 (patch) | |
tree | 1b304c561f603ce67499814ffc66b9e727d7163c | |
parent | 769ee9ecdadcb75f421a7ebf18a2a43a13771966 (diff) | |
download | libplist-f7c829297aa77e095511abb9b4ffaa68bd8bb443.tar.gz libplist-f7c829297aa77e095511abb9b4ffaa68bd8bb443.tar.bz2 |
test: Add test cases for integer nodes
-rw-r--r-- | test/Makefile.am | 7 | ||||
-rw-r--r-- | test/data/hex.plist | 5 | ||||
-rw-r--r-- | test/data/signed.bplist | bin | 0 -> 50 bytes | |||
-rw-r--r-- | test/data/signed.plist | 5 | ||||
-rw-r--r-- | test/data/unsigned.bplist | bin | 0 -> 58 bytes | |||
-rw-r--r-- | test/data/unsigned.plist | 5 | ||||
-rwxr-xr-x | test/hex.test | 12 | ||||
-rwxr-xr-x | test/signedunsigned1.test | 23 | ||||
-rwxr-xr-x | test/signedunsigned2.test | 23 |
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 Binary files differnew file mode 100644 index 0000000..89bf362 --- /dev/null +++ b/test/data/signed.bplist 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 Binary files differnew file mode 100644 index 0000000..2b0a807 --- /dev/null +++ b/test/data/unsigned.bplist 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 |