diff --git a/testparser.c b/testparser.c index 8f056a22..08965b50 100644 --- a/testparser.c +++ b/testparser.c @@ -10,6 +10,26 @@ #include +static int +testStandaloneWithEncoding(void) { + xmlDocPtr doc; + const char *str = + "\n" + "\n"; + int err = 0; + + xmlResetLastError(); + + doc = xmlReadDoc(BAD_CAST str, NULL, "UTF-8", 0); + if (doc == NULL) { + fprintf(stderr, "xmlReadDoc failed\n"); + err = 1; + } + xmlFreeDoc(doc); + + return err; +} + static int testUnsupportedEncoding(void) { xmlDocPtr doc; @@ -251,6 +271,7 @@ int main(void) { int err = 0; + err |= testStandaloneWithEncoding(); err |= testUnsupportedEncoding(); #ifdef LIBXML_SAX1_ENABLED err |= testBalancedChunk();