Home | History | Annotate | Download | only in tinyxml

Lines Matching refs:XmlTest

29 bool XmlTest (const char* testString, const char* expected, const char* found, bool noEcho = false)
50 bool XmlTest( const char* testString, int expected, int found, bool noEcho = false )
252 XmlTest( "Output stream correct.", string( demoEnd ).c_str(),
257 XmlTest( "Root element exists.", true, ( node != 0 && node->ToElement() ) );
258 XmlTest ( "Root element value is 'ToDo'.", "ToDo", node->Value());
261 XmlTest( "First child exists & is a comment.", true, ( node != 0 && node->ToComment() ) );
263 XmlTest( "Sibling element exists & is an element.", true, ( node != 0 && node->ToElement() ) );
264 XmlTest ( "Value is 'Item'.", "Item", node->Value() );
267 XmlTest ( "First child exists.", true, ( node != 0 && node->ToText() ) );
268 XmlTest ( "Value is 'Go to the'.", "Go to the", node->Value() );
282 XmlTest( "Top level nodes, using First / Next.", 3, count );
291 XmlTest( "Top level nodes, using Last / Previous.", 3, count );
302 XmlTest( "Top level nodes, using IterateChildren.", 3, count );
312 XmlTest( "Children of the 'ToDo' element, using First / Next.",
323 XmlTest( "'Item' children of the 'ToDo' element, using First/Next.", 3, count );
332 XmlTest( "'Item' children of the 'ToDo' element, using Last/Previous.", 3, count );
341 XmlTest ( "Element parsed, value is 'Element0'.", "Element0", element0.Value() );
342 XmlTest ( "Reads attribute 'attribute0=\"foo0\"'.", "foo0", element0.Attribute( "attribute0" ));
343 XmlTest ( "Reads incorrectly formatted 'attribute1=noquotes'.", "noquotes", element0.Attribute( "attribute1" ) );
344 XmlTest ( "Read attribute with entity value '>'.", ">", element0.Attribute( "attribute2" ) );
356 XmlTest( "Error row", doc.ErrorRow(), 3 );
357 XmlTest( "Error column", doc.ErrorCol(), 17 );
397 XmlTest( "Location tracking: Declaration row", declaration->Row(), 1 );
398 XmlTest( "Location tracking: Declaration col", declaration->Column(), 5 );
399 XmlTest( "Location tracking: room row", room->Row(), 1 );
400 XmlTest( "Location tracking: room col", room->Column(), 45 );
401 XmlTest( "Location tracking: doors row", doors->Row(), 1 );
402 XmlTest( "Location tracking: doors col", doors->Column(), 51 );
403 XmlTest( "Location tracking: Comment row", comment->Row(), 2 );
404 XmlTest( "Location tracking: Comment col", comment->Column(), 3 );
405 XmlTest( "Location tracking: text row", text->Row(), 3 );
406 XmlTest( "Location tracking: text col", text->Column(), 24 );
407 XmlTest( "Location tracking: door0 row", door0->Row(), 3 );
408 XmlTest( "Location tracking: door0 col", door0->Column(), 5 );
409 XmlTest( "Location tracking: door1 row", door1->Row(), 4 );
410 XmlTest( "Location tracking: door1 col", door1->Column(), 5 );
431 XmlTest( "Location tracking: Tab 8: room row", room->Row(), 1 );
432 XmlTest( "Location tracking: Tab 8: room col", room->Column(), 49 );
433 XmlTest( "Location tracking: Tab 8: doors row", doors->Row(), 1 );
434 XmlTest( "Location tracking: Tab 8: doors col", doors->Column(), 55 );
449 XmlTest( "Query attribute: int as double", result, TIXML_SUCCESS );
450 XmlTest( "Query attribute: int as double", (int)dVal, 1 );
452 XmlTest( "Query attribute: double as double", (int)dVal, 2 );
454 XmlTest( "Query attribute: double as int", result, TIXML_SUCCESS );
455 XmlTest( "Query attribute: double as int", iVal, 2 );
457 XmlTest( "Query attribute: not a number", result, TIXML_WRONG_TYPE );
459 XmlTest( "Query attribute: does not exist", result, TIXML_NO_ATTRIBUTE );
478 XmlTest( "Stream round trip correct.", string( demoEnd ).c_str(),
484 XmlTest( "String printing correct.", string( demoEnd ).c_str(),
512 XmlTest( "UTF-8: Russian value.", (const char*)correctValue, element->Attribute( "value" ), true );
513 XmlTest( "UTF-8: Russian value row.", 4, element->Row() );
514 XmlTest( "UTF-8: Russian value column.", 5, element->Column() );
523 XmlTest( "UTF-8: Browsing russian element name.",
527 XmlTest
528 XmlTest( "UTF-8: Russian element name column.", 47, text->Column() );
531 XmlTest( "UTF-8: Declaration column.", 1, dec->Column() );
532 XmlTest( "UTF-8: Document column.", 1, doc.Column() );
558 XmlTest( "UTF-8: Verified multi-language round trip.", 1, okay );
570 XmlTest( "Legacy encoding: Verify text element.", "r\x82sum\x82", text->Value() );
587 XmlTest( "Copy/Assign: element copy #1.", "element", elementCopy.Value() );
588 XmlTest( "Copy/Assign: element copy #2.", "value", elementCopy.Attribute( "name" ) );
589 XmlTest( "Copy/Assign: element assign #1.", "element", elementAssign.Value() );
590 XmlTest( "Copy/Assign: element assign #2.", "value", elementAssign.Attribute( "name" ) );
591 XmlTest( "Copy/Assign: element assign #3.", 0, (int) elementAssign.Attribute( "foo" ) );
598 XmlTest( "Copy/Assign: comment copy.", "comment", commentCopy.Value() );
599 XmlTest( "Copy/Assign: comment assign.", "comment", commentAssign.Value() );
607 XmlTest( "Copy/Assign: unknown copy.", "[unknown]", unknownCopy.Value() );
608 XmlTest( "Copy/Assign: unknown assign.", "[unknown]", unknownAssign.Value() );
614 XmlTest( "Copy/Assign: text copy.", "TextNode", textCopy.Value() );
615 XmlTest( "Copy/Assign: text assign.", "TextNode", textAssign.Value() );
623 XmlTest( "Copy/Assign: declaration copy.", "UTF-8", decCopy.Encoding() );
624 XmlTest( "Copy/Assign: text assign.", "UTF-8", decAssign.Encoding() );
641 XmlTest( "Copy/Assign: document copy.", original.c_str(), copy.c_str(), true );
642 XmlTest( "Copy/Assign: document assign.", original.c_str(), assign.c_str(), true );
656 XmlTest ( "Condense white space OFF.", "This is \ntext",
671 XmlTest( "GetText() normal use.", "This is text", element->GetText() );
678 XmlTest( "GetText() contained element.", element->GetText() == 0, true );
687 XmlTest( "GetText() partial.", "This is ", element->GetText() );
704 XmlTest( "CDATA parse.", doc.FirstChildElement()->FirstChild()->Value(),
717 XmlTest( "CDATA stream.", doc.FirstChildElement()->FirstChild()->Value(),
725 XmlTest( "CDATA copy.", doc1.FirstChildElement()->FirstChild()->Value(),
742 XmlTest( "Test InsertBeforeChild on empty node.", ( childNode1 == parent.FirstChild() ), true );
753 XmlTest( "Test InsertAfterChild on empty node. ", ( childNode1 == parent.LastChild() ), true );
779 XmlTest( "Basic TiXmlString test. ", "Hello World!", a.c_str() );
789 //XmlTest( "Long filename. ", true, loadOkay );
809 XmlTest( "Entity transformation: read. ", expected, context, true );
823 XmlTest( "Entity transformation: write. ",
841 XmlTest( "dot in element attributes and names", doc.Error(), 0);
854 XmlTest( "Entity with one digit.", result, true );
857 XmlTest( "Entity with one digit.",
880 XmlTest( "Correct value of unknown.", "!DOCTYPE PLAY SYSTEM 'play.dtd'", unknown->Value() );
885 XmlTest( "Correct streaming of unknown.", "<!ELEMENT title (#PCDATA)>", str.c_str() );
900 XmlTest( "Comment formatting.", " Somewhat<evil> ", comment->Value() );
904 XmlTest( "Comment streaming.", "<!-- Somewhat<evil> -->", str.c_str() );
922 XmlTest( "White space kept.", " This has leading and trailing space ", text->Value() );
927 XmlTest( "White space kept.", "This has internal space", text->Value() );
932 XmlTest( "White space kept.", " This has leading, trailing, and internal space ", text->Value() );
938 XmlTest( "White space condensed.", "This has leading and trailing space", text->Value() );
943 XmlTest( "White space condensed.", "This has internal space", text->Value() );
948 XmlTest( "White space condensed.", "This has leading, trailing, and internal space", text->Value() );
958 XmlTest( "Parsing repeated attributes.", 0, (int)doc.Error() ); // not an error to tinyxml
959 XmlTest( "Parsing repeated attributes.", "blue", doc.FirstChildElement( "element" )->Attribute( "attr" ) );
968 XmlTest( "Embedded null throws error.", true, doc.Error() );
975 XmlTest( "Embedded null throws error.", true, doc.Error() );
997 XmlTest( "ISO-8859-1 Parsing.", "C?nt?nt???????", tHandle.Text()->Value() );
1005 XmlTest( "Empty document error TIXML_ERROR_DOCUMENT_EMPTY", TiXmlBase::TIXML_ERROR_DOCUMENT_EMPTY, doc.ErrorId() );
1011 XmlTest( "Empty tinyxml string compare equal", ( temp == "" ), true );
1015 XmlTest( "Empty tinyxml string compare equal", ( foo == bar ), true );
1024 XmlTest( "Test safe error return.", xml.Error(), false );
1038 XmlTest( "Low entities.", xml.FirstChildElement()->GetText(), result );