Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:29

0001 #include "DataFormats/Provenance/interface/ProcessConfiguration.h"
0002 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/Utilities/interface/Exception.h"
0005 
0006 #include <cassert>
0007 #include <iostream>
0008 #include <string>
0009 
0010 int main() try {
0011   edm::ParameterSet dummyPset;
0012   dummyPset.registerIt();
0013   edm::ParameterSetID id = dummyPset.id();
0014   {
0015     edm::ProcessConfiguration pc1;
0016     pc1.setParameterSetID(id);
0017     assert(pc1 == pc1);
0018   }
0019   {
0020     edm::ProcessConfiguration pc1;
0021     edm::ProcessConfiguration pc2;
0022     pc1.setParameterSetID(id);
0023     pc2.setParameterSetID(id);
0024     assert(pc1 == pc2);
0025   }
0026   {
0027     edm::ProcessConfiguration pc1;
0028     edm::ProcessConfiguration pc2("reco2", edm::ParameterSetID(), std::string(), std::string());
0029     edm::ProcessConfiguration pc3("reco3", edm::ParameterSetID(), std::string(), std::string());
0030     edm::ProcessConfiguration pc4("reco2", edm::ParameterSetID(), std::string(), std::string());
0031     pc1.setParameterSetID(id);
0032     pc2.setParameterSetID(id);
0033     pc3.setParameterSetID(id);
0034     pc4.setParameterSetID(id);
0035     edm::ProcessConfigurationID id1 = pc1.id();
0036     edm::ProcessConfigurationID id2 = pc2.id();
0037     edm::ProcessConfigurationID id3 = pc3.id();
0038 
0039     assert(id1 != id2);
0040     assert(id2 != id3);
0041     assert(id3 != id1);
0042 
0043     edm::ProcessConfigurationID id4 = pc4.id();
0044     assert(pc4 == pc2);
0045     assert(id4 == id2);
0046   }
0047   return 0;
0048 } catch (cms::Exception const& e) {
0049   std::cerr << e.explainSelf() << std::endl;
0050   return 1;
0051 } catch (std::exception const& e) {
0052   std::cerr << e.what() << std::endl;
0053   return 1;
0054 }