Skip to content

Commit

Permalink
Merge pull request #44018 from Dr15Jones/unittest_cleanup_Provenance
Browse files Browse the repository at this point in the history
Moved Parentage unit test to catch2
  • Loading branch information
cmsbuild authored Feb 21, 2024
2 parents c766dc7 + e9d529e commit f9548da
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 229 deletions.
13 changes: 1 addition & 12 deletions DataFormats/Provenance/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
<bin name="testDataFormatsProvenance" file="testRunner.cpp,eventid_t.cppunit.cc,timestamp_t.cppunit.cc,parametersetid_t.cppunit.cc,indexIntoFile_t.cppunit.cc,indexIntoFile1_t.cppunit.cc,indexIntoFile2_t.cppunit.cc,indexIntoFile3_t.cppunit.cc,indexIntoFile4_t.cppunit.cc,indexIntoFile5_t.cppunit.cc,lumirange_t.cppunit.cc,eventrange_t.cppunit.cc,compactEventAuxiliaryVector_t.cppunit.cc">
</bin>

<bin file="EntryDescription_t.cpp">
</bin>

<bin file="ElementID_t.cpp">
<use name="catch2"/>
</bin>

<bin file="StoredProcessBlockHelper_t.cpp">
<bin name="testDataFormatsProvenanceCatch2" file="ElementID_t.cpp,Parentage_t.cpp,StoredProcessBlockHelper_t.cpp">
<use name="catch2"/>
</bin>

<bin name="testProductResolverIndexHelper" file="testRunner.cpp productResolverIndexHelper_t.cppunit.cc">
<use name="DataFormats/TestObjects"/>
</bin>

<bin name="productResolverIndexHelperTest" file="productResolverIndexHelperTest.cc">
<flags NO_TESTRUN="1"/>
</bin>
40 changes: 0 additions & 40 deletions DataFormats/Provenance/test/EntryDescription_t.cpp

This file was deleted.

35 changes: 35 additions & 0 deletions DataFormats/Provenance/test/Parentage_t.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "DataFormats/Provenance/interface/Parentage.h"
#include "DataFormats/Provenance/interface/BranchID.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <cassert>
#include <iostream>

#include "catch.hpp"

TEST_CASE("test Parentage", "[Parentage]") {
edm::Parentage ed1;
CHECK(ed1 == ed1);
edm::Parentage ed2;
CHECK(ed1 == ed2);

ed2.setParents(std::vector<edm::BranchID>(1));
edm::Parentage ed3;
ed3.setParents(std::vector<edm::BranchID>(2));

edm::ParentageID id1 = ed1.id();
edm::ParentageID id2 = ed2.id();
edm::ParentageID id3 = ed3.id();

CHECK(id1 != id2);
CHECK(ed1 != ed2);
CHECK(id1 != id3);
CHECK(ed1 != ed3);
CHECK(id2 != id3);
CHECK(ed2 != ed3);

edm::Parentage ed4;
ed4.setParents(std::vector<edm::BranchID>(1));
edm::ParentageID id4 = ed4.id();
CHECK(ed4 == ed2);
CHECK(id4 == id2);
}
1 change: 0 additions & 1 deletion DataFormats/Provenance/test/StoredProcessBlockHelper_t.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"

#include "DataFormats/Provenance/interface/EventToProcessBlockIndexes.h"
Expand Down
176 changes: 0 additions & 176 deletions DataFormats/Provenance/test/productResolverIndexHelperTest.cc

This file was deleted.

0 comments on commit f9548da

Please sign in to comment.