Branch Coverage

third_party/modest/source/myhtml/token.c
Criterion Covered Total %
branch 94 228 41.2


line true false branch
102 0 145 if(size == 0)
107 0 145 if(token == NULL)
112 0 145 if(token->nodes_obj == NULL) {
119 0 145 if(token->attr_obj == NULL) {
151 0 144 if(token == NULL)
154 144 0 if(token->nodes_obj)
157 144 0 if(token->attr_obj)
168 0 2016 if(token_node == NULL)
186 0 386 if(attr_node == NULL)
209 0 0 if(token_node)
217 0 0 if(token_node)
235 0 0 if(length)
259 0 254 while((node->type & MyHTML_TOKEN_TYPE_DONE) == 0) {mythread_nanosleep_sleep(token->tree->myhtml->thread_stream->timespec);}
270 0 0 if(node == NULL)
276 0 0 if(new_node == NULL)
288 0 0 if(node->str.length) {
315 0 0 if(key_len) {
322 0 0 if(value_len) {
329 0 0 if(dest->attr_first == NULL) {
355 26 37 if(key_len) {
358 26 0 if(encoding == MyENCODING_UTF_8)
366 40 23 if(value_len) {
369 40 0 if(encoding == MyENCODING_UTF_8)
377 5 58 if(dest->attr_first == NULL) {
399 0 0 while (attr)
401 0 0 if(attr->key.length && myhtml_token_attr_by_name(dest, attr->key.data, attr->key.length) == NULL) {
0 0 if(attr->key.length && myhtml_token_attr_by_name(dest, attr->key.data, attr->key.length) == NULL) {
413 0 0 while (attr)
425 15 0 if(attr->key.length) {
432 15 0 if(attr->value.length) {
439 15 0 if(dest->attr_first == NULL) {
462 0 0 while (attr)
464 0 0 if(attr->key.length == key_size && attr->value.length == value_size)
0 0 if(attr->key.length == key_size && attr->value.length == value_size)
466 0 0 if((mycore_strcmp(attr->key.data, key) == 0)) {
467 0 0 if((mycore_strcmp(attr->value.data, value) == 0))
485 0 0 while (attr)
487 0 0 if(attr->key.length == key_size && attr->value.length == value_size)
0 0 if(attr->key.length == key_size && attr->value.length == value_size)
489 0 0 if((mycore_strcmp(attr->key.data, key) == 0)) {
490 0 0 if((mycore_strcasecmp(attr->value.data, value) == 0))
507 0 0 if(attr) {
522 33 3 if(attr && attr->key.length) {
33 0 if(attr && attr->key.length) {
525 2 31 if(mycore_strcmp("html", return_doctype->attr_name))
535 0 3 if(return_doctype->attr_public)
539 0 3 if(return_doctype->attr_system)
548 22 11 if(attr && attr->value.length)
22 0 if(attr && attr->value.length)
550 16 6 if(mycore_strcasecmp(attr->value.data, "PUBLIC") == 0)
555 15 1 if(attr && attr->value.length) {
14 1 if(attr && attr->value.length) {
561 9 5 if(attr && attr->value.length)
9 0 if(attr && attr->value.length)
564 0 5 if(return_doctype->attr_system)
571 0 2 if(return_doctype->attr_public)
575 0 2 if(return_doctype->attr_system)
580 6 0 else if(mycore_strncasecmp(attr->value.data, "SYSTEM", attr->value.length) == 0)
584 5 1 if(attr && attr->value.length) {
5 0 if(attr && attr->value.length) {
589 0 1 if(return_doctype->attr_public)
593 0 1 if(return_doctype->attr_system)
599 0 0 if(return_doctype->attr_public)
603 0 0 if(return_doctype->attr_system)
612 16 2 return mycore_strcmp(return_doctype->attr_public, "-//W3C//DTD HTML 4.0//EN") &&
16 0 return mycore_strcmp(return_doctype->attr_public, "-//W3C//DTD HTML 4.0//EN") &&
613 16 0 (return_doctype->attr_system == NULL || mycore_strcmp(return_doctype->attr_system, "http://www.w3.org/TR/REC-html40/strict.dtd"));
618 14 2 return mycore_strcmp(return_doctype->attr_public, "-//W3C//DTD HTML 4.01//EN") &&
14 0 return mycore_strcmp(return_doctype->attr_public, "-//W3C//DTD HTML 4.01//EN") &&
619 14 0 (return_doctype->attr_system == NULL || mycore_strcmp(return_doctype->attr_system, "http://www.w3.org/TR/html4/strict.dtd"));
624 0 14 if(return_doctype->attr_system == NULL)
633 0 12 if(return_doctype->attr_system == NULL)
642 0 36 if(return_doctype == NULL)
647 0 36 if(return_doctype->attr_name == NULL)
650 5 31 if((return_doctype->is_html ||
4 1 if((return_doctype->is_html ||
651 0 4 return_doctype->attr_public ||
652 0 0 (return_doctype->attr_system && mycore_strcmp(return_doctype->attr_system, "about:legacy-compat"))))
654 13 19 if(return_doctype->attr_public == NULL)
658 14 2 myhtml_token_doctype_check_html_4_0(return_doctype) &&
659 12 2 myhtml_token_doctype_check_html_4_01(return_doctype) &&
660 11 1 myhtml_token_doctype_check_xhtml_1_0(return_doctype) &&
674 0 0 for (size_t i = 0; i < count; i++)
679 0 0 if(attr) {
691 0 0 for (size_t i = 0; i < count; i++)
696 0 0 if(attr) {
708 0 0 if(target == NULL || dest == NULL)
0 0 if(target == NULL || dest == NULL)
714 0 0 while (target_attr && dest_attr)
0 0 while (target_attr && dest_attr)
716 0 0 if(target_attr->key.length == dest_attr->key.length &&
0 0 if(target_attr->key.length == dest_attr->key.length &&
719 0 0 if(mycore_strcmp(target_attr->key.data, dest_attr->key.data) != 0)
722 0 0 if(mycore_strcasecmp(target_attr->value.data, dest_attr->value.data) != 0)
732 0 0 if(target_attr == NULL && dest_attr == NULL)
0 0 if(target_attr == NULL && dest_attr == NULL)
742 313 38 while (attr)
744 104 209 if(name_length == attr->key.length) {
745 102 2 if(mycore_strcmp(attr->key.data, name) == 0)
757 87 51 if(node->str.data && node->str.mchar) {
87 0 if(node->str.data && node->str.mchar) {
768 31 138 while (attr)
770 31 0 if(attr->key.data && attr->key.mchar) {
31 0 if(attr->key.data && attr->key.mchar) {
774 31 0 if(attr->value.data && attr->value.mchar) {
31 0 if(attr->value.data && attr->value.mchar) {
784 53 0 if(attr)
786 15 38 if(attr->prev) {
793 41 12 if(attr->next) {
823 0 0 if(token_to->str.node_idx == tree->mchar_node_id)
825 0 0 if(cp_reverse) {
834 0 0 if(token_from->str.node_idx == tree->mchar_node_id)
836 0 0 if(cp_reverse) {
849 0 0 if(cp_reverse) {