Skip to content

Commit

Permalink
unit_tests: added gtest utility ASSERT_EQ_MAP for easily testing key-…
Browse files Browse the repository at this point in the history
…value map
  • Loading branch information
stoffu committed Feb 12, 2018
1 parent ed67e5c commit e6a6093
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit_tests/unit_tests_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e6a6093

Please sign in to comment.