From 9950acbecda1b1bdf567e2e5efae84103c105a2d Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 2 Jan 2017 02:29:35 +0100 Subject: test: Add some more test cases for various valid and invalid content --- test/Makefile.am | 5 ++++- test/amp.test | 14 ++++++++++++++ test/cdata.test | 12 ++++++++++++ test/data/amp.plist | 6 ++++++ test/data/cdata.plist | 6 ++++++ test/data/invalid_tag.plist | 6 ++++++ test/invalid_tag.test | 14 ++++++++++++++ 7 files changed, 62 insertions(+), 1 deletion(-) create mode 100755 test/amp.test create mode 100755 test/cdata.test create mode 100644 test/data/amp.plist create mode 100644 test/data/cdata.plist create mode 100644 test/data/invalid_tag.plist create mode 100755 test/invalid_tag.test diff --git a/test/Makefile.am b/test/Makefile.am index 6f43929..aed3a58 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -33,9 +33,12 @@ TESTS = \ recursion.test \ entities.test \ empty_keys.test \ + amp.test \ + invalid_tag.test \ + cdata.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/malformed_dict.bplist +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 TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) diff --git a/test/amp.test b/test/amp.test new file mode 100755 index 0000000..0815391 --- /dev/null +++ b/test/amp.test @@ -0,0 +1,14 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +TESTFILE=amp.plist +DATAIN0=$DATASRC/$TESTFILE +DATAOUT0=$top_builddir/test/data/$TESTFILE.out + +rm -rf $DATAOUT0 +$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0 +if test -f $DATAOUT0; then + exit 1 +fi diff --git a/test/cdata.test b/test/cdata.test new file mode 100755 index 0000000..77e7e45 --- /dev/null +++ b/test/cdata.test @@ -0,0 +1,12 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +TESTFILE=cdata.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/data/amp.plist b/test/data/amp.plist new file mode 100644 index 0000000..ce9e7ac --- /dev/null +++ b/test/data/amp.plist @@ -0,0 +1,6 @@ + + + test& + value + + diff --git a/test/data/cdata.plist b/test/data/cdata.plist new file mode 100644 index 0000000..dcd015f --- /dev/null +++ b/test/data/cdata.plist @@ -0,0 +1,6 @@ + + + + string with cdata content: ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]]> !!! + + diff --git a/test/data/invalid_tag.plist b/test/data/invalid_tag.plist new file mode 100644 index 0000000..feb770f --- /dev/null +++ b/test/data/invalid_tag.plist @@ -0,0 +1,6 @@ + + + test + value + + diff --git a/test/invalid_tag.test b/test/invalid_tag.test new file mode 100755 index 0000000..079bcdd --- /dev/null +++ b/test/invalid_tag.test @@ -0,0 +1,14 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +TESTFILE=invalid_tag.plist +DATAIN0=$DATASRC/$TESTFILE +DATAOUT0=$top_builddir/test/data/$TESTFILE.out + +rm -rf $DATAOUT0 +$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0 +if test -f $DATAOUT0; then + exit 1 +fi -- cgit v1.1-32-gdbae