| 35 | using namespace EsiLib; |
| 36 | |
| 37 | void |
| 38 | checkAttributes(const char *check_id, const AttributeList &attr_list, const char *attr_info[]) |
| 39 | { |
| 40 | cout << check_id << ": checking attributes" << endl; |
| 41 | AttributeList::const_iterator iter = attr_list.begin(); |
| 42 | for (int i = 0; attr_info[i]; i += 2, ++iter) { |
| 43 | REQUIRE(iter->name_len == static_cast<int>(strlen(attr_info[i]))); |
| 44 | REQUIRE(strncmp(iter->name, attr_info[i], iter->name_len) == 0); |
| 45 | REQUIRE(iter->value_len == static_cast<int>(strlen(attr_info[i + 1]))); |
| 46 | REQUIRE(strncmp(iter->value, attr_info[i + 1], iter->value_len) == 0); |
| 47 | } |
| 48 | REQUIRE(iter == attr_list.end()); |
| 49 | } |
| 50 | |
| 51 | TEST_CASE("esi utils test") |
| 52 | { |
no test coverage detected