diff options
| -rw-r--r-- | libcnary/Makefile.am | 2 | ||||
| -rw-r--r-- | src/Makefile.am | 6 | ||||
| -rw-r--r-- | test/Makefile.am | 6 | ||||
| -rwxr-xr-x | test/bigarray.test | 15 | ||||
| -rwxr-xr-x | test/bigarraycmp.test | 13 | ||||
| -rwxr-xr-x | test/empty.test | 15 | ||||
| -rwxr-xr-x | test/emptycmp.test | 13 | ||||
| -rwxr-xr-x | test/huge.test | 15 | ||||
| -rwxr-xr-x | test/hugecmp.test | 13 | ||||
| -rwxr-xr-x | test/large.test | 15 | ||||
| -rwxr-xr-x | test/largecmp.test | 13 | ||||
| -rwxr-xr-x | test/medium.test | 15 | ||||
| -rwxr-xr-x | test/mediumcmp.test | 13 | ||||
| -rw-r--r-- | test/plist_test.c | 6 | ||||
| -rwxr-xr-x | test/small.test | 15 | ||||
| -rwxr-xr-x | test/smallcmp.test | 13 |
16 files changed, 79 insertions, 109 deletions
diff --git a/libcnary/Makefile.am b/libcnary/Makefile.am index ef61c31..bba9ada 100644 --- a/libcnary/Makefile.am +++ b/libcnary/Makefile.am | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | AM_CFLAGS = $(GLOBAL_CFLAGS) -Iinclude | 1 | AM_CFLAGS = $(GLOBAL_CFLAGS) -I$(top_srcdir)/libcnary/include |
| 2 | AM_LDFLAGS = | 2 | AM_LDFLAGS = |
| 3 | 3 | ||
| 4 | noinst_LTLIBRARIES = libcnary.la | 4 | noinst_LTLIBRARIES = libcnary.la |
diff --git a/src/Makefile.am b/src/Makefile.am index 16cf655..cbb9b87 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
| @@ -4,14 +4,14 @@ AM_CFLAGS = $(GLOBAL_CFLAGS) $(libxml2_CFLAGS) | |||
| 4 | AM_LDFLAGS = $(libxml2_LIBS) | 4 | AM_LDFLAGS = $(libxml2_LIBS) |
| 5 | 5 | ||
| 6 | lib_LTLIBRARIES = libplist.la libplist++.la | 6 | lib_LTLIBRARIES = libplist.la libplist++.la |
| 7 | libplist_la_LIBADD = $(top_srcdir)/libcnary/libcnary.la | 7 | libplist_la_LIBADD = $(top_builddir)/libcnary/libcnary.la |
| 8 | libplist_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPLIST_SO_VERSION) -no-undefined | 8 | libplist_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPLIST_SO_VERSION) -no-undefined |
| 9 | libplist_la_SOURCES = base64.c base64.h \ | 9 | libplist_la_SOURCES = base64.c base64.h \ |
| 10 | bytearray.c bytearray.h \ | 10 | bytearray.c bytearray.h \ |
| 11 | hashtable.c hashtable.h \ | 11 | hashtable.c hashtable.h \ |
| 12 | ptrarray.c ptrarray.h \ | 12 | ptrarray.c ptrarray.h \ |
| 13 | xplist.c xplist.h \ | 13 | xplist.c \ |
| 14 | bplist.c bplist.h \ | 14 | bplist.c \ |
| 15 | plist.c plist.h \ | 15 | plist.c plist.h \ |
| 16 | common.h | 16 | common.h |
| 17 | 17 | ||
diff --git a/test/Makefile.am b/test/Makefile.am index 837c1dd..d508380 100644 --- a/test/Makefile.am +++ b/test/Makefile.am | |||
| @@ -23,3 +23,9 @@ TESTS = \ | |||
| 23 | hugecmp.test \ | 23 | hugecmp.test \ |
| 24 | bigarraycmp.test | 24 | bigarraycmp.test |
| 25 | 25 | ||
| 26 | EXTRA_DIST = $(TESTS) data/1.plist data/2.plist data/3.plist data/4.plist data/5.plist data/6.plist | ||
| 27 | |||
| 28 | TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) | ||
| 29 | |||
| 30 | clean-local: | ||
| 31 | rm -f $(top_builddir)/test/data/*.out | ||
diff --git a/test/bigarray.test b/test/bigarray.test index fa27e69..27f8098 100755 --- a/test/bigarray.test +++ b/test/bigarray.test | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=6.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | 6 | ||
| 11 | $srcdir/plist_test $srcdir/data/6.plist | 7 | if ! test -d "$DATAOUT"; then |
| 8 | mkdir -p $DATAOUT | ||
| 9 | fi | ||
| 12 | 10 | ||
| 11 | $top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/bigarraycmp.test b/test/bigarraycmp.test index f95266e..1c11336 100755 --- a/test/bigarraycmp.test +++ b/test/bigarraycmp.test | |||
| @@ -1,12 +1,7 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=6.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | $srcdir/plist_cmp $srcdir/data/6.plist $srcdir/data/6.plist.out | ||
| 12 | 6 | ||
| 7 | $top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/empty.test b/test/empty.test index 2a036a3..d092ee3 100755 --- a/test/empty.test +++ b/test/empty.test | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=1.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | 6 | ||
| 11 | $srcdir/plist_test $srcdir/data/1.plist | 7 | if ! test -d "$DATAOUT"; then |
| 8 | mkdir -p $DATAOUT | ||
| 9 | fi | ||
| 12 | 10 | ||
| 11 | $top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/emptycmp.test b/test/emptycmp.test index 9fcd685..2496866 100755 --- a/test/emptycmp.test +++ b/test/emptycmp.test | |||
| @@ -1,12 +1,7 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=1.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | $srcdir/plist_cmp $srcdir/data/1.plist $srcdir/data/1.plist.out | ||
| 12 | 6 | ||
| 7 | $top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/huge.test b/test/huge.test index a079d38..f4ea9bf 100755 --- a/test/huge.test +++ b/test/huge.test | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=5.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | 6 | ||
| 11 | $srcdir/plist_test $srcdir/data/5.plist | 7 | if ! test -d "$DATAOUT"; then |
| 8 | mkdir -p $DATAOUT | ||
| 9 | fi | ||
| 12 | 10 | ||
| 11 | $top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/hugecmp.test b/test/hugecmp.test index 618966d..dfdff52 100755 --- a/test/hugecmp.test +++ b/test/hugecmp.test | |||
| @@ -1,12 +1,7 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=5.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | $srcdir/plist_cmp $srcdir/data/5.plist $srcdir/data/5.plist.out | ||
| 12 | 6 | ||
| 7 | $top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/large.test b/test/large.test index 8034019..dfe05d0 100755 --- a/test/large.test +++ b/test/large.test | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=4.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | 6 | ||
| 11 | $srcdir/plist_test $srcdir/data/4.plist | 7 | if ! test -d "$DATAOUT"; then |
| 8 | mkdir -p $DATAOUT | ||
| 9 | fi | ||
| 12 | 10 | ||
| 11 | $top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/largecmp.test b/test/largecmp.test index 87a7e64..922be36 100755 --- a/test/largecmp.test +++ b/test/largecmp.test | |||
| @@ -1,12 +1,7 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=4.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | $srcdir/plist_cmp $srcdir/data/4.plist $srcdir/data/4.plist.out | ||
| 12 | 6 | ||
| 7 | $top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/medium.test b/test/medium.test index 231bb80..6740599 100755 --- a/test/medium.test +++ b/test/medium.test | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=3.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | 6 | ||
| 11 | $srcdir/plist_test $srcdir/data/3.plist | 7 | if ! test -d "$DATAOUT"; then |
| 8 | mkdir -p $DATAOUT | ||
| 9 | fi | ||
| 12 | 10 | ||
| 11 | $top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/mediumcmp.test b/test/mediumcmp.test index 33802ef..9eff0da 100755 --- a/test/mediumcmp.test +++ b/test/mediumcmp.test | |||
| @@ -1,12 +1,7 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=3.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | $srcdir/plist_cmp $srcdir/data/3.plist $srcdir/data/3.plist.out | ||
| 12 | 6 | ||
| 7 | $top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/plist_test.c b/test/plist_test.c index 17be11a..b498e1d 100644 --- a/test/plist_test.c +++ b/test/plist_test.c | |||
| @@ -44,14 +44,16 @@ int main(int argc, char *argv[]) | |||
| 44 | uint32_t size_out = 0; | 44 | uint32_t size_out = 0; |
| 45 | uint32_t size_out2 = 0; | 45 | uint32_t size_out2 = 0; |
| 46 | char *file_in = NULL; | 46 | char *file_in = NULL; |
| 47 | char *file_out = NULL; | ||
| 47 | struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); | 48 | struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); |
| 48 | if (argc!= 2) | 49 | if (argc != 3) |
| 49 | { | 50 | { |
| 50 | printf("Wrong input\n"); | 51 | printf("Wrong input\n"); |
| 51 | return 1; | 52 | return 1; |
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | file_in = argv[1]; | 55 | file_in = argv[1]; |
| 56 | file_out = argv[2]; | ||
| 55 | //read input file | 57 | //read input file |
| 56 | iplist = fopen(file_in, "rb"); | 58 | iplist = fopen(file_in, "rb"); |
| 57 | 59 | ||
| @@ -108,8 +110,6 @@ int main(int argc, char *argv[]) | |||
| 108 | if (plist_xml2) | 110 | if (plist_xml2) |
| 109 | { | 111 | { |
| 110 | FILE *oplist = NULL; | 112 | FILE *oplist = NULL; |
| 111 | char file_out[512]; | ||
| 112 | sprintf(file_out, "%s.out", file_in); | ||
| 113 | oplist = fopen(file_out, "wb"); | 113 | oplist = fopen(file_out, "wb"); |
| 114 | fwrite(plist_xml2, size_out2, sizeof(char), oplist); | 114 | fwrite(plist_xml2, size_out2, sizeof(char), oplist); |
| 115 | fclose(oplist); | 115 | fclose(oplist); |
diff --git a/test/small.test b/test/small.test index 544f374..d84782a 100755 --- a/test/small.test +++ b/test/small.test | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=2.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | 6 | ||
| 11 | $srcdir/plist_test $srcdir/data/2.plist | 7 | if ! test -d "$DATAOUT"; then |
| 8 | mkdir -p $DATAOUT | ||
| 9 | fi | ||
| 12 | 10 | ||
| 11 | $top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
diff --git a/test/smallcmp.test b/test/smallcmp.test index fb10787..461a8e6 100755 --- a/test/smallcmp.test +++ b/test/smallcmp.test | |||
| @@ -1,12 +1,7 @@ | |||
| 1 | ## -*- sh -*- | 1 | ## -*- sh -*- |
| 2 | 2 | ||
| 3 | # Common definitions | 3 | DATASRC=$top_srcdir/test/data |
| 4 | if test -z "$srcdir"; then | 4 | DATAOUT=$top_builddir/test/data |
| 5 | srcdir=echo "$0" | sed 's,[^/]*$,,' | 5 | TESTFILE=2.plist |
| 6 | test "$srcdir" = "$0" && srcdir=. | ||
| 7 | test -z "$srcdir" && srcdir=. | ||
| 8 | test "${VERBOSE+set}" != set && VERBOSE=1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | $srcdir/plist_cmp $srcdir/data/2.plist $srcdir/data/2.plist.out | ||
| 12 | 6 | ||
| 7 | $top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out | ||
