mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-09 23:23:54 +00:00
Updated lightweight_test.hpp includes to the new location.
This commit is contained in:
parent
fdcd8439c0
commit
4fe679bb0d
@ -45,7 +45,7 @@
|
||||
#endif
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#ifndef BOOST_NO_SLIST
|
||||
# ifdef BOOST_SLIST_HEADER
|
||||
# include BOOST_SLIST_HEADER
|
||||
|
@ -6,7 +6,7 @@
|
||||
//
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <boost/assign/list_of.hpp>
|
||||
#include <boost/fusion/include/at.hpp>
|
||||
|
@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#include <boost/generator_iterator.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
class X
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <stdlib.h>
|
||||
@ -44,7 +44,7 @@
|
||||
// interoperability (but may support const/mutable interop).
|
||||
# define NO_MUTABLE_CONST_STD_SET_ITERATOR_INTEROPERABILITY
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
template <class T> struct see_type;
|
||||
@ -53,7 +53,7 @@ template <int I> struct see_val;
|
||||
struct my_iterator_tag : public std::random_access_iterator_tag { };
|
||||
|
||||
using boost::dummyT;
|
||||
|
||||
|
||||
typedef std::vector<int> storage;
|
||||
typedef std::vector<int*> pointer_ra_container;
|
||||
typedef std::set<storage::iterator> iterator_set;
|
||||
@ -62,7 +62,7 @@ template <class Container>
|
||||
struct indirect_iterator_pair_generator
|
||||
{
|
||||
typedef boost::indirect_iterator<typename Container::iterator> iterator;
|
||||
|
||||
|
||||
typedef boost::indirect_iterator<
|
||||
typename Container::iterator
|
||||
, typename iterator::value_type const
|
||||
@ -73,7 +73,7 @@ void more_indirect_iterator_tests()
|
||||
{
|
||||
storage store(1000);
|
||||
std::generate(store.begin(), store.end(), rand);
|
||||
|
||||
|
||||
pointer_ra_container ptr_ra_container;
|
||||
iterator_set iter_set;
|
||||
|
||||
@ -90,27 +90,27 @@ void more_indirect_iterator_tests()
|
||||
BOOST_TEST(static_cast<std::size_t>(de - db) == store.size());
|
||||
BOOST_TEST(db + store.size() == de);
|
||||
indirect_ra_container::const_iterator dci = db;
|
||||
|
||||
|
||||
BOOST_TEST(dci == db);
|
||||
|
||||
|
||||
#ifndef NO_MUTABLE_CONST_RA_ITERATOR_INTEROPERABILITY
|
||||
BOOST_TEST(db == dci);
|
||||
#endif
|
||||
|
||||
|
||||
BOOST_TEST(dci != de);
|
||||
BOOST_TEST(dci < de);
|
||||
BOOST_TEST(dci <= de);
|
||||
|
||||
|
||||
#ifndef NO_MUTABLE_CONST_RA_ITERATOR_INTEROPERABILITY
|
||||
BOOST_TEST(de >= dci);
|
||||
BOOST_TEST(de > dci);
|
||||
#endif
|
||||
|
||||
|
||||
dci = de;
|
||||
BOOST_TEST(dci == de);
|
||||
|
||||
boost::random_access_iterator_test(db + 1, store.size() - 1, boost::next(store.begin()));
|
||||
|
||||
|
||||
*db = 999;
|
||||
BOOST_TEST(store.front() == 999);
|
||||
|
||||
@ -125,15 +125,15 @@ void more_indirect_iterator_tests()
|
||||
indirect_set_iterator se(iter_set.end());
|
||||
const_indirect_set_iterator sci(iter_set.begin());
|
||||
BOOST_TEST(sci == sb);
|
||||
|
||||
|
||||
# ifndef NO_MUTABLE_CONST_STD_SET_ITERATOR_INTEROPERABILITY
|
||||
BOOST_TEST(se != sci);
|
||||
# endif
|
||||
|
||||
|
||||
BOOST_TEST(sci != se);
|
||||
sci = se;
|
||||
BOOST_TEST(sci == se);
|
||||
|
||||
|
||||
*boost::prior(se) = 888;
|
||||
BOOST_TEST(store.back() == 888);
|
||||
BOOST_TEST(std::equal(sb, se, store.begin()));
|
||||
@ -145,7 +145,7 @@ void more_indirect_iterator_tests()
|
||||
// element_type detector; defaults to true so the test passes when
|
||||
// has_xxx isn't implemented
|
||||
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_element_type, element_type, true)
|
||||
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
@ -156,10 +156,10 @@ main()
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
boost::shared_ptr<dummyT> zz((dummyT*)0); // Why? I don't know, but it suppresses a bad instantiation.
|
||||
# endif
|
||||
|
||||
|
||||
typedef std::vector<boost::shared_ptr<dummyT> > shared_t;
|
||||
shared_t shared;
|
||||
|
||||
|
||||
// Concept checks
|
||||
{
|
||||
typedef boost::indirect_iterator<shared_t::iterator> iter_t;
|
||||
@ -169,7 +169,7 @@ main()
|
||||
std::iterator_traits<shared_t::iterator>::value_type
|
||||
>::value
|
||||
);
|
||||
|
||||
|
||||
typedef boost::indirect_iterator<
|
||||
shared_t::iterator
|
||||
, boost::iterator_value<shared_t::iterator>::type const
|
||||
@ -177,14 +177,14 @@ main()
|
||||
|
||||
# ifndef NO_MUTABLE_CONST_RA_ITERATOR_INTEROPERABILITY
|
||||
boost::function_requires< boost_concepts::InteroperableIteratorConcept<iter_t, c_iter_t> >();
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
// Test indirect_iterator_generator
|
||||
{
|
||||
for (int jj = 0; jj < N; ++jj)
|
||||
shared.push_back(boost::shared_ptr<dummyT>(new dummyT(jj)));
|
||||
|
||||
|
||||
dummyT* ptr[N];
|
||||
for (int k = 0; k < N; ++k)
|
||||
ptr[k] = array + k;
|
||||
@ -202,16 +202,16 @@ main()
|
||||
, N, array);
|
||||
|
||||
boost::random_access_iterator_test(boost::make_indirect_iterator(ptr), N, array);
|
||||
|
||||
|
||||
// check operator->
|
||||
assert((*i).m_x == i->foo());
|
||||
|
||||
const_indirect_iterator j(ptr);
|
||||
boost::random_access_iterator_test(j, N, array);
|
||||
|
||||
|
||||
dummyT const*const* const_ptr = ptr;
|
||||
boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array);
|
||||
|
||||
|
||||
boost::const_nonconst_iterator_test(i, ++j);
|
||||
|
||||
more_indirect_iterator_tests();
|
||||
|
@ -4,16 +4,16 @@
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/pending/iterator_tests.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
|
||||
struct mutable_it : boost::iterator_adaptor<mutable_it,int*>
|
||||
{
|
||||
typedef boost::iterator_adaptor<mutable_it,int*> super_t;
|
||||
|
||||
|
||||
mutable_it();
|
||||
explicit mutable_it(int* p) : super_t(p) {}
|
||||
|
||||
|
||||
bool equal(mutable_it const& rhs) const
|
||||
{
|
||||
return this->base() == rhs.base();
|
||||
@ -23,7 +23,7 @@ struct mutable_it : boost::iterator_adaptor<mutable_it,int*>
|
||||
struct constant_it : boost::iterator_adaptor<constant_it,int const*>
|
||||
{
|
||||
typedef boost::iterator_adaptor<constant_it,int const*> super_t;
|
||||
|
||||
|
||||
constant_it();
|
||||
explicit constant_it(int* p) : super_t(p) {}
|
||||
constant_it(mutable_it const& x) : super_t(x.base()) {}
|
||||
@ -37,7 +37,7 @@ struct constant_it : boost::iterator_adaptor<constant_it,int const*>
|
||||
int main()
|
||||
{
|
||||
int data[] = { 49, 77 };
|
||||
|
||||
|
||||
mutable_it i(data);
|
||||
constant_it j(data + 1);
|
||||
BOOST_TEST(i < j);
|
||||
@ -46,7 +46,7 @@ int main()
|
||||
BOOST_TEST(j >= i);
|
||||
BOOST_TEST(j - i == 1);
|
||||
BOOST_TEST(i - j == -1);
|
||||
|
||||
|
||||
constant_it k = i;
|
||||
|
||||
BOOST_TEST(!(i < k));
|
||||
@ -55,6 +55,6 @@ int main()
|
||||
BOOST_TEST(k >= i);
|
||||
BOOST_TEST(k - i == 0);
|
||||
BOOST_TEST(i - k == 0);
|
||||
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
#endif
|
||||
#include <boost/pending/iterator_tests.hpp>
|
||||
|
||||
# include <boost/detail/lightweight_test.hpp>
|
||||
# include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
// A UDT for which we can specialize std::iterator_traits<element*> on
|
||||
|
Loading…
x
Reference in New Issue
Block a user