mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
unit_tests: added gtest utility ASSERT_EQ_MAP for easily testing key-value map
This commit is contained in:
parent
ed67e5c001
commit
e6a6093871
1 changed files with 7 additions and 0 deletions
|
@ -65,3 +65,10 @@ namespace unit_test
|
||||||
std::atomic<size_t> m_counter;
|
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)
|
||||||
|
|
Loading…
Reference in a new issue