File indexing completed on 2024-04-06 12:05:07
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 #include "catch.hpp"
0008
0009 TEST_CASE("test Parentage", "[Parentage]") {
0010 edm::Parentage ed1;
0011 CHECK(ed1 == ed1);
0012 edm::Parentage ed2;
0013 CHECK(ed1 == ed2);
0014
0015 ed2.setParents(std::vector<edm::BranchID>(1));
0016 edm::Parentage ed3;
0017 ed3.setParents(std::vector<edm::BranchID>(2));
0018
0019 edm::ParentageID id1 = ed1.id();
0020 edm::ParentageID id2 = ed2.id();
0021 edm::ParentageID id3 = ed3.id();
0022
0023 CHECK(id1 != id2);
0024 CHECK(ed1 != ed2);
0025 CHECK(id1 != id3);
0026 CHECK(ed1 != ed3);
0027 CHECK(id2 != id3);
0028 CHECK(ed2 != ed3);
0029
0030 edm::Parentage ed4;
0031 ed4.setParents(std::vector<edm::BranchID>(1));
0032 edm::ParentageID id4 = ed4.id();
0033 CHECK(ed4 == ed2);
0034 CHECK(id4 == id2);
0035 }