From 3e681e31f3fd2cd909fbbbf9d201e8dc6d5fdcee Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 1 Jul 2021 23:23:44 +0200 Subject: [PATCH] [test] Fix initializer_list narrowing conversion error in get_clusters test. --- test/algorithms/overlay/get_clusters.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/algorithms/overlay/get_clusters.cpp b/test/algorithms/overlay/get_clusters.cpp index 0776d3dc7..75f1bbc7e 100644 --- a/test/algorithms/overlay/get_clusters.cpp +++ b/test/algorithms/overlay/get_clusters.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2021 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -63,8 +67,8 @@ void do_test(std::string const& case_id, << " detected: " << clusters.size()); } -template -void test_get_clusters(T eps) +template +void test_get_clusters(typename bg::coordinate_type::type eps) { do_test("no", {{1.0, 1.0}, {1.0, 2.0}}, 0); do_test("simplex", {{1.0, 1.0}, {1.0, 1.0}}, 1); @@ -78,10 +82,10 @@ void test_get_clusters(T eps) 8); // Border cases - do_test("borderx_no", {{1.0, 1.0}, {1.0, 2.0}, {1.0 + eps * 10.0, 1.0}}, 0); - do_test("borderx_yes", {{1.0, 1.0}, {1.0, 2.0}, {1.0 + eps, 1.0}}, 1); - do_test("bordery_no", {{1.0, 1.0}, {2.0, 1.0}, {1.0 + eps * 10.0, 1.0}}, 0); - do_test("bordery_yes", {{1.0, 1.0}, {2.0, 1.0}, {1.0 + eps, 1.0}}, 1); + do_test("borderx_no", {{1, 1}, {1, 2}, {1 + eps * 10, 1}}, 0); + do_test("borderx_yes", {{1, 1}, {1, 2}, {1 + eps, 1}}, 1); + do_test("bordery_no", {{1, 1}, {2, 1}, {1 + eps * 10, 1}}, 0); + do_test("bordery_yes", {{1, 1}, {2, 1}, {1 + eps, 1}}, 1); } int test_main(int, char* []) @@ -89,7 +93,7 @@ int test_main(int, char* []) using fp = bg::model::point; using dp = bg::model::point; using ep = bg::model::point; - test_get_clusters(1.0e-8); + test_get_clusters(1.0e-8f); test_get_clusters(1.0e-13); test_get_clusters(1.0e-16); return 0;