Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:55:04

0001 #include <cppunit/extensions/HelperMacros.h>
0002 
0003 #include "DetectorDescription/DDCMS/interface/ExpandedNodes.h"
0004 
0005 #include <iostream>
0006 
0007 #include "cppunit/TestAssert.h"
0008 #include "cppunit/TestFixture.h"
0009 
0010 using namespace cms;
0011 using namespace std;
0012 
0013 class testExpandedNodes : public CppUnit::TestFixture {
0014   CPPUNIT_TEST_SUITE(testExpandedNodes);
0015   CPPUNIT_TEST(checkExpandedNodes);
0016   CPPUNIT_TEST_SUITE_END();
0017 
0018 public:
0019   void setUp() override;
0020   void tearDown() override {}
0021   void checkExpandedNodes();
0022 
0023 private:
0024   ExpandedNodes nodes_;
0025 };
0026 
0027 CPPUNIT_TEST_SUITE_REGISTRATION(testExpandedNodes);
0028 
0029 void testExpandedNodes::setUp() {
0030   nodes_.tags = {1., 2., 3.};
0031   nodes_.offsets = {1., 2., 3.};
0032   nodes_.copyNos = {1, 2, 3};
0033 }
0034 
0035 void testExpandedNodes::checkExpandedNodes() {
0036   cout << "Expanded Nodes...\n";
0037   CPPUNIT_ASSERT(nodes_.tags.size() == nodes_.offsets.size());
0038   CPPUNIT_ASSERT(nodes_.tags.size() == nodes_.copyNos.size());
0039 
0040   for (auto const& i : nodes_.tags)
0041     cout << i << " ";
0042 }