1 #define BOOST_TEST_MODULE(ensurePointer_t) 2 #include "boost/test/unit_test.hpp" 23 BOOST_AUTO_TEST_SUITE(ensurePointer_t)
29 BOOST_CHECK_NO_THROW(art::ensurePointer<int*>(i.begin()));
31 BOOST_CHECK_NO_THROW(art::ensurePointer<int const*>(ic.begin()));
33 BOOST_CHECK_NO_THROW(art::ensurePointer<int*>(ip.begin()));
35 BOOST_CHECK_NO_THROW(art::ensurePointer<int const*>(icp.begin()));
42 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(a.begin()));
48 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(a.begin()));
54 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(b.begin()));
60 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(b.begin()));
66 std::unique_ptr<B> bp(
new B);
67 std::unique_ptr<A> ap(
new A);
68 a.push_back(bp.get());
69 a.push_back(ap.get());
70 BOOST_CHECK_NO_THROW(art::ensurePointer<B*>(a.begin()));
71 BOOST_CHECK_THROW(art::ensurePointer<B*>(a.begin() + 1),
art::Exception);
78 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(a.begin()));
84 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(a.begin()));
90 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(b.begin()));
96 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(b.begin()));
102 std::unique_ptr<B> bp(
new B);
103 std::unique_ptr<A> ap(
new A);
104 a.push_back(bp.get());
105 a.push_back(ap.get());
106 BOOST_CHECK_NO_THROW(art::ensurePointer<B const*>(a.begin()));
107 BOOST_CHECK_THROW(art::ensurePointer<B const*>(a.begin() + 1),
115 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(a.begin()));
121 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(a.begin()));
127 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(b.begin()));
133 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(b.begin()));
139 std::unique_ptr<B> bp(
new B);
140 std::unique_ptr<A> ap(
new A);
141 a.push_back(bp.get());
142 a.push_back(ap.get());
143 BOOST_CHECK_NO_THROW(art::ensurePointer<B const*>(a.begin()));
144 BOOST_CHECK_THROW(art::ensurePointer<B const*>(a.begin() + 1),
150 BOOST_AUTO_TEST_SUITE_END()
std::vector< A * > apvec_t
std::vector< int const * > icpvec_t
std::vector< int > ivec_t
BOOST_AUTO_TEST_CASE(basic_types)
std::vector< int * > ipvec_t
std::vector< B * > bpvec_t
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< B const * > bcpvec_t
std::vector< A const * > acpvec_t