Merge pull request #468 from kirill-kornyakov:test-for-saturate-cast

This commit is contained in:
Andrey Kamaev 2013-02-12 17:04:53 +04:00 committed by OpenCV Buildbot
commit 7c77b402db

View File

@ -39,4 +39,12 @@ TEST(Core_OutputArraySreate, _1997)
Size submatSize = Size(256, 256); Size submatSize = Size(256, 256);
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);
}