| 63 | } |
| 64 | |
| 65 | void |
| 66 | checkNodeList2(const DocNodeList &node_list) |
| 67 | { |
| 68 | REQUIRE(node_list.size() == 1); |
| 69 | DocNodeList::const_iterator list_iter = node_list.begin(), list_iter2, list_iter3; |
| 70 | REQUIRE(list_iter->type == DocNode::TYPE_CHOOSE); |
| 71 | |
| 72 | list_iter2 = list_iter->child_nodes.begin(); |
| 73 | REQUIRE(list_iter2->type == DocNode::TYPE_WHEN); |
| 74 | REQUIRE(list_iter2->attr_list.size() == 1); |
| 75 | check_node_attr(list_iter2->attr_list.front(), "test", "c1"); |
| 76 | list_iter2 = list_iter2->child_nodes.begin(); |
| 77 | REQUIRE(list_iter2->type == DocNode::TYPE_TRY); |
| 78 | list_iter2 = list_iter2->child_nodes.begin(); |
| 79 | REQUIRE(list_iter2->type == DocNode::TYPE_ATTEMPT); |
| 80 | REQUIRE(list_iter2->child_nodes.size() == 2); |
| 81 | list_iter3 = list_iter2->child_nodes.begin(); |
| 82 | REQUIRE(list_iter3->type == DocNode::TYPE_INCLUDE); |
| 83 | REQUIRE(list_iter3->data_len == 0); |
| 84 | REQUIRE(list_iter3->attr_list.size() == 1); |
| 85 | check_node_attr(list_iter3->attr_list.front(), "src", "foo1"); |
| 86 | ++list_iter3; |
| 87 | REQUIRE(list_iter3->type == DocNode::TYPE_PRE); |
| 88 | REQUIRE(list_iter3->data_len == static_cast<int>(strlen("raw1"))); |
| 89 | REQUIRE(strncmp(list_iter3->data, "raw1", list_iter3->data_len) == 0); |
| 90 | ++list_iter2; |
| 91 | REQUIRE(list_iter2->type == DocNode::TYPE_EXCEPT); |
| 92 | list_iter3 = list_iter2->child_nodes.begin(); |
| 93 | REQUIRE(list_iter3->type == DocNode::TYPE_INCLUDE); |
| 94 | REQUIRE(list_iter3->data_len == 0); |
| 95 | REQUIRE(list_iter3->attr_list.size() == 1); |
| 96 | check_node_attr(list_iter3->attr_list.front(), "src", "bar1"); |
| 97 | |
| 98 | list_iter2 = list_iter->child_nodes.begin(); |
| 99 | ++list_iter2; |
| 100 | REQUIRE(list_iter2->type == DocNode::TYPE_WHEN); |
| 101 | REQUIRE(list_iter2->attr_list.size() == 1); |
| 102 | check_node_attr(list_iter2->attr_list.front(), "test", "c2"); |
| 103 | list_iter2 = list_iter2->child_nodes.begin(); |
| 104 | REQUIRE(list_iter2->type == DocNode::TYPE_TRY); |
| 105 | list_iter2 = list_iter2->child_nodes.begin(); |
| 106 | REQUIRE(list_iter2->type == DocNode::TYPE_ATTEMPT); |
| 107 | list_iter3 = list_iter2->child_nodes.begin(); |
| 108 | REQUIRE(list_iter3->type == DocNode::TYPE_INCLUDE); |
| 109 | REQUIRE(list_iter3->data_len == 0); |
| 110 | REQUIRE(list_iter3->attr_list.size() == 1); |
| 111 | check_node_attr(list_iter3->attr_list.front(), "src", "foo2"); |
| 112 | ++list_iter2; |
| 113 | REQUIRE(list_iter2->type == DocNode::TYPE_EXCEPT); |
| 114 | REQUIRE(list_iter2->child_nodes.size() == 2); |
| 115 | list_iter3 = list_iter2->child_nodes.begin(); |
| 116 | REQUIRE(list_iter3->type == DocNode::TYPE_PRE); |
| 117 | REQUIRE(list_iter3->data_len == static_cast<int>(strlen("raw2"))); |
| 118 | REQUIRE(strncmp(list_iter3->data, "raw2", list_iter3->data_len) == 0); |
| 119 | ++list_iter3; |
| 120 | REQUIRE(list_iter3->type == DocNode::TYPE_INCLUDE); |
| 121 | REQUIRE(list_iter3->data_len == 0); |
| 122 | REQUIRE(list_iter3->attr_list.size() == 1); |
no test coverage detected