summaryrefslogtreecommitdiff
path: root/tests/test_common/test_driver.hpp
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-12-18 21:55:14 +0100
committerGitHub <noreply@github.com>2022-12-18 21:55:14 +0100
commitc2b13bd77b71ea73db12a6cda64871565036a6dc (patch)
treee24c99abb8260a929b9fcc4cba21705475514c07 /tests/test_common/test_driver.hpp
parent7aa2d791f69244a5f17ec0d00908ec5a05d21103 (diff)
Introduce VERIFY_AND_CLEAR shorthand (#19370)
Which is just a syntactic sugar for testing::Mock::VerifyAndClearExpectations to reduce the visual clutter in unit-tests.
Diffstat (limited to 'tests/test_common/test_driver.hpp')
-rw-r--r--tests/test_common/test_driver.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_common/test_driver.hpp b/tests/test_common/test_driver.hpp
index 982aec6c83..8d09e44840 100644
--- a/tests/test_common/test_driver.hpp
+++ b/tests/test_common/test_driver.hpp
@@ -98,6 +98,12 @@ class TestDriver {
*/
#define EXPECT_NO_REPORT(driver) EXPECT_ANY_REPORT(driver).Times(0)
+/**
+ * @brief Verify and clear all gmock expectations that have been setup until
+ * this point.
+ */
+#define VERIFY_AND_CLEAR(driver) testing::Mock::VerifyAndClearExpectations(&driver)
+
namespace internal {
void expect_unicode_code_point(TestDriver& driver, uint32_t code_point);
} // namespace internal