From f7c829297aa77e095511abb9b4ffaa68bd8bb443 Mon Sep 17 00:00:00 2001
From: Nikias Bassen
Date: Fri, 23 May 2014 11:24:08 +0200
Subject: test: Add test cases for integer nodes
---
test/Makefile.am | 7 +++++--
test/data/hex.plist | 5 +++++
test/data/signed.bplist | Bin 0 -> 50 bytes
test/data/signed.plist | 5 +++++
test/data/unsigned.bplist | Bin 0 -> 58 bytes
test/data/unsigned.plist | 5 +++++
test/hex.test | 12 ++++++++++++
test/signedunsigned1.test | 23 +++++++++++++++++++++++
test/signedunsigned2.test | 23 +++++++++++++++++++++++
9 files changed, 78 insertions(+), 2 deletions(-)
create mode 100644 test/data/hex.plist
create mode 100644 test/data/signed.bplist
create mode 100644 test/data/signed.plist
create mode 100644 test/data/unsigned.bplist
create mode 100644 test/data/unsigned.plist
create mode 100755 test/hex.test
create mode 100755 test/signedunsigned1.test
create mode 100755 test/signedunsigned2.test
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 @@
+
+
+
+0x73709551615
+
diff --git a/test/data/signed.bplist b/test/data/signed.bplist
new file mode 100644
index 0000000..89bf362
Binary files /dev/null and b/test/data/signed.bplist differ
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 @@
+
+
+
+-1
+
diff --git a/test/data/unsigned.bplist b/test/data/unsigned.bplist
new file mode 100644
index 0000000..2b0a807
Binary files /dev/null and b/test/data/unsigned.bplist differ
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 @@
+
+
+
+18446744073709551615
+
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
--
cgit v1.1-32-gdbae