提交 81b9f9b1 编写于 作者: K Kirill Kornyakov

Added a test that documents that negative numbers are not clipped by cv::saturate_cast

上级 716e0192
......@@ -39,4 +39,12 @@ TEST(Core_OutputArraySreate, _1997)
Size submatSize = Size(256, 256);
ASSERT_NO_THROW(local::create( mat(Rect(Point(), submatSize)), submatSize, mat.type() ));
}
\ No newline at end of file
}
TEST(Core_SaturateCast, NegativeNotClipped)
{
double d = -1.0;
unsigned int val = cv::saturate_cast<unsigned int>(d);
ASSERT_EQ(0xffffffff, val);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册