11 #include <gtest/gtest.h> 23 simple_test_hash_string<uint8_t>();
26 simple_test_hash_string<uint16_t>();
29 simple_test_hash_string<uint32_t>();
32 simple_test_hash_string<uint64_t>();
38 mrpt::utils::ts_hash_map<std::string, double> m;
40 EXPECT_TRUE(m.empty());
43 EXPECT_FALSE(m.empty());
45 EXPECT_TRUE(m.empty());
51 EXPECT_EQ(1.0, m[
"uno"]);
52 EXPECT_EQ(2.0, m[
"dos"]);
53 EXPECT_EQ(3.0, m[
"tres"]);
56 EXPECT_EQ(4.0, m[
"tres"]) <<
"Fail after ++ operator applied to reference [].";
59 for (
const auto &e : m)
61 EXPECT_NEAR(
num, 7.0, 1e-10) <<
"Fail after visiting and summing all entries";
64 const auto &it = m.find(
"pepe");
65 EXPECT_TRUE(it == m.end());
69 const auto &it = m.find(
"uno");
70 EXPECT_TRUE( it->second==1.0 );
void simple_test_hash_string()
ts_hash_map()
< Default constructor */
TEST(ts_hash_map, string_hash_u8)
void BASE_IMPEXP reduced_hash(const std::string &value, uint8_t &hash)
hash function used by ts_hash_map. Uses dbj2 method