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 22:13:45 +0100
commit668932cf1d6d27f546b0ab8d2aea173454faf187 (patch)
tree66cb4861ffe20ff4bb393c3149c2f38f45e6194a
parente3ecd87a76bac891c233d16c1354376ab470ca8e (diff)
Tests: Disable intentionally triggered warning in test code
(cherry picked from commit 37899f395476c5f1c9d092a8f8425d2a379eeac7)
-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