#include "boost/test/unit_test.hpp"
#include "canvas/Utilities/ensurePointer.h"
#include <vector>
Go to the source code of this file.
#define BOOST_TEST_MODULE |
( |
|
ensurePointer_t | ) |
|
BOOST_AUTO_TEST_CASE |
( |
basic_types |
| ) |
|
Definition at line 26 of file ensurePointer_t.cc.
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()));
std::vector< int const * > icpvec_t
std::vector< int > ivec_t
std::vector< int * > ipvec_t
BOOST_AUTO_TEST_CASE |
( |
a_pointer_from_a |
| ) |
|
Definition at line 39 of file ensurePointer_t.cc.
42 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(
a.begin()));
BOOST_AUTO_TEST_CASE |
( |
a_pointer_from_a_pointer |
| ) |
|
Definition at line 45 of file ensurePointer_t.cc.
48 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(
a.begin()));
std::vector< A * > apvec_t
BOOST_AUTO_TEST_CASE |
( |
a_pointer_from_b |
| ) |
|
Definition at line 51 of file ensurePointer_t.cc.
54 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(
b.begin()));
BOOST_AUTO_TEST_CASE |
( |
a_pointer_from_b_pointer |
| ) |
|
Definition at line 57 of file ensurePointer_t.cc.
60 BOOST_CHECK_NO_THROW(art::ensurePointer<A*>(
b.begin()));
std::vector< B * > bpvec_t
BOOST_AUTO_TEST_CASE |
( |
b_pointer_from_a_pointer |
| ) |
|
Definition at line 63 of file ensurePointer_t.cc.
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);
std::vector< A * > apvec_t
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_const_a |
| ) |
|
Definition at line 75 of file ensurePointer_t.cc.
78 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
a.begin()));
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_const_a_pointer |
| ) |
|
Definition at line 81 of file ensurePointer_t.cc.
84 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
a.begin()));
std::vector< A const * > acpvec_t
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_const_b |
| ) |
|
Definition at line 87 of file ensurePointer_t.cc.
90 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
b.begin()));
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_const_b_pointer |
| ) |
|
Definition at line 93 of file ensurePointer_t.cc.
96 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
b.begin()));
std::vector< B const * > bcpvec_t
BOOST_AUTO_TEST_CASE |
( |
const_b_pointer_from_const_a_pointer |
| ) |
|
Definition at line 99 of file ensurePointer_t.cc.
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),
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< A const * > acpvec_t
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_a |
| ) |
|
Definition at line 112 of file ensurePointer_t.cc.
115 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
a.begin()));
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_a_pointer |
| ) |
|
Definition at line 118 of file ensurePointer_t.cc.
121 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
a.begin()));
std::vector< A * > apvec_t
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_b |
| ) |
|
Definition at line 124 of file ensurePointer_t.cc.
127 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
b.begin()));
BOOST_AUTO_TEST_CASE |
( |
const_a_pointer_from_b_pointer |
| ) |
|
Definition at line 130 of file ensurePointer_t.cc.
133 BOOST_CHECK_NO_THROW(art::ensurePointer<A const*>(
b.begin()));
std::vector< B * > bpvec_t
BOOST_AUTO_TEST_CASE |
( |
const_b_pointer_from_a_pointer |
| ) |
|
Definition at line 136 of file ensurePointer_t.cc.
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),
std::vector< A * > apvec_t
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception