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

pull/468/head
Kirill Kornyakov 12 years ago
parent 716e0192b3
commit 81b9f9b16b
  1. 10
      modules/core/test/test_misc.cpp

@ -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() ));
}
}
TEST(Core_SaturateCast, NegativeNotClipped)
{
double d = -1.0;
unsigned int val = cv::saturate_cast<unsigned int>(d);
ASSERT_EQ(0xffffffff, val);
}

Loading…
Cancel
Save