Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-19 01:43:34

0001 //#define CATCH_CONFIG_MAIN
0002 #include "catch.hpp"
0003 #include "FWCore/Common/interface/OutputProcessBlockHelper.h"
0004 #include "FWCore/Common/interface/ProcessBlockHelper.h"
0005 #include "FWCore/Common/interface/SubProcessBlockHelper.h"
0006 
0007 #include <string>
0008 #include <vector>
0009 
0010 TEST_CASE("Test ProcessBlockHelpers", "[ProcessBlockHelpers]") {
0011   const std::string testString("ADD");
0012   const std::vector<std::string> testNames = {{"HLT"}, {"RECO"}, {"TEST"}};
0013   const std::vector<std::string> testNames2 = {{"MERGE"}, {"ANA"}, {"HARVEST"}};
0014 
0015   SECTION("OutputProcessBlockHelper") { edm::OutputProcessBlockHelper outputProcessBlockHelper; }
0016 
0017   SECTION("ProcessBlockHelper") {
0018     edm::ProcessBlockHelper processBlockHelper;
0019     processBlockHelper.setProcessesWithProcessBlockProducts(testNames);
0020     REQUIRE(processBlockHelper.processesWithProcessBlockProducts() == testNames);
0021     processBlockHelper.emplaceBackProcessName(testString);
0022     std::vector<std::string> testEmplace = testNames;
0023     testEmplace.emplace_back(testString);
0024     REQUIRE(processBlockHelper.processesWithProcessBlockProducts() == testEmplace);
0025 
0026     processBlockHelper.setAddedProcesses(testNames2);
0027     REQUIRE(processBlockHelper.addedProcesses() == testNames2);
0028     processBlockHelper.emplaceBackAddedProcessName(testString);
0029     std::vector<std::string> testEmplace2 = testNames2;
0030     testEmplace2.emplace_back(testString);
0031     REQUIRE(processBlockHelper.addedProcesses() == testEmplace2);
0032 
0033     REQUIRE(edm::ProcessBlockHelper::invalidCacheIndex() == 0xffffffff);
0034     REQUIRE(edm::ProcessBlockHelper::invalidProcessIndex() == 0xffffffff);
0035   }
0036 
0037   SECTION("SubProcessBlockHelper") { edm::SubProcessBlockHelper subProcessBlockHelper; }
0038 }