mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-23 01:52:48 +03:00
tests: Add test for issue #661
This commit is contained in:
21
testparser.c
21
testparser.c
@@ -10,6 +10,26 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static int
|
||||
testStandaloneWithEncoding(void) {
|
||||
xmlDocPtr doc;
|
||||
const char *str =
|
||||
"<?xml version=\"1.0\" standalone=\"yes\"?>\n"
|
||||
"<doc></doc>\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();
|
||||
|
Reference in New Issue
Block a user