Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:34

0001 #include "DataFormats/Provenance/interface/Parentage.h"
0002 #include "DataFormats/Provenance/interface/BranchID.h"
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 #include <cassert>
0005 #include <iostream>
0006 
0007 int main() {
0008   edm::Parentage ed1;
0009   assert(ed1 == ed1);
0010   edm::Parentage ed2;
0011   assert(ed1 == ed2);
0012 
0013   ed2.setParents(std::vector<edm::BranchID>(1));
0014   edm::Parentage ed3;
0015   ed3.setParents(std::vector<edm::BranchID>(2));
0016 
0017   try {
0018     edm::ParentageID id1 = ed1.id();
0019     edm::ParentageID id2 = ed2.id();
0020     edm::ParentageID id3 = ed3.id();
0021 
0022     assert(id1 != id2);
0023     assert(ed1 != ed2);
0024     assert(id1 != id3);
0025     assert(ed1 != ed3);
0026     assert(id2 != id3);
0027     assert(ed2 != ed3);
0028 
0029     edm::Parentage ed4;
0030     ed4.setParents(std::vector<edm::BranchID>(1));
0031     edm::ParentageID id4 = ed4.id();
0032     assert(ed4 == ed2);
0033     assert(id4 == id2);
0034   } catch (cms::Exception const& e) {
0035     std::cerr << e.explainSelf() << std::endl;
0036     return 1;
0037   }
0038 
0039   return 0;
0040 }