TestRemoveCachedProduct_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: TestRemoveCachedProduct
3 // Module Type: analyzer
4 // File: TestRemoveCachedProduct_module.cc
5 //
6 // Generated at Thu Jul 24 13:06:11 2014 by Christopher Green using artmod
7 // from cetpkgsupport v1_06_02.
8 ////////////////////////////////////////////////////////////////////////
9 
19 #include "fhiclcpp/ParameterSet.h"
21 
22 namespace arttest {
23  class TestRemoveCachedProduct;
24 }
25 
27 public:
29  // The destructor generated by the compiler is fine for classes
30  // without bare pointers or other resource use.
31 
32  // Plugins should not be copied or assigned.
37  void analyze(art::Event const& e) override;
38 
39  void endSubRun(art::SubRun const& sr) override;
40  void endRun(art::Run const& r) override;
41 
42 private:
43  // Declare member data here.
44 };
45 
47  fhicl::ParameterSet const& p)
48  : EDAnalyzer(p) // ,
49  // More initializers here.
50 {}
51 
52 void
54 {
56  BOOST_CHECK(!hi.isValid());
57  BOOST_CHECK(!e.removeCachedProduct(hi));
58  BOOST_CHECK(e.getByLabel("m1a", hi));
59  BOOST_CHECK(hi.isValid());
60  BOOST_CHECK_EQUAL(hi->size(), 16ul);
61  BOOST_CHECK(e.removeCachedProduct(hi));
62  BOOST_CHECK(!hi.isValid());
63 }
64 
65 void
67 {
69  BOOST_CHECK(!hi.isValid());
70  BOOST_CHECK(!sr.removeCachedProduct(hi));
71  sr.getByLabel("m2", hi);
72  BOOST_CHECK(hi.isValid());
73  BOOST_CHECK_EQUAL(hi->value, 1);
74  BOOST_CHECK(sr.removeCachedProduct(hi));
75  BOOST_CHECK(!hi.isValid());
76 }
77 
78 void
80 {
82  BOOST_CHECK(!hi.isValid());
83  BOOST_CHECK(!r.removeCachedProduct(hi));
84  r.getByLabel("m3", hi);
85  BOOST_CHECK(hi.isValid());
86  BOOST_CHECK_EQUAL(hi->value, 2);
87  BOOST_CHECK(r.removeCachedProduct(hi));
88  BOOST_CHECK(!hi.isValid());
89 }
90 
TestRemoveCachedProduct & operator=(TestRemoveCachedProduct const &)=delete
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
Definition: Run.h:21
void endSubRun(art::SubRun const &sr) override
bool isValid() const
Definition: Handle.h:190
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:435
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
bool removeCachedProduct(Handle< PROD > &) const
Definition: DataViewImpl.h:951
p
Definition: test.py:228
void analyze(art::Event const &e) override
TestRemoveCachedProduct(fhicl::ParameterSet const &p)
void endRun(art::Run const &r) override
static const double sr
Definition: Units.h:167