mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-09 23:24:02 +00:00
[test][util][range] Add tests for const pointer
Add tests for range iterator_range<const pointer> and pair<const pointer>
This commit is contained in:
parent
2e18afacce
commit
e969a4c33a
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <geometry_test_common.hpp>
|
#include <geometry_test_common.hpp>
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/geometry/util/range.hpp>
|
#include <boost/geometry/util/range.hpp>
|
||||||
|
|
||||||
@ -198,12 +199,13 @@ void test_detail()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class Iterator>
|
||||||
void test_pointers()
|
void test_pointers()
|
||||||
{
|
{
|
||||||
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||||
|
|
||||||
boost::iterator_range<int*> r1(arr, arr+10);
|
boost::iterator_range<Iterator> r1(arr, arr + 10);
|
||||||
std::pair<int*, int*> r2(arr, arr+10);
|
std::pair<Iterator, Iterator> r2(arr, arr + 10);
|
||||||
|
|
||||||
BOOST_CHECK(bgr::front(r1) == 0);
|
BOOST_CHECK(bgr::front(r1) == 0);
|
||||||
BOOST_CHECK(bgr::front(r2) == 0);
|
BOOST_CHECK(bgr::front(r2) == 0);
|
||||||
@ -226,7 +228,8 @@ int test_main(int, char* [])
|
|||||||
test_all<bgt::CopyableAndMovable, false>();
|
test_all<bgt::CopyableAndMovable, false>();
|
||||||
|
|
||||||
test_detail();
|
test_detail();
|
||||||
test_pointers();
|
test_pointers<int*>();
|
||||||
|
test_pointers<int const*>();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user