From 04d628ec2e9d763085ba0a7c2f9165553f8f45ab Mon Sep 17 00:00:00 2001 From: planetmaker Date: Mon, 20 Sep 2021 16:25:05 +0200 Subject: [PATCH] Fix: Silence gcc warnings in the unit tests on deprecated use of auto_ptr. The cpptest library seems stuck in old code and there is no easy way to change this other than replacing cpptest with something not using deprecated code --- nel/tools/nel_unit_test/nel_unit_test.cpp | 5 +++++ nel/tools/nel_unit_test/ut_misc.h | 5 +++++ nel/tools/nel_unit_test/ut_net.h | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/nel/tools/nel_unit_test/nel_unit_test.cpp b/nel/tools/nel_unit_test/nel_unit_test.cpp index d716fef98a..e1b6334a54 100644 --- a/nel/tools/nel_unit_test/nel_unit_test.cpp +++ b/nel/tools/nel_unit_test/nel_unit_test.cpp @@ -21,6 +21,9 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + using namespace std; #ifdef NL_OS_WINDOWS @@ -160,3 +163,5 @@ int main(int argc, char *argv[]) nlwarning("Errors during unit testing"); return noerrors?EXIT_SUCCESS:EXIT_FAILURE; } + +#pragma GCC diagnostic pop diff --git a/nel/tools/nel_unit_test/ut_misc.h b/nel/tools/nel_unit_test/ut_misc.h index 97bc0d4105..27bbbc3c32 100644 --- a/nel/tools/nel_unit_test/ut_misc.h +++ b/nel/tools/nel_unit_test/ut_misc.h @@ -34,6 +34,9 @@ #include "ut_misc_base64.h" // Add a line here when adding a new test CLASS +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + struct CUTMisc : public Test::Suite { CUTMisc() @@ -57,4 +60,6 @@ struct CUTMisc : public Test::Suite } }; +#pragma GCC diagnostic pop + #endif diff --git a/nel/tools/nel_unit_test/ut_net.h b/nel/tools/nel_unit_test/ut_net.h index cee3b01cb8..fab815c1a8 100644 --- a/nel/tools/nel_unit_test/ut_net.h +++ b/nel/tools/nel_unit_test/ut_net.h @@ -24,6 +24,9 @@ #include "ut_net_module.h" // Add a line here when adding a new test CLASS +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + struct CUTNet : public Test::Suite { CUTNet() @@ -35,4 +38,6 @@ struct CUTNet : public Test::Suite } }; +#pragma GCC diagnostic pop + #endif