Added a test that documents that negative numbers are not clipped by cv::saturate_cast
This commit is contained in:
parent
716e0192b3
commit
81b9f9b16b
@ -40,3 +40,11 @@ TEST(Core_OutputArraySreate, _1997)
|
|||||||
|
|
||||||
ASSERT_NO_THROW(local::create( mat(Rect(Point(), submatSize)), submatSize, mat.type() ));
|
ASSERT_NO_THROW(local::create( mat(Rect(Point(), submatSize)), submatSize, mat.type() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Core_SaturateCast, NegativeNotClipped)
|
||||||
|
{
|
||||||
|
double d = -1.0;
|
||||||
|
unsigned int val = cv::saturate_cast<unsigned int>(d);
|
||||||
|
|
||||||
|
ASSERT_EQ(0xffffffff, val);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user