mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-11 05:23:52 +00:00
Add more tests for ReabableIterator
This commit is contained in:
parent
847b2a1be3
commit
029277f3ed
@ -29,15 +29,7 @@ int main()
|
|||||||
{
|
{
|
||||||
test_advance(ptr1, ptr2, 3);
|
test_advance(ptr1, ptr2, 3);
|
||||||
test_advance(ptr2, ptr1, -3);
|
test_advance(ptr2, ptr1, -3);
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
std::vector<int> ints(ptr1, ptr2);
|
|
||||||
test_advance(ints.begin(), ints.end(), 3);
|
|
||||||
test_advance(ints.end(), ints.begin(), -3);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
test_advance(
|
test_advance(
|
||||||
boost::make_transform_iterator(ptr1, twice)
|
boost::make_transform_iterator(ptr1, twice)
|
||||||
, boost::make_transform_iterator(ptr2, twice)
|
, boost::make_transform_iterator(ptr2, twice)
|
||||||
@ -50,15 +42,49 @@ int main()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
std::vector<int> ints(ptr1, ptr2);
|
||||||
|
test_advance(ints.begin(), ints.end(), 3);
|
||||||
|
test_advance(ints.end(), ints.begin(), -3);
|
||||||
|
|
||||||
|
test_advance(
|
||||||
|
boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, 3
|
||||||
|
);
|
||||||
|
test_advance(
|
||||||
|
boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, -3
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::list<int> ints(ptr1, ptr2);
|
std::list<int> ints(ptr1, ptr2);
|
||||||
test_advance(ints.begin(), ints.end(), 3);
|
test_advance(ints.begin(), ints.end(), 3);
|
||||||
test_advance(ints.end(), ints.begin(), -3);
|
test_advance(ints.end(), ints.begin(), -3);
|
||||||
|
|
||||||
|
test_advance(
|
||||||
|
boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, 3
|
||||||
|
);
|
||||||
|
test_advance(
|
||||||
|
boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, -3
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::container::slist<int> ints(ptr1, ptr2);
|
boost::container::slist<int> ints(ptr1, ptr2);
|
||||||
test_advance(ints.begin(), ints.end(), 3);
|
test_advance(ints.begin(), ints.end(), 3);
|
||||||
|
|
||||||
|
test_advance(
|
||||||
|
boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, 3
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
|
@ -28,15 +28,7 @@ int main()
|
|||||||
{
|
{
|
||||||
test_distance(ptr1, ptr2, 3);
|
test_distance(ptr1, ptr2, 3);
|
||||||
test_distance(ptr2, ptr1, -3);
|
test_distance(ptr2, ptr1, -3);
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
std::vector<int> ints(ptr1, ptr2);
|
|
||||||
test_distance(ints.begin(), ints.end(), 3);
|
|
||||||
test_distance(ints.end(), ints.begin(), -3);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
test_distance(
|
test_distance(
|
||||||
boost::make_transform_iterator(ptr1, twice)
|
boost::make_transform_iterator(ptr1, twice)
|
||||||
, boost::make_transform_iterator(ptr2, twice)
|
, boost::make_transform_iterator(ptr2, twice)
|
||||||
@ -49,14 +41,43 @@ int main()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
std::vector<int> ints(ptr1, ptr2);
|
||||||
|
test_distance(ints.begin(), ints.end(), 3);
|
||||||
|
test_distance(ints.end(), ints.begin(), -3);
|
||||||
|
|
||||||
|
test_distance(
|
||||||
|
boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, 3
|
||||||
|
);
|
||||||
|
test_distance(
|
||||||
|
boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, -3
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::list<int> ints(ptr1, ptr2);
|
std::list<int> ints(ptr1, ptr2);
|
||||||
test_distance(ints.begin(), ints.end(), 3);
|
test_distance(ints.begin(), ints.end(), 3);
|
||||||
|
|
||||||
|
test_distance(
|
||||||
|
boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, 3
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::container::slist<int> ints(ptr1, ptr2);
|
boost::container::slist<int> ints(ptr1, ptr2);
|
||||||
test_distance(ints.begin(), ints.end(), 3);
|
test_distance(ints.begin(), ints.end(), 3);
|
||||||
|
|
||||||
|
test_distance(
|
||||||
|
boost::make_transform_iterator(ints.begin(), twice)
|
||||||
|
, boost::make_transform_iterator(ints.end(), twice)
|
||||||
|
, 3
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user