12 #include "cetlib_except/exception.h" 19 class PtrVectorAnalyzer;
40 size_t sz = h->
size();
43 <<
"Expected a PtrVector of size " <<
nvalues_ 44 <<
" but the obtained size is " << sz <<
'\n';
49 for (
const auto ptr : *h) {
52 <<
"At position " << count <<
" expected value " << value
53 <<
" but obtained " << *ptr <<
'\n';
60 <<
"Expected to iterate over " << sz <<
" values, but found " << count
71 assert(sz == local.
size());
72 for (
size_t i = 1;
i != sz; ++
i)
73 assert(*local[
i - 1] < *local[
i]);
77 assert(sz == local.
size());
78 for (
size_t i = 1; i != sz; ++
i)
79 assert(*local[i - 1] > *local[i]);
82 product_t insert_test;
83 auto half_size = h->size() / 2;
85 insert_test.
begin(), h->cbegin(), h->cbegin() + half_size);
87 insert_test.
insert(insert_test.
end(), h->cbegin() + half_size, h->cend());
88 assert(it == insert_test.
begin() + half_size);
89 assert(insert_test.
size() == h->size());
90 it = insert_test.
insert(it, h->cbegin(), h->end());
91 assert(it == insert_test.
begin() + half_size);
92 assert(insert_test.
size() == h->size() * 2);
void analyze(art::Event const &e) override
art::PtrVector< int > product_t
EDAnalyzer(fhicl::ParameterSet const &pset)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
PtrVectorAnalyzer(fhicl::ParameterSet const &p)
iterator insert(iterator position, Ptr< U > const &p)
EventNumber_t event() const
auto const & get(AssnsNode< L, R, D > const &r)
cet::coded_exception< error, detail::translate > exception
h
training ###############################