From 07de67c32f148f0673eb62e75498a5e5b0176bbe Mon Sep 17 00:00:00 2001 From: Gleb Gladilov Date: Tue, 21 Jul 2015 18:08:30 +0300 Subject: [PATCH] Added test of minMaxLoc on filling with maximums of int --- modules/core/test/test_arithm.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index f3faa57fce..ac88615955 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -1792,3 +1792,21 @@ INSTANTIATE_TEST_CASE_P(Arithm, SubtractOutputMatNotEmpty, testing::Combine( testing::Values(perf::MatType(CV_8UC1), CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3), testing::Values(-1, CV_16S, CV_32S, CV_32F), testing::Bool())); + +TEST(MinMaxLoc, Mat_IntMax_Without_Mask) +{ + Mat_ mat(50, 50); + int iMaxVal = numeric_limits::max(); + mat.setTo(iMaxVal); + + double min, max; + Point minLoc, maxLoc; + + minMaxLoc(mat, &min, &max, &minLoc, &maxLoc, Mat()); + + ASSERT_EQ(iMaxVal, min); + ASSERT_EQ(iMaxVal, max); + + ASSERT_EQ(Point(0, 0), minLoc); + ASSERT_EQ(Point(0, 0), maxLoc); +}