201 static constexpr
bool isFOP =
202 std::is_same<typename FO<B_t>::value_type,
211 BOOST_REQUIRE_EQUAL(hAB->
size(), 3ul);
213 BOOST_REQUIRE_EQUAL(hABV->
size(), 3ul);
215 BOOST_CHECK_THROW((*hAB).at(3), std::out_of_range);
216 BOOST_CHECK_EQUAL(&(*hAB).data(0), &(*hAB).data((*hAB).begin()));
217 BOOST_CHECK_THROW((*hAB).data(3), std::out_of_range);
221 BOOST_REQUIRE_EQUAL(hBA->
size(), 3ul);
223 BOOST_REQUIRE_EQUAL(hBAV->
size(), 3ul);
225 BOOST_CHECK_THROW((*hBA).at(3), std::out_of_range);
226 BOOST_CHECK_EQUAL(&(*hBA).data(0), &(*hBA).data((*hBA).begin()));
227 BOOST_CHECK_THROW((*hBA).data(3), std::out_of_range);
232 auto vhAcoll =
e.getValidHandle<std::vector<A_t>>(
inputLabel_);
235 FO<B_t, arttest::AssnTestData> foDead(hAcoll,
e,
"noModule");
237 BOOST_REQUIRE_EXCEPTION(
240 e.history().back() ==
"ProductNotFound";
242 BOOST_REQUIRE_EXCEPTION(
245 e.history().back() ==
"ProductNotFound";
251 std::unique_ptr<FO<A_t, arttest::AssnTestData>> foA;
252 std::unique_ptr<FO<A_t>> foAV;
254 foA.reset(
new FO<A_t, arttest::AssnTestData>{hBcoll,
e,
inputLabel_});
257 if (extendedTestsOK) {
258 FO<B_t, arttest::AssnTestData> foB(hAcoll,
e,
inputLabel_);
259 FO<B_t, arttest::AssnTestData> foB2(vhAcoll,
e,
inputLabel_);
261 std::vector<art::Ptr<A_t>> vp;
263 for (
size_t i = 0;
i < 3; ++
i) {
264 vp.emplace_back(hAcoll,
i);
266 BOOST_CHECK_EQUAL(*(*hAB)[
i].first,
i);
270 BOOST_CHECK_EQUAL((*hAB).data(
i).d1, (*hAB)[
i].first.key());
271 BOOST_CHECK_EQUAL((*hAB).data(
i).d2, (*hAB)[
i].second.key());
273 BOOST_CHECK_EQUAL(*(*hABV)[
i].first,
i);
282 BOOST_CHECK_EQUAL(*(*hBA)[
i].
second,
i);
283 BOOST_CHECK_EQUAL((*hBA).data(
i).d2, (*hBA)[
i].first.key());
284 BOOST_CHECK_EQUAL((*hBA).data(
i).d1, (*hBA)[
i].second.key());
289 BOOST_CHECK_EQUAL(*(*hBAV)[
i].
second,
i);
292 BOOST_CHECK(!foBV.at(
i));
299 BOOST_CHECK_NO_THROW(check_get(*foA, *foAV));
301 for (
auto const&
f : {foB, foB2}) {
312 FO<B_t, arttest::AssnTestData> foBv(va,
e,
inputLabel_);
315 std::unique_ptr<FO<A_t, arttest::AssnTestData>> foAv;
318 foAv.reset(
new FO<A_t, arttest::AssnTestData>{vb,
e,
inputLabel_});
322 auto va2 = va.
vals();
325 swap(*va2.begin(), *(va2.begin() + 1));
326 swap(*va2.begin(), *(va2.begin() + 2));
329 FO<B_t, arttest::AssnTestData> foBv2(va2,
e,
inputLabel_);
330 for (
size_t i = 0,
e = foBv2.size();
i !=
e; ++
i) {
332 auto it = find(va.
begin(), va.
end(), va2[
i]);
340 FO<B_t, arttest::AssnTestData> foBpv(pva,
e,
inputLabel_);
341 BOOST_CHECK_EQUAL(foBpv.at(0), foB.at(0));
342 BOOST_CHECK_EQUAL(foBpv.data(0), foB.data(0));
343 BOOST_CHECK_EQUAL(foBpv.at(1), foB.at(2));
344 BOOST_CHECK_EQUAL(foBpv.data(1), foB.data(2));
350 FO<A_t, arttest::AssnTestData> foApv(pvb,
e,
inputLabel_);
352 BOOST_CHECK_THROW(foApv.at(3), std::out_of_range);
353 BOOST_CHECK_THROW(foApv.data(3), std::out_of_range);
356 BOOST_CHECK_EQUAL(foApv.at(0), foA->at(0));
357 BOOST_CHECK_EQUAL(foApv.data(0), foA->data(0));
358 BOOST_CHECK_EQUAL(foApv.at(1), foA->at(2));
359 BOOST_CHECK_EQUAL(foApv.data(1), foA->data(2));
381 for (std::size_t
i = 0ul, sz = foAmvv.size();
i != sz; ++
i) {
static const double second
void fill(PtrVector< T > &pv) const
details::dereference_class< T, details::has_dereference_class< T >::value >::reference_type dereference(T &v)
Returns the value pointed by the argument, or the argument itself.
void swap(Handle< T > &a, Handle< T > &b)
art::ProductToken< AssnsBA_t > mapVecToken2_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
art::ProductToken< AssnsAB_t > mapVecToken1_