From 37899f395476c5f1c9d092a8f8425d2a379eeac7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 13 Mar 2024 18:17:04 +0100 Subject: Tests: Disable intentionally triggered warning in test code --- tests/common/UniqueTrackablePtr.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') 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 ptr = Trinity::make_unique_trackable(); @@ -152,3 +159,7 @@ TEST_CASE("Trinity::unique_strong_ref_ptr type casts", "[UniqueTrackablePtr]") REQUIRE(testObj2 == Trinity::dynamic_pointer_cast(weak).lock()); } } + +#if TRINITY_COMPILER == TRINITY_COMPILER_GNU +#pragma GCC diagnostic pop +#endif -- cgit v1.2.3