Branch Coverage

dom.c
Criterion Covered Total %
branch 267 480 55.6


line true false branch
27 0 72 if (tree == NULL)
29 23 49 if (tree->type == XML_ELEMENT_NODE) {
32 6 23 while (prop != NULL) {
33 0 6 if (tree->type == XML_ATTRIBUTE_NODE)
38 8 41 } else if (tree->type == XML_DOCUMENT_NODE) {
41 28 44 if (tree->children != NULL)
49 0 34 if (list == NULL)
52 64 34 while (cur != NULL) {
72 0 12 while(i != NULL && i != ns)
0 0 while(i != NULL && i != ns)
74 12 0 if( i == NULL )
86 14 5 if( ns == tree->nsDef )
92 0 5 while( i != NULL )
94 0 0 if( i->next == ns )
109 7 0 if( c == NULL )
114 0 0 while(i != NULL && i != ns)
0 0 while(i != NULL && i != ns)
116 0 0 if(i == NULL)
130 0 11 if (tree == NULL)
132 7 4 if( attr->ns != NULL )
144 1 1 if( ns != NULL && ns->href != NULL && attr->ns->href != NULL &&
1 0 if( ns != NULL && ns->href != NULL && attr->ns->href != NULL &&
148 1 0 if( domRemoveNsDef(tree, attr->ns) )
158 0 1 if( domRemoveNsDef(tree, attr->ns) )
164 1 0 if (attr->ns) {
175 44 131 if( tree->ns != NULL
176 27 17 && ((tree->type == XML_ELEMENT_NODE)
177 0 27 || (tree->type == XML_ATTRIBUTE_NODE)))
180 7 10 if( ns != NULL && ns->href != NULL && tree->ns->href != NULL &&
7 0 if( ns != NULL && ns->href != NULL && tree->ns->href != NULL &&
184 6 0 if( domRemoveNsDef(tree, tree->ns) )
194 7 4 if( domRemoveNsDef(tree, tree->ns) ) {
206 94 81 if( tree->type == XML_ELEMENT_NODE )
212 11 94 while( attr != NULL )
221 57 175 while( child != NULL )
234 7 111 if( unused != NULL )
285 874 0 if ( cur == NULL || *cur == 0 ) {
0 874 if ( cur == NULL || *cur == 0 ) {
291 2 872 if ( c & 0x80 ) {
292 0 2 if ((c & 0xe0) == 0xe0) {
293 0 0 if ((c & 0xf0) == 0xf0) {
313 2 0 if ( !IS_CHAR(val) ) {
2 0 if ( !IS_CHAR(val) ) {
2 0 if ( !IS_CHAR(val) ) {
2 0 if ( !IS_CHAR(val) ) {
0 2 if ( !IS_CHAR(val) ) {
0 0 if ( !IS_CHAR(val) ) {
0 0 if ( !IS_CHAR(val) ) {
0 0 if ( !IS_CHAR(val) ) {
0 0 if ( !IS_CHAR(val) ) {
0 0 if ( !IS_CHAR(val) ) {
0 0 if ( !IS_CHAR(val) ) {
0 2 if ( !IS_CHAR(val) ) {
350 43 0 if ( block ) {
368 8 35 if ( retCode != 0 && repair == 0 ) {
8 0 if ( retCode != 0 && repair == 0 ) {
401 45 0 if ( cur ) {
403 39 6 if( leader ) {
406 6 0 else if( followup ) {
413 6 39 if ( cur->type == XML_DOCUMENT_FRAG_NODE ) {
415 12 6 while ( c1 ){
427 45 0 if (c1 && c2 && c1!=leader) {
45 0 if (c1 && c2 && c1!=leader) {
45 0 if (c1 && c2 && c1!=leader) {
428 39 6 if ( leader ) {
432 6 0 else if ( p ) {
436 14 31 if ( followup ) {
440 31 0 else if ( p ) {
459 86 0 if ( cur == NULL || refNode == NULL) return 0;
0 86 if ( cur == NULL || refNode == NULL) return 0;
460 1 85 if (refNode==cur) return 1;
461 68 17 if ( cur->doc != refNode->doc
462 7 61 || refNode->children == NULL
463 1 6 || cur->parent == (xmlNodePtr)cur->doc
464 0 1 || cur->parent == NULL ) {
468 0 1 if( refNode->type == XML_DOCUMENT_NODE ) {
473 3 0 while ( helper && (xmlDocPtr) helper != cur->doc ) {
2 1 while ( helper && (xmlDocPtr) helper != cur->doc ) {
474 0 2 if( helper == refNode ) {
486 83 0 if ( !refNode || !cur ) {
0 83 if ( !refNode || !cur ) {
489 2 81 if (cur->type == XML_ATTRIBUTE_NODE) {
490 2 0 switch ( refNode->type ){
501 0 81 switch ( refNode->type ){
510 1 80 if ( domIsParent( cur, refNode ) ) {
520 12 70 if ( cur->type == XML_DOCUMENT_NODE ) {
521 1 11 switch ( refNode->type ) {
540 106 0 if ( node == NULL
541 95 11 || ( node->prev == NULL
542 81 14 && node->next == NULL
543 11 70 && node->parent == NULL ) ) {
547 11 84 if (node->type == XML_DTD_NODE) {
553 11 73 if ( node->prev != NULL ) {
557 12 72 if ( node->next != NULL ) {
561 84 0 if ( node->parent != NULL ) {
562 72 12 if ( node == node->parent->last ) {
566 73 11 if ( node == node->parent->children ) {
580 23 4 if ( move ) {
585 0 4 if ( node->type == XML_DTD_NODE ) {
595 27 0 if ( node && node->doc != doc ) {
27 0 if ( node && node->doc != doc ) {
597 22 5 if (PmmIsPSVITainted(node->doc))
22 0 if (PmmIsPSVITainted(node->doc))
0 22 if (PmmIsPSVITainted(node->doc))
598 0 0 PmmInvalidatePSVI(doc);
0 0 PmmInvalidatePSVI(doc);
602 19 8 if ( reconcileNS && doc && return_node
18 1 if ( reconcileNS && doc && return_node
18 0 if ( reconcileNS && doc && return_node
603 18 0 && return_node->type != XML_ENTITY_REF_NODE ) {
624 0 253 if ( node == NULL ) {
667 33 125 if ( node->ns != NULL ) {
684 21 232 if ( prefix != NULL ) {
714 0 61 if ( self == NULL ) {
724 56 4 if ( newChild->doc == self->doc ){
733 25 35 if ( self->children != NULL ) {
734 2 23 if (newChild->type == XML_DOCUMENT_FRAG_NODE )
738 2 33 else if (newChild->type == XML_DOCUMENT_FRAG_NODE ) {
743 1 2 while ( c1 ){
756 3 57 if ( fragment ) {
759 5 3 while ( fragment ) {
764 56 1 else if ( newChild->type != XML_ENTITY_REF_NODE ) {
773 17 0 if ( self == NULL || old == NULL ) {
0 17 if ( self == NULL || old == NULL ) {
776 17 0 if ( old->type == XML_ATTRIBUTE_NODE
777 0 17 || old->type == XML_NAMESPACE_DECL ) {
780 1 16 if ( self != old->parent ) {
786 15 1 if ( old->type == XML_ELEMENT_NODE ) {
797 0 9 if ( self== NULL )
800 0 9 if ( new == old )
803 0 9 if ( new == NULL ) {
808 0 9 if ( old == NULL ) {
819 3 6 if ( new->doc == self->doc ) {
827 5 4 if( old == self->children && old == self->last ) {
2 3 if( old == self->children && old == self->last ) {
831 1 6 else if ( new->type == XML_DOCUMENT_FRAG_NODE
832 0 1 && new->children == NULL ) {
842 0 9 if ( fragment ) {
843 0 0 while ( fragment && fragment != fragment_next ) {
0 0 while ( fragment && fragment != fragment_next ) {
847 9 0 } else if ( new->type != XML_ENTITY_REF_NODE ) {
860 0 15 if ( refChild == newChild ) {
864 15 0 if ( self == NULL || newChild == NULL ) {
0 15 if ( self == NULL || newChild == NULL ) {
868 10 5 if ( refChild != NULL ) {
869 10 0 if ( refChild->parent != self
870 3 7 || ( newChild->type == XML_DOCUMENT_FRAG_NODE
871 0 3 && newChild->children == NULL ) ) {
878 2 13 if ( self->children == NULL ) {
888 8 4 if ( self->doc == newChild->doc ){
895 3 9 if ( newChild->type == XML_DOCUMENT_FRAG_NODE ) {
898 3 9 if ( refChild == NULL ) {
905 3 9 if ( fragment ) {
907 9 0 while ( fragment && fragment != refChild ) {
6 3 while ( fragment && fragment != refChild ) {
911 9 0 } else if ( newChild->type != XML_ENTITY_REF_NODE ) {
925 2 4 if ( refChild == NULL ) {
935 0 0 if ( oldNode == NULL
936 0 0 || newNode == NULL ) {
941 0 0 if ( oldNode->type == XML_ATTRIBUTE_NODE
942 0 0 || newNode->type == XML_ATTRIBUTE_NODE
943 0 0 || newNode->type == XML_DOCUMENT_NODE
944 0 0 || domIsParent( newNode, oldNode ) ) {
957 0 0 if ( oldNode->_private == NULL ) {
964 0 0 if ( newNode->type == XML_DOCUMENT_FRAG_NODE ) {
967 0 0 if( prev == NULL && next == NULL ) {
0 0 if( prev == NULL && next == NULL ) {
975 0 0 if ( fragment ) {
976 0 0 while ( fragment && fragment != next ) {
0 0 while ( fragment && fragment != next ) {
980 0 0 } else if ( newNode->type != XML_ENTITY_REF_NODE ) {
990 192 0 if( n != NULL ) {
991 190 2 switch ( n->type ) {
1004 189 1 if ( n->type != XML_ENTITY_DECL ) {
1008 1 0 if ( n->content != NULL ) {
1012 0 0 else if ( n->children != NULL ) {
1016 0 0 while (cnode) {
1020 0 0 if ( buffer->content != NULL ) {
1022 0 0 if ( retval != NULL ) {
1041 0 60 if ( n == NULL )
1043 0 60 if ( val == NULL ){
1047 1 59 if( n->type == XML_ATTRIBUTE_NODE ){
1049 1 0 if ( n->children != NULL ) {
1069 0 0 if ( n != NULL && name != NULL ) {
0 0 if ( n != NULL && name != NULL ) {
1071 0 0 while ( cld != NULL ) {
1072 0 0 if ( xmlStrcmp( name, cld->name ) == 0 ){
1073 0 0 if ( rv == NULL ) {
1092 0 0 if ( nsURI == NULL ) {
1096 0 0 if ( n != NULL && name != NULL ) {
0 0 if ( n != NULL && name != NULL ) {
1098 0 0 while ( cld != NULL ) {
1099 0 0 if ( xmlStrcmp( name, cld->name ) == 0
1100 0 0 && cld->ns != NULL
1101 0 0 && xmlStrcmp( nsURI, cld->ns->href ) == 0 ){
1102 0 0 if ( rv == NULL ) {
1120 0 0 if (elem != NULL) {
1124 0 0 if (ns == NULL) {
1129 0 0 if (!xmlStrEqual(href, ns->href)) {
1143 66 0 if ( qname == NULL || node == NULL )
0 66 if ( qname == NULL || node == NULL )
1148 30 36 if ( ret == NULL ) {
1150 16 14 if ( localname != NULL ) {
1152 15 1 if ( ns != NULL ) {
1156 16 0 if ( prefix != NULL) {
1162 51 15 if (ret && ret->type != XML_ATTRIBUTE_NODE) {
8 43 if (ret && ret->type != XML_ATTRIBUTE_NODE) {
1172 0 0 if ( node == NULL || attr == NULL ) {
0 0 if ( node == NULL || attr == NULL ) {
1175 0 0 if ( attr != NULL && attr->type != XML_ATTRIBUTE_NODE )
0 0 if ( attr != NULL && attr->type != XML_ATTRIBUTE_NODE )
1177 0 0 if ( node == attr->parent ) {
1180 0 0 if ( attr->doc != node->doc ){
1188 0 0 if ( attr != NULL ) {
1189 0 0 if (node->properties == NULL) {
1194 0 0 while (prev->next != NULL) prev = prev->next;
1209 24 14 while (children != NULL) {
1236 9 16 while ( nodelist ){
1237 0 9 if ( domNodeNormalize( nodelist ) == 0 )
1249 0 12 if ( node == NULL )
1254 5 3 while ( node->next
1255 5 0 && node->next->type == XML_TEXT_NODE ) {
1263 0 5 if ( !next->_private )
1284 3 0 if ((node == NULL) || (node->type != XML_ELEMENT_NODE)) return(0);
0 3 if ((node == NULL) || (node->type != XML_ELEMENT_NODE)) return(0);
1285 4 1 while (node != NULL) {
1286 2 2 if (node->ns == ns)
1289 1 4 while (attr != NULL) {
1290 1 0 if (attr->ns == ns)
1297 1 3 if (node->children != NULL && node->type != XML_ENTITY_REF_NODE) {
1 0 if (node->children != NULL && node->type != XML_ENTITY_REF_NODE) {
1300 1 2 } else if ((node != tree) && (node->next != NULL)) {
0 1 } else if ((node != tree) && (node->next != NULL)) {
1303 1 2 } else if (node != tree) {
1305 1 1 while (node != tree) {
1306 1 0 if (node->parent != NULL)
1308 0 1 if ((node != tree) && (node->next != NULL)) {
0 0 if ((node != tree) && (node->next != NULL)) {
1312 0 1 if (node->parent == NULL) {
1318 1 0 if (node == tree)