1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #18401 from smirnov-alexey:as/serialization_more_types

[G-API] Add support for more types serialization

* Support more types

* Add std::string support

* Fix GOpaque and gin interaction

* Fix tests on kind

* Make map serialization support templates and add tests on kind
This commit is contained in:
Alexey Smirnov
2020-09-28 21:20:04 +03:00
committed by GitHub
parent 19f4cc57c1
commit 8da1b9aafa
8 changed files with 328 additions and 23 deletions
+12 -1
View File
@@ -215,6 +215,14 @@ TEST(GOpaque_OpaqueRef, TestMov)
EXPECT_NE(test, mov.rref<I>()); // ref lost the data
}
namespace {
struct MyTestStruct {
int i;
float f;
std::string name;
};
}
TEST(GOpaque_OpaqueRef, Kind)
{
cv::detail::OpaqueRef v1(cv::Rect{});
@@ -233,7 +241,10 @@ TEST(GOpaque_OpaqueRef, Kind)
EXPECT_EQ(cv::detail::OpaqueKind::CV_SIZE, v7.getKind());
cv::detail::OpaqueRef v8(std::string{});
EXPECT_EQ(cv::detail::OpaqueKind::CV_UNKNOWN, v8.getKind());
EXPECT_EQ(cv::detail::OpaqueKind::CV_STRING, v8.getKind());
cv::detail::OpaqueRef v9(MyTestStruct{});
EXPECT_EQ(cv::detail::OpaqueKind::CV_UNKNOWN, v9.getKind());
}
TEST(GOpaque_OpaqueRef, TestReset)