mirror of https://github.com/AxioDL/tinyxml2.git
Test error name is non-empty for the whole range
This commit is contained in:
parent
735ce51124
commit
a1beddf486
|
@ -1964,7 +1964,9 @@ void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )
|
||||||
const char* XMLDocument::ErrorName() const
|
const char* XMLDocument::ErrorName() const
|
||||||
{
|
{
|
||||||
TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );
|
TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );
|
||||||
return _errorNames[_errorID];
|
const char* errorName = _errorNames[_errorID];
|
||||||
|
TIXMLASSERT( errorName && errorName[0] );
|
||||||
|
return errorName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLDocument::PrintError() const
|
void XMLDocument::PrintError() const
|
||||||
|
|
|
@ -1498,6 +1498,14 @@ int main( int argc, const char ** argv )
|
||||||
delete doc;
|
delete doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
XMLDocument doc;
|
||||||
|
for( int i = 0; i < XML_ERROR_COUNT; i++ ) {
|
||||||
|
doc.SetError( (XMLError)i, 0, 0 );
|
||||||
|
doc.ErrorName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------- Performance tracking --------------
|
// ----------- Performance tracking --------------
|
||||||
{
|
{
|
||||||
#if defined( _MSC_VER )
|
#if defined( _MSC_VER )
|
||||||
|
|
Loading…
Reference in New Issue