tests: Added stream exception test

git-svn-id: http://pugixml.googlecode.com/svn/trunk@611 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2010-07-22 05:09:50 +00:00
parent 04085a8875
commit 2ac60c851e

View File

@ -102,6 +102,26 @@ TEST(document_load_stream_wide)
CHECK(doc.load(iss));
CHECK_NODE(doc, STR("<node />"));
}
#ifndef PUGIXML_NO_EXCEPTIONS
TEST(document_load_stream_exceptions)
{
pugi::xml_document doc;
std::ifstream iss("tests/data/multiline.xml");
iss.exceptions(std::ios::eofbit);
try
{
doc.load(iss);
CHECK((bool)!"exception should be thrown");
}
catch (const std::ios_base::failure&)
{
CHECK(!doc.first_child());
}
}
#endif
#endif
TEST(document_load_string)