dense_hash_map: minor changes + test coverage

This commit is contained in:
Michele Caini
2021-10-30 13:44:00 +02:00
parent 46598fde32
commit ed2012a36c
2 changed files with 5 additions and 6 deletions

View File

@@ -745,7 +745,7 @@ public:
/**
* @brief Finds an element with a key that compares _equivalent_ to a given
* value.
* @tparam Other Type of the key value of the element to search for.
* @tparam Other Type of the key value of an element to search for.
* @param key Key value of an element to search for.
* @return An iterator to an element with the given key. If no such element
* is found, a past-the-end iterator is returned.
@@ -775,7 +775,7 @@ public:
/**
* @brief Checks if the container contains an element with a key that
* compares _equivalent_ to a given value.
* @tparam Other Type of the key value of the element to search for.
* @tparam Other Type of the key value of an element to search for.
* @param key Key value of an element to search for.
* @return True if there is such an element, false otherwise.
*/

View File

@@ -256,7 +256,6 @@ TEST(DenseHashMap, ConstIterator) {
ASSERT_EQ(cbegin[0u].first, map.cbegin()->first);
ASSERT_EQ(cbegin[0u].second, (*map.cbegin()).second);
ASSERT_EQ(cbegin[0u].second, (*map.cbegin()).second);
ASSERT_LT(cbegin, cend);
ASSERT_LE(cbegin, map.cbegin());
@@ -278,7 +277,7 @@ TEST(DenseHashMap, IteratorConversion) {
ASSERT_EQ(it->first, 3);
ASSERT_EQ((*it).second, 42);
ASSERT_EQ(it->first, cit->first);
ASSERT_EQ((*it).second, (*it).second);
ASSERT_EQ((*it).second, (*cit).second);
ASSERT_EQ(it - cit, 0);
ASSERT_EQ(cit - it, 0);
@@ -767,7 +766,7 @@ TEST(DenseHashMap, EraseFromBucket) {
ASSERT_EQ(map.size(), 0u);
for(std::size_t next{}; next < 4u; ++next) {
ASSERT_TRUE(map.emplace(2u * minimum_bucket_count * next, 2u * 2u * minimum_bucket_count * next).second);
ASSERT_TRUE(map.emplace(2u * minimum_bucket_count * next, 2u * minimum_bucket_count * next).second);
ASSERT_TRUE(map.emplace(2u * minimum_bucket_count * next + 2u, 2u * minimum_bucket_count * next + 2u).second);
ASSERT_TRUE(map.emplace(2u * minimum_bucket_count * (next + 1u) - 1u, 2u * minimum_bucket_count * (next + 1u) - 1u).second);
}
@@ -960,7 +959,7 @@ TEST(DenseHashMap, LocalIteratorConversion) {
ASSERT_EQ(it->first, 3);
ASSERT_EQ((*it).second, 42);
ASSERT_EQ(it->first, cit->first);
ASSERT_EQ((*it).second, (*it).second);
ASSERT_EQ((*it).second, (*cit).second);
ASSERT_EQ(it, cit);
ASSERT_NE(++cit, it);