diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2004-10-02 19:29:59 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2004-10-02 19:29:59 +0000 |
commit | 815aa28e20edc460a309e6faee73e71cbd4736ba (patch) | |
tree | fdc505a71d237b01db6d60e4ccc161aa2b9f6b63 /test/xml.c | |
parent | 25b639dbf4f487992ad414d30101a70feade1029 (diff) | |
download | neon-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.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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); |