We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 388a3b9 commit 2b4c984Copy full SHA for 2b4c984
tests/runtime_tests.cpp
@@ -14,6 +14,20 @@ std::size_t double_delete = 0u;
14
bool memory_tracking = false;
15
bool force_next_allocation_failure = false;
16
17
+// Replace Catch2's REQUIRE_THROWS_AS, which allocates on Windows;
18
+// this confuses our memory leak checks.
19
+#undef REQUIRE_THROWS_AS
20
+#define REQUIRE_THROWS_AS(EXPRESSION, EXCEPTION) \
21
+ do { \
22
+ try { \
23
+ EXPRESSION; \
24
+ FAIL("no exception thrown"); \
25
+ } catch (const EXCEPTION&) { \
26
+ } catch (...) { \
27
+ FAIL("unexpected exception thrown"); \
28
+ } \
29
+ } while (0)
30
+
31
#define CHECK_MEMORY_LEAKS 1
32
33
#if defined(CHECK_MEMORY_LEAKS) && CHECK_MEMORY_LEAKS
0 commit comments