const std::vector<std::string> others = other.getRawLabels();
for (size_t pos = 0; ours.size() > pos && others.size() > pos; pos++) {
- if (ours.at(ours.size() - pos - 1) != others.at(others.size() - pos - 1)) {
+ const std::string& ourLabel = ours.at(ours.size() - pos - 1);
+ const std::string& otherLabel = others.at(others.size() - pos - 1);
+
+ if (!pdns_iequals(ourLabel, otherLabel)) {
break;
}
- result.prependRawLabel(ours.at(ours.size() - pos - 1));
+ result.prependRawLabel(ourLabel);
}
return result;
BOOST_CHECK_EQUAL(name2.getCommonLabels(name3), DNSName());
BOOST_CHECK_EQUAL(name3.getCommonLabels(name1), DNSName());
BOOST_CHECK_EQUAL(name3.getCommonLabels(name2), DNSName());
+
+ const DNSName name4("WWw.PowErDnS.org");
+ BOOST_CHECK_EQUAL(name3.getCommonLabels(name4), name3);
+ BOOST_CHECK_EQUAL(name4.getCommonLabels(name3), name4);
}
BOOST_AUTO_TEST_SUITE_END()