summaryrefslogtreecommitdiff
path: root/test/xml.c
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2004-10-02 19:29:59 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2004-10-02 19:29:59 +0000
commit815aa28e20edc460a309e6faee73e71cbd4736ba (patch)
treefdc505a71d237b01db6d60e4ccc161aa2b9f6b63 /test/xml.c
parent25b639dbf4f487992ad414d30101a70feade1029 (diff)
downloadneon-815aa28e20edc460a309e6faee73e71cbd4736ba.tar.gz
Import neon-0.24.3.
git-svn-id: http://svn.webdav.org/repos/projects/neon/branches/0.24.x@249 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'test/xml.c')
-rw-r--r--test/xml.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/xml.c b/test/xml.c
index 9d76215..9cea6c7 100644
--- a/test/xml.c
+++ b/test/xml.c
@@ -197,7 +197,7 @@ static int parse_match(const char *doc, const char *result, enum match_type t)
static int matches(void)
{
-#define PFX "<?xml version='1.0'?>\r\n"
+#define PFX "<?xml version='1.0' encoding='utf-8'?>\r\n"
#define E(ns, n) "<{" ns "}" n "></{" ns "}" n ">"
static const struct {
const char *in, *out;
@@ -330,6 +330,20 @@ static int fail_parse(void)
PFX "<foo xmlns:D=''/>",
PFX "<foo xmlns:='fish'/>",
PFX "<foo: xmlns:foo='bar'/>",
+#if 0
+ /* 2-byte encoding of '.': */
+ PFX "<foo>" "\x2F\xC0\xAE\x2E\x2F" "</foo>",
+ /* 3-byte encoding of '.': */
+ PFX "<foo>" "\x2F\xE0\x80\xAE\x2E\x2F" "</foo>",
+ /* 4-byte encoding of '.': */
+ PFX "<foo>" "\x2F\xF0\x80\x80\xAE\x2E\x2F" "</foo>",
+ /* 5-byte encoding of '.': */
+ PFX "<foo>" "\x2F\xF8\x80\x80\x80\xAE\x2E\x2F" "</foo>",
+ /* 6-byte encoding of '.': */
+ PFX "<foo>" "\x2F\xFC\x80\x80\x80\x80\xAE\x2E\x2F" "</foo>",
+ /* two-byte encoding of '<' must not be parsed as a '<': */
+ PFX "\xC0\xBC" "foo></foo>",
+#endif
NULL
};
int n;
@@ -424,6 +438,9 @@ static int errors(void)
ne_xml_parser *p = ne_xml_create();
const char *err;
+ ONV(strcmp(ne_xml_get_error(p), "Unknown error") != 0,
+ ("initial error string unspecified"));
+
ne_xml_set_error(p, "Fish food");
err = ne_xml_get_error(p);