Skip to content

Commit

Permalink
gapi(test): avoid anonymous namespace types as template parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Nov 26, 2020
1 parent d65c6af commit 7efc001
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions modules/gapi/test/cpu/gapi_ocv_stateful_kernel_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,7 +43,8 @@ struct UserStruct
short _myShortVal;
float _myFloatVal;
};
} // anonymous namespace

} // namespace
} // opencv_test

#endif // OPENCV_GAPI_OCV_STATEFUL_KERNEL_TESTS_UTILS_HPP
3 changes: 2 additions & 1 deletion modules/gapi/test/gapi_array_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion modules/gapi/test/gapi_opaque_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ TEST(GOpaque_OpaqueRef, TestMov)
EXPECT_NE(test, mov.rref<I>()); // 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;
Expand Down

0 comments on commit 7efc001

Please sign in to comment.