From 5791fb908a5f4e3ae39f8c4644dc7f0291f0e80f Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 1 Feb 2017 19:07:02 +0100 Subject: test: Add test cases for different bplist offset and reference sizes --- test/Makefile.am | 2 ++ test/data/dictref1byte.bplist | Bin 0 -> 50 bytes test/data/dictref2bytes.bplist | Bin 0 -> 52 bytes test/data/dictref3bytes.bplist | Bin 0 -> 54 bytes test/data/dictref4bytes.bplist | Bin 0 -> 56 bytes test/data/dictref5bytes.bplist | Bin 0 -> 58 bytes test/data/dictref6bytes.bplist | Bin 0 -> 60 bytes test/data/dictref7bytes.bplist | Bin 0 -> 62 bytes test/data/dictref8bytes.bplist | Bin 0 -> 64 bytes test/data/off1byte.bplist | Bin 0 -> 50 bytes test/data/off2bytes.bplist | Bin 0 -> 53 bytes test/data/off3bytes.bplist | Bin 0 -> 56 bytes test/data/off4bytes.bplist | Bin 0 -> 59 bytes test/data/off5bytes.bplist | Bin 0 -> 62 bytes test/data/off6bytes.bplist | Bin 0 -> 65 bytes test/data/off7bytes.bplist | Bin 0 -> 68 bytes test/data/off8bytes.bplist | Bin 0 -> 71 bytes test/data/offxml.plist | 8 ++++++++ test/offsetsize.test | 12 ++++++++++++ test/refsize.test | 12 ++++++++++++ 20 files changed, 34 insertions(+) create mode 100644 test/data/dictref1byte.bplist create mode 100644 test/data/dictref2bytes.bplist create mode 100644 test/data/dictref3bytes.bplist create mode 100644 test/data/dictref4bytes.bplist create mode 100644 test/data/dictref5bytes.bplist create mode 100644 test/data/dictref6bytes.bplist create mode 100644 test/data/dictref7bytes.bplist create mode 100644 test/data/dictref8bytes.bplist create mode 100644 test/data/off1byte.bplist create mode 100644 test/data/off2bytes.bplist create mode 100644 test/data/off3bytes.bplist create mode 100644 test/data/off4bytes.bplist create mode 100644 test/data/off5bytes.bplist create mode 100644 test/data/off6bytes.bplist create mode 100644 test/data/off7bytes.bplist create mode 100644 test/data/off8bytes.bplist create mode 100644 test/data/offxml.plist create mode 100755 test/offsetsize.test create mode 100755 test/refsize.test diff --git a/test/Makefile.am b/test/Makefile.am index aed3a58..29938f2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -36,6 +36,8 @@ TESTS = \ amp.test \ invalid_tag.test \ cdata.test \ + offsetsize.test \ + refsize.test \ malformed_dict.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 data/signed.plist data/signed.bplist data/unsigned.plist data/unsigned.bplist data/hex.plist data/order.bplist data/recursion.bplist data/entities.plist data/empty_keys.plist data/amp.plist data/invalid_tag.plist data/cdata.test data/malformed_dict.bplist diff --git a/test/data/dictref1byte.bplist b/test/data/dictref1byte.bplist new file mode 100644 index 0000000..c33d70b Binary files /dev/null and b/test/data/dictref1byte.bplist differ diff --git a/test/data/dictref2bytes.bplist b/test/data/dictref2bytes.bplist new file mode 100644 index 0000000..2a5225f Binary files /dev/null and b/test/data/dictref2bytes.bplist differ diff --git a/test/data/dictref3bytes.bplist b/test/data/dictref3bytes.bplist new file mode 100644 index 0000000..fb34258 Binary files /dev/null and b/test/data/dictref3bytes.bplist differ diff --git a/test/data/dictref4bytes.bplist b/test/data/dictref4bytes.bplist new file mode 100644 index 0000000..5845107 Binary files /dev/null and b/test/data/dictref4bytes.bplist differ diff --git a/test/data/dictref5bytes.bplist b/test/data/dictref5bytes.bplist new file mode 100644 index 0000000..6ced9de Binary files /dev/null and b/test/data/dictref5bytes.bplist differ diff --git a/test/data/dictref6bytes.bplist b/test/data/dictref6bytes.bplist new file mode 100644 index 0000000..2ed5f34 Binary files /dev/null and b/test/data/dictref6bytes.bplist differ diff --git a/test/data/dictref7bytes.bplist b/test/data/dictref7bytes.bplist new file mode 100644 index 0000000..cbb9368 Binary files /dev/null and b/test/data/dictref7bytes.bplist differ diff --git a/test/data/dictref8bytes.bplist b/test/data/dictref8bytes.bplist new file mode 100644 index 0000000..ffb4292 Binary files /dev/null and b/test/data/dictref8bytes.bplist differ diff --git a/test/data/off1byte.bplist b/test/data/off1byte.bplist new file mode 100644 index 0000000..c33d70b Binary files /dev/null and b/test/data/off1byte.bplist differ diff --git a/test/data/off2bytes.bplist b/test/data/off2bytes.bplist new file mode 100644 index 0000000..f080738 Binary files /dev/null and b/test/data/off2bytes.bplist differ diff --git a/test/data/off3bytes.bplist b/test/data/off3bytes.bplist new file mode 100644 index 0000000..a2f926b Binary files /dev/null and b/test/data/off3bytes.bplist differ diff --git a/test/data/off4bytes.bplist b/test/data/off4bytes.bplist new file mode 100644 index 0000000..35897be Binary files /dev/null and b/test/data/off4bytes.bplist differ diff --git a/test/data/off5bytes.bplist b/test/data/off5bytes.bplist new file mode 100644 index 0000000..9df03cd Binary files /dev/null and b/test/data/off5bytes.bplist differ diff --git a/test/data/off6bytes.bplist b/test/data/off6bytes.bplist new file mode 100644 index 0000000..3d78a47 Binary files /dev/null and b/test/data/off6bytes.bplist differ diff --git a/test/data/off7bytes.bplist b/test/data/off7bytes.bplist new file mode 100644 index 0000000..150c277 Binary files /dev/null and b/test/data/off7bytes.bplist differ diff --git a/test/data/off8bytes.bplist b/test/data/off8bytes.bplist new file mode 100644 index 0000000..f01114e Binary files /dev/null and b/test/data/off8bytes.bplist differ diff --git a/test/data/offxml.plist b/test/data/offxml.plist new file mode 100644 index 0000000..c3c1e10 --- /dev/null +++ b/test/data/offxml.plist @@ -0,0 +1,8 @@ + + + + + A + B + + diff --git a/test/offsetsize.test b/test/offsetsize.test new file mode 100755 index 0000000..d548d88 --- /dev/null +++ b/test/offsetsize.test @@ -0,0 +1,12 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +TESTFILES="off1byte.bplist off2bytes.bplist off3bytes.bplist off4bytes.bplist off5bytes.bplist off6bytes.bplist off7bytes.bplist off8bytes.bplist" +CMPFILE=offxml.plist + +for I in $TESTFILES; do + echo "* checking $I" + $top_builddir/test/plist_cmp $DATASRC/$I $DATASRC/$CMPFILE +done diff --git a/test/refsize.test b/test/refsize.test new file mode 100755 index 0000000..379b7fb --- /dev/null +++ b/test/refsize.test @@ -0,0 +1,12 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +TESTFILES="dictref1byte.bplist dictref2bytes.bplist dictref3bytes.bplist dictref4bytes.bplist dictref5bytes.bplist dictref6bytes.bplist dictref7bytes.bplist dictref8bytes.bplist" +CMPFILE=offxml.plist + +for I in $TESTFILES; do + echo "* checking $I" + $top_builddir/test/plist_cmp $DATASRC/$I $DATASRC/$CMPFILE +done -- cgit v1.1-32-gdbae