summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-09-09 14:23:38 -0700
committerElliott Hughes <enh@google.com>2012-09-09 14:23:38 -0700
commit35e432dd3af2c56c00fc64ca340d1e615030f0a3 (patch)
tree85dcdb819a359fe558a8f9443f26156f7e08585c /tests
parent6f6dbce408598404d701f101a684908cb951e25c (diff)
downloadexpat-35e432dd3af2c56c00fc64ca340d1e615030f0a3.tar.gz
Upgrade to expat 2.1.0.
From http://www.libexpat.org/: Release 2.1.0 includes security & other bug fixes, new features, and updated build support. Security fixes * Memory leak in poolGrow (CVE-2012-1148) * Resource leak in readfilemap.c (CVE-2012-1147) * Hash DOS attack (CVE-2012-0876) * Buffer over-read and crash in big2_toUtf8 (CVE-2009-3560) * Parser crash with special UTF-8 sequences (CVE-2009-3270) New features * Added function XML_SetHashSalt that allows setting an initial value (salt) for hash calculations (part of the fix for bug 3496608). * When compiled with XML_ATTR_INFO defined, adds new API member XML_GetAttributeInfo() that allows retrieving the byte offsets for attribute names and values (patch 3446384). * Added CMake build system (bug 2990652, patch 3312568). * Added run-benchmark target to Makefile.in - relies on testdata module present in the same relative location as in the repository. Bug fixes * Harmful XML_ParserCreateNS suggestion (1742315) * CVE-2012-1147 - Resource leak in readfilemap.c (2895533) * Expat build fails on linux-amd64 with gcc version>=4.1 -O3 (1785430) * Build modifications using autoreconf instead of buildconf.sh (1983953, 2517952, 2517962, 2649838) * OBJEXT and EXEEXT support while building (2815947, 2884086) * CVE-2009-3720 - Parser crash with special UTF-8 sequences (1990430) * xmlwf should return non-zero exit status if not well-formed (2517938) * Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml (2517946) * Dangling positionPtr after error (2855609) * CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8() (2894085) * CVE-2012-1148 - Memory leak in poolGrow (2958794) * UNEXPECTED_STATE with a trailing "%" in entity value (3010819) * Unitialized memory returned from XML_Parse (3206497) * make check fails on mingw-w64 (87849) Change-Id: Ieb663fdfea82119918e245a714af533b58e0f7f5
Diffstat (limited to 'tests')
-rw-r--r--tests/README.txt5
-rw-r--r--tests/benchmark/benchmark.dsp8
-rw-r--r--tests/minicheck.h9
-rw-r--r--tests/runtests.c3
-rwxr-xr-xtests/xmltest.sh7
5 files changed, 17 insertions, 15 deletions
diff --git a/tests/README.txt b/tests/README.txt
index 33a47c34..30e1d4da 100644
--- a/tests/README.txt
+++ b/tests/README.txt
@@ -8,7 +8,6 @@ unit testing framework for C. More information on Check can be found at:
http://check.sourceforge.net/
-Expat must be built and installed before "make check" can be executed.
+Expat must be built and, depending on platform, must be installed, before "make check" can be executed.
-Since both Check and this test suite are young, it can all change in a
-later version.
+This test suite can all change in a later version.
diff --git a/tests/benchmark/benchmark.dsp b/tests/benchmark/benchmark.dsp
index 6f310d0a..a3fd9786 100644
--- a/tests/benchmark/benchmark.dsp
+++ b/tests/benchmark/benchmark.dsp
@@ -48,8 +48,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
+# ADD LINK32 libexpat.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\win32\bin\Release"
!ELSEIF "$(CFG)" == "benchmark - Win32 Debug"
@@ -71,8 +71,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libexpat.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\win32\bin\Debug"
!ENDIF
diff --git a/tests/minicheck.h b/tests/minicheck.h
index f846bead..c917c026 100644
--- a/tests/minicheck.h
+++ b/tests/minicheck.h
@@ -18,10 +18,11 @@ extern "C" {
#define CK_NORMAL 1
#define CK_VERBOSE 2
-/* Workaround for Tru64 Unix systems where the C compiler has a working
- __func__, but the C++ compiler only has a working __FUNCTION__. This
- could be fixed in configure.in, but it's not worth it right now. */
-#if defined(__osf__) && defined(__cplusplus)
+/* Workaround for Microsoft's compiler and Tru64 Unix systems where the
+ C compiler has a working __func__, but the C++ compiler only has a
+ working __FUNCTION__. This could be fixed in configure.in, but it's
+ not worth it right now. */
+#if defined (_MSC_VER) || (defined(__osf__) && defined(__cplusplus))
#define __func__ __FUNCTION__
#endif
diff --git a/tests/runtests.c b/tests/runtests.c
index 3521c086..614d6b24 100644
--- a/tests/runtests.c
+++ b/tests/runtests.c
@@ -12,6 +12,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <stdint.h>
#include "expat.h"
#include "chardata.h"
@@ -1254,7 +1255,7 @@ external_entity_handler(XML_Parser parser,
const XML_Char *systemId,
const XML_Char *publicId)
{
- long callno = 1 + (long)XML_GetUserData(parser);
+ intptr_t callno = 1 + (intptr_t)XML_GetUserData(parser);
char *text;
XML_Parser p2;
diff --git a/tests/xmltest.sh b/tests/xmltest.sh
index 725441ed..793a5cc2 100755
--- a/tests/xmltest.sh
+++ b/tests/xmltest.sh
@@ -6,7 +6,7 @@
# w3c.org xml test suite, available from
# http://www.w3.org/XML/Test/xmlts20020606.zip.
-# To run this script, first set XMLWF so that xmlwf can be
+# To run this script, first set XMLWF below so that xmlwf can be
# found, then set the output directory with OUTPUT.
# The script lists all test cases where Expat shows a discrepancy
@@ -39,7 +39,7 @@ RunXmlwfNotWF() {
$XMLWF -p "$file" > outfile || return $?
read outdata < outfile
if test "$outdata" = "" ; then
- echo "Expected well-formed: $reldir$file"
+ echo "Expected not well-formed: $reldir$file"
return 1
else
return 0
@@ -55,7 +55,7 @@ RunXmlwfWF() {
read outdata < outfile
if test "$outdata" = "" ; then
if [ -f "out/$file" ] ; then
- diff "$OUTPUT$reldir$file" "out/$file" > outfile
+ diff -u "$OUTPUT$reldir$file" "out/$file" > outfile
if [ -s outfile ] ; then
cp outfile "$OUTPUT$reldir$file.diff"
echo "Output differs: $reldir$file"
@@ -117,6 +117,7 @@ rm outfile
cd "$TS/xmlconf"
for xmldir in ibm/not-wf/P* \
+ ibm/not-wf/p28a \
ibm/not-wf/misc \
xmltest/not-wf/ext-sa \
xmltest/not-wf/not-sa \