Commit 12615593 authored by Ruslan Garnov's avatar Ruslan Garnov

Fixed own::Mat::empty() for non md case

parent af230ec1
......@@ -286,7 +286,7 @@ namespace cv { namespace gapi { namespace own {
*/
bool empty() const
{
return data == 0 || total() == 0 || dims.empty();
return data == 0 || total() == 0;
}
/** @brief Returns the total number of array elements.
......
......@@ -24,6 +24,7 @@ TEST(OwnMat, DefaultConstruction)
ASSERT_EQ(m.type(), 0);
ASSERT_EQ(m.depth(), 0);
ASSERT_TRUE(m.dims.empty());
ASSERT_TRUE(m.empty());
}
TEST(OwnMat, Create)
......@@ -42,6 +43,7 @@ TEST(OwnMat, Create)
ASSERT_EQ(m.elemSize(), sizeof(uint8_t));
ASSERT_EQ(m.step, sizeof(uint8_t) * m.cols);
ASSERT_TRUE(m.dims.empty());
ASSERT_FALSE(m.empty());
}
TEST(OwnMat, CreateND)
......@@ -60,6 +62,7 @@ TEST(OwnMat, CreateND)
ASSERT_EQ(sizeof(float) , m.elemSize());
ASSERT_EQ(0u , m.step );
ASSERT_EQ(dims , m.dims );
ASSERT_FALSE(m.empty());
}
TEST(OwnMat, CreateOverload)
......@@ -78,6 +81,7 @@ TEST(OwnMat, CreateOverload)
ASSERT_EQ(m.elemSize(), sizeof(uint8_t));
ASSERT_EQ(m.step, sizeof(uint8_t) * m.cols);
ASSERT_TRUE(m.dims.empty());
ASSERT_FALSE(m.empty());
}
TEST(OwnMat, Create3chan)
......@@ -95,6 +99,7 @@ TEST(OwnMat, Create3chan)
ASSERT_EQ(m.elemSize(), 3 * sizeof(uint8_t));
ASSERT_EQ(m.step, 3* sizeof(uint8_t) * m.cols);
ASSERT_TRUE(m.dims.empty());
ASSERT_FALSE(m.empty());
}
struct NonEmptyMat {
......@@ -116,7 +121,8 @@ namespace {
mat.type(),
mat.depth(),
mat.channels(),
mat.dims
mat.dims,
mat.empty()
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment