aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-03-13 18:17:04 +0100
committerShauren <shauren.trinity@gmail.com>2024-03-13 18:17:04 +0100
commit37899f395476c5f1c9d092a8f8425d2a379eeac7 (patch)
tree5f85ca3c39403c967c2a4d05a28ae761f0b59254
parentf690b693386ef44754fa4528f3c565d563ad9468 (diff)
Tests: Disable intentionally triggered warning in test code
-rw-r--r--tests/common/UniqueTrackablePtr.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/common/UniqueTrackablePtr.cpp b/tests/common/UniqueTrackablePtr.cpp
index 3ab4cee1a55..a6de1d68ce7 100644
--- a/tests/common/UniqueTrackablePtr.cpp
+++ b/tests/common/UniqueTrackablePtr.cpp
@@ -17,6 +17,7 @@
#include "tc_catch2.h"
+#include "CompilerDefs.h"
#include "UniqueTrackablePtr.h"
struct TestObj
@@ -104,6 +105,12 @@ TEST_CASE("Trinity::unique_weak_ptr", "[UniqueTrackablePtr]")
}
}
+// disable warning about invalid reinterpret_cast, test intentionally tests this
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wreinterpret-base-class"
+#endif
+
TEST_CASE("Trinity::unique_strong_ref_ptr type casts", "[UniqueTrackablePtr]")
{
Trinity::unique_trackable_ptr<TestObj> ptr = Trinity::make_unique_trackable<TestObj3>();
@@ -152,3 +159,7 @@ TEST_CASE("Trinity::unique_strong_ref_ptr type casts", "[UniqueTrackablePtr]")
REQUIRE(testObj2 == Trinity::dynamic_pointer_cast<TestObj4>(weak).lock());
}
}
+
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic pop
+#endif