mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 09:24:47 +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