[test][overlay][setops] Fix msvc size_t to int conversion warnings.

This commit is contained in:
Adam Wulkiewicz 2015-07-23 01:18:48 +02:00
parent 58950ac91d
commit a7c539c075
3 changed files with 9 additions and 10 deletions

View File

@ -183,11 +183,8 @@ void test_both(std::string const& caseid,
//return;
std::string reverse;
for (int i = expected.size() - 1; i >= 0; i--)
{
reverse += expected[i];
}
std::string reversed(expected.rbegin(), expected.rend());
if (ip_x2 >= 0 && ip_y2 >= 0)
{
std::swap(ip_x, ip_x2);
@ -197,7 +194,7 @@ void test_both(std::string const& caseid,
test_with_point<P, double>(caseid + "_r",
qi_x, qi_y, qj_x, qj_y, qk_x, qk_y, // q
pi_x, pi_y, pj_x, pj_y, pk_x, pk_y, // p
method, ip_x, ip_y, reverse, ip_x2, ip_y2);
method, ip_x, ip_y, reversed, ip_x2, ip_y2);
}

View File

@ -604,7 +604,7 @@ void test_pointer_version()
bg::detail::intersection::intersection_insert<output_type>(box, ln, std::back_inserter(clip));
double length = 0;
int n = 0;
std::size_t n = 0;
for (std::vector<output_type>::const_iterator it = clip.begin();
it != clip.end(); ++it)
{
@ -613,10 +613,10 @@ void test_pointer_version()
}
BOOST_CHECK_EQUAL(clip.size(), 1u);
BOOST_CHECK_EQUAL(n, 2);
BOOST_CHECK_EQUAL(n, 2u);
BOOST_CHECK_CLOSE(length, sqrt(2.0 * 6.0 * 6.0), 0.001);
for (unsigned int i = 0; i < ln.size(); i++)
for (std::size_t i = 0; i < ln.size(); i++)
{
delete ln[i];
}

View File

@ -54,7 +54,9 @@ check_result(
{
if (expected_point_count > 0)
{
n += bg::num_points(*it, true);
// here n should rather be of type std::size_t, but expected_point_count
// is set to -1 in some test cases so type int was left for now
n += static_cast<int>(bg::num_points(*it, true));
}
// instead of specialization we check it run-time here