Various test compilation fixes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@414 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
4eccdbb8dc
commit
157f720e12
@ -1853,7 +1853,6 @@ namespace
|
|||||||
{
|
{
|
||||||
// load into registers
|
// load into registers
|
||||||
char_t* s = ref_s;
|
char_t* s = ref_s;
|
||||||
char_t ch = 0;
|
|
||||||
|
|
||||||
// parse node contents, starting with exclamation mark
|
// parse node contents, starting with exclamation mark
|
||||||
++s;
|
++s;
|
||||||
@ -1921,7 +1920,7 @@ namespace
|
|||||||
SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>'));
|
SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>'));
|
||||||
CHECK_ERROR(status_bad_cdata, s);
|
CHECK_ERROR(status_bad_cdata, s);
|
||||||
|
|
||||||
ENDSEG(); // Zero-terminate this segment.
|
*s++ = 0; // Zero-terminate this segment.
|
||||||
}
|
}
|
||||||
|
|
||||||
POPNODE(); // Pop since this is a standalone.
|
POPNODE(); // Pop since this is a standalone.
|
||||||
|
|||||||
@ -2,30 +2,30 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
bool test_doctype_wf(const std::basic_string<char_t>& decl)
|
static bool test_doctype_wf(const std::basic_string<char_t>& decl)
|
||||||
{
|
{
|
||||||
xml_document doc;
|
xml_document doc;
|
||||||
|
|
||||||
// standalone
|
// standalone
|
||||||
if (!doc.load(decl.c_str()) || doc.first_child()) return false;
|
if (!doc.load(decl.c_str()) || (bool)doc.first_child()) return false;
|
||||||
|
|
||||||
// pcdata pre/postfix
|
// pcdata pre/postfix
|
||||||
if (!doc.load(("a" + decl).c_str()) || doc.first_child()) return false;
|
if (!doc.load((STR("a") + decl).c_str()) || (bool)doc.first_child()) return false;
|
||||||
if (!doc.load((decl + "b").c_str()) || doc.first_child()) return false;
|
if (!doc.load((decl + STR("b")).c_str()) || (bool)doc.first_child()) return false;
|
||||||
if (!doc.load(("a" + decl + "b").c_str()) || doc.first_child()) return false;
|
if (!doc.load((STR("a") + decl + STR("b")).c_str()) || (bool)doc.first_child()) return false;
|
||||||
|
|
||||||
// node pre/postfix
|
// node pre/postfix
|
||||||
if (!doc.load(("<nodea/>" + decl).c_str()) || !test_node(doc, STR("<nodea />"), STR(""), format_raw)) return false;
|
if (!doc.load((STR("<nodea/>") + decl).c_str()) || !test_node(doc, STR("<nodea />"), STR(""), format_raw)) return false;
|
||||||
if (!doc.load((decl + "<nodeb/>").c_str()) || !test_node(doc, STR("<nodeb />"), STR(""), format_raw)) return false;
|
if (!doc.load((decl + STR("<nodeb/>")).c_str()) || !test_node(doc, STR("<nodeb />"), STR(""), format_raw)) return false;
|
||||||
if (!doc.load(("<nodea/>" + decl + "<nodeb/>").c_str()) || !test_node(doc, STR("<nodea /><nodeb />"), STR(""), format_raw)) return false;
|
if (!doc.load((STR("<nodea/>") + decl + STR("<nodeb/>")).c_str()) || !test_node(doc, STR("<nodea /><nodeb />"), STR(""), format_raw)) return false;
|
||||||
|
|
||||||
// wrap in node to check that doctype is parsed fully (does not leave any "pcdata")
|
// wrap in node to check that doctype is parsed fully (does not leave any "pcdata")
|
||||||
if (!doc.load(("<node>" + decl + "</node>").c_str()) || !test_node(doc, STR("<node />"), STR(""), format_raw)) return false;
|
if (!doc.load((STR("<node>") + decl + STR("</node>")).c_str()) || !test_node(doc, STR("<node />"), STR(""), format_raw)) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool test_doctype_nwf(const std::basic_string<char_t>& decl)
|
static bool test_doctype_nwf(const std::basic_string<char_t>& decl)
|
||||||
{
|
{
|
||||||
xml_document doc;
|
xml_document doc;
|
||||||
|
|
||||||
@ -33,10 +33,10 @@ bool test_doctype_nwf(const std::basic_string<char_t>& decl)
|
|||||||
if (doc.load(decl.c_str()).status != status_bad_doctype) return false;
|
if (doc.load(decl.c_str()).status != status_bad_doctype) return false;
|
||||||
|
|
||||||
// pcdata postfix
|
// pcdata postfix
|
||||||
if (doc.load((decl + "b").c_str()).status != status_bad_doctype) return false;
|
if (doc.load((decl + STR("b")).c_str()).status != status_bad_doctype) return false;
|
||||||
|
|
||||||
// node postfix
|
// node postfix
|
||||||
if (doc.load((decl + "<nodeb/>").c_str()).status != status_bad_doctype) return false;
|
if (doc.load((decl + STR("<nodeb/>")).c_str()).status != status_bad_doctype) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user