From 7efc0011fd8b438bc435635c0475fa0b9a4c256d Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 26 Nov 2020 21:21:05 +0000 Subject: [PATCH] gapi(test): avoid anonymous namespace types as template parameters --- .../test/cpu/gapi_ocv_stateful_kernel_test_utils.hpp | 9 ++++++--- modules/gapi/test/gapi_array_tests.cpp | 3 ++- modules/gapi/test/gapi_opaque_tests.cpp | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/gapi/test/cpu/gapi_ocv_stateful_kernel_test_utils.hpp b/modules/gapi/test/cpu/gapi_ocv_stateful_kernel_test_utils.hpp index 040e628460..0caf0115f1 100644 --- a/modules/gapi/test/cpu/gapi_ocv_stateful_kernel_test_utils.hpp +++ b/modules/gapi/test/cpu/gapi_ocv_stateful_kernel_test_utils.hpp @@ -22,8 +22,10 @@ struct Name \ namespace opencv_test { -namespace -{ + +// types from anonymous namespace doesn't work well with templates +inline namespace gapi_ocv_stateful_kernel_test_utils { + struct UserStruct { UserStruct() = default; @@ -41,7 +43,8 @@ private: short _myShortVal; float _myFloatVal; }; -} // anonymous namespace + +} // namespace } // opencv_test #endif // OPENCV_GAPI_OCV_STATEFUL_KERNEL_TESTS_UTILS_HPP diff --git a/modules/gapi/test/gapi_array_tests.cpp b/modules/gapi/test/gapi_array_tests.cpp index b4c8378799..8bdc0854f0 100644 --- a/modules/gapi/test/gapi_array_tests.cpp +++ b/modules/gapi/test/gapi_array_tests.cpp @@ -240,7 +240,8 @@ TEST(GArray_VectorRef, TestMov) EXPECT_EQ(V{}, vtest); } -namespace { +// types from anonymous namespace doesn't work well with templates +inline namespace gapi_array_tests { struct MyTestStruct { int i; float f; diff --git a/modules/gapi/test/gapi_opaque_tests.cpp b/modules/gapi/test/gapi_opaque_tests.cpp index 4cadb918b8..de3572c4bd 100644 --- a/modules/gapi/test/gapi_opaque_tests.cpp +++ b/modules/gapi/test/gapi_opaque_tests.cpp @@ -284,7 +284,8 @@ TEST(GOpaque_OpaqueRef, TestMov) EXPECT_NE(test, mov.rref()); // ref lost the data } -namespace { +// types from anonymous namespace doesn't work well with templates +inline namespace gapi_opaque_tests { struct MyTestStruct { int i; float f;