unit_tests: added gtest utility ASSERT_EQ_MAP for easily testing key-value map

This commit is contained in:
stoffu 2018-02-09 21:11:47 +09:00
parent ed67e5c001
commit e6a6093871
No known key found for this signature in database
GPG Key ID: 41DAB8343A9EC012
1 changed files with 7 additions and 0 deletions

View File

@ -65,3 +65,10 @@ namespace unit_test
std::atomic<size_t> m_counter;
};
}
# define ASSERT_EQ_MAP(val, map, key) \
do { \
auto found = map.find(key); \
ASSERT_TRUE(found != map.end()); \
ASSERT_EQ(val, found->second); \
} while (false)