From 068b457ad57381a2609d9365bbd580a0efa58326 Mon Sep 17 00:00:00 2001 From: Richard Wells Date: Fri, 17 Jan 2025 16:49:24 +0000 Subject: [PATCH] Fix RemapS16 CornerCase test issues. --- test/api/test_remap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/api/test_remap.cpp b/test/api/test_remap.cpp index 838f8a2c3..6fe9ad298 100644 --- a/test/api/test_remap.cpp +++ b/test/api/test_remap.cpp @@ -88,7 +88,6 @@ class RemapS16 : public testing::Test { const ScalarType *border_value, size_t padding) { test::Array2D mapxy{2 * dst_w, dst_h, padding, 2}; - // One more y than x so we'll see many combinations const int16_t corner_x_values[] = {-32768, -1, 0, @@ -104,6 +103,8 @@ class RemapS16 : public testing::Test { static_cast(src_h - 1), static_cast(src_h), 32767}; + // Number of elements in corner_x_values and corner_y_values + // One more y than x, so it will cycle through all combinations static const size_t nx = sizeof(corner_x_values) / sizeof(int16_t); static const size_t ny = sizeof(corner_y_values) / sizeof(int16_t); size_t counter = 0; @@ -111,6 +112,7 @@ class RemapS16 : public testing::Test { for (size_t column = 0; column < dst_w; ++column) { *mapxy.at(row, column * 2) = corner_x_values[counter % nx]; *mapxy.at(row, column * 2 + 1) = corner_y_values[counter % ny]; + ++counter; } } -- GitLab