-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,44 @@ | ||
#include <cppunit/extensions/HelperMacros.h> | ||
|
||
#include "DetectorDescription/DDCMS/interface/DDFilteredView.h" | ||
#include "DetectorDescription/DDCMS/interface/DDDetector.h" | ||
#include "FWCore/ParameterSet/interface/FileInPath.h" | ||
#include "DD4hep/Detector.h" | ||
|
||
#include <string> | ||
#include <memory> | ||
|
||
#include "cppunit/TestAssert.h" | ||
#include "cppunit/TestFixture.h" | ||
|
||
using namespace cms; | ||
using namespace std; | ||
|
||
class testDDFilteredView : public CppUnit::TestFixture { | ||
|
||
CPPUNIT_TEST_SUITE(testDDFilteredView); | ||
CPPUNIT_TEST(checkFilteredView); | ||
CPPUNIT_TEST_SUITE_END(); | ||
|
||
public: | ||
|
||
void setUp() override {} | ||
void setUp() override; | ||
void tearDown() override {} | ||
void checkFilteredView(); | ||
|
||
private: | ||
|
||
string fileName_; | ||
}; | ||
|
||
CPPUNIT_TEST_SUITE_REGISTRATION(testDDFilteredView); | ||
|
||
void testDDFilteredView::setUp() { | ||
fileName_ = edm::FileInPath("DetectorDescription/DDCMS/data/cms-2015-muon-geometry.xml").fullPath(); | ||
} | ||
|
||
void testDDFilteredView::checkFilteredView() | ||
{ | ||
cms::DDFilteredView fview(); | ||
unique_ptr<DDDetector> det = make_unique<DDDetector>("DUMMY", fileName_); | ||
DDFilteredView fview(det.get(), det->description()->worldVolume()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <cppunit/extensions/HelperMacros.h> | ||
|
||
#include "DetectorDescription/DDCMS/interface/ExpandedNodes.h" | ||
|
||
#include <iostream> | ||
|
||
#include "cppunit/TestAssert.h" | ||
#include "cppunit/TestFixture.h" | ||
|
||
using namespace cms; | ||
using namespace std; | ||
|
||
class testExpandedNodes : public CppUnit::TestFixture { | ||
|
||
CPPUNIT_TEST_SUITE(testExpandedNodes); | ||
CPPUNIT_TEST(checkExpandedNodes); | ||
CPPUNIT_TEST_SUITE_END(); | ||
|
||
public: | ||
|
||
void setUp() override; | ||
void tearDown() override {} | ||
void checkExpandedNodes(); | ||
|
||
private: | ||
ExpandedNodes nodes_; | ||
}; | ||
|
||
CPPUNIT_TEST_SUITE_REGISTRATION(testExpandedNodes); | ||
|
||
void | ||
testExpandedNodes::setUp() { | ||
nodes_.tags = { 1., 2., 3. }; | ||
nodes_.offsets = { 1., 2., 3. }; | ||
nodes_.copyNos = { 1, 2, 3 }; | ||
} | ||
|
||
void | ||
testExpandedNodes::checkExpandedNodes() { | ||
cout << "Expanded Nodes...\n"; | ||
CPPUNIT_ASSERT(nodes_.tags.size() == nodes_.offsets.size()); | ||
CPPUNIT_ASSERT(nodes_.tags.size() == nodes_.copyNos.size()); | ||
|
||
for(auto const& i : nodes_.tags) | ||
cout << i << " "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters