Public Member Functions | Public Attributes | Private Member Functions | List of all members
TestMapOfVectors Class Reference
Inheritance diagram for TestMapOfVectors:

Public Member Functions

 TestMapOfVectors ()
 
 ~TestMapOfVectors ()
 
void setUp ()
 
void tearDown ()
 
void default_ctor ()
 
void filling ()
 
void find ()
 
void iterator ()
 

Public Attributes

TheMap om
 
unsigned int tot
 

Private Member Functions

 CPPUNIT_TEST_SUITE (TestMapOfVectors)
 
 CPPUNIT_TEST (default_ctor)
 
 CPPUNIT_TEST (filling)
 
 CPPUNIT_TEST (find)
 
 CPPUNIT_TEST (iterator)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 16 of file MapOfVectors_t.cpp.

Constructor & Destructor Documentation

TestMapOfVectors::TestMapOfVectors ( )

Definition at line 47 of file MapOfVectors_t.cpp.

47  {
48  int v[10] = {0,1,2,3,4,5,6,7,8,9};
49  tot=0;
50  for (int i=0;i<10;++i) {
51  tot+=i;
52  om[i].resize(i);
53  std::copy(v,v+i,om[i].begin());
54  }
55 
56 }
unsigned int tot
auto begin(Data< Value > const &data)
T copy(T const &v)
TestMapOfVectors::~TestMapOfVectors ( )

Definition at line 58 of file MapOfVectors_t.cpp.

58 {}

Member Function Documentation

TestMapOfVectors::CPPUNIT_TEST ( default_ctor  )
private
TestMapOfVectors::CPPUNIT_TEST ( filling  )
private
TestMapOfVectors::CPPUNIT_TEST ( find  )
private
TestMapOfVectors::CPPUNIT_TEST ( iterator  )
private
TestMapOfVectors::CPPUNIT_TEST_SUITE ( TestMapOfVectors  )
private
TestMapOfVectors::CPPUNIT_TEST_SUITE_END ( )
private
void TestMapOfVectors::default_ctor ( )

Definition at line 61 of file MapOfVectors_t.cpp.

61  {
62  MII m;
63  CPPUNIT_ASSERT(m.size()==0);
64  CPPUNIT_ASSERT(m.empty());
65  CPPUNIT_ASSERT(m.m_keys.size()==0);
66  CPPUNIT_ASSERT(m.m_offsets.size()==1);
67  CPPUNIT_ASSERT(m.m_offsets[0]==0);
68  CPPUNIT_ASSERT(m.m_data.size()==0);
69 
70 }
static const double m
Definition: Units.h:79
art::MapOfVectors< int, int > MII
void TestMapOfVectors::filling ( )

Definition at line 72 of file MapOfVectors_t.cpp.

72  {
73  MII m(om);
74  CPPUNIT_ASSERT(m.size()==om.size());
75  CPPUNIT_ASSERT(!m.empty());
76  CPPUNIT_ASSERT(m.m_keys.size()==om.size());
77  CPPUNIT_ASSERT(m.m_offsets.size()==om.size()+1);
78  CPPUNIT_ASSERT(m.m_offsets[0]==0);
79  CPPUNIT_ASSERT(m.m_offsets[m.size()]==tot);
80  CPPUNIT_ASSERT(m.m_data.size()==tot);
81 }
static const double m
Definition: Units.h:79
unsigned int tot
art::MapOfVectors< int, int > MII
void TestMapOfVectors::find ( )

Definition at line 83 of file MapOfVectors_t.cpp.

83  {
84  MII m(om);
85  CPPUNIT_ASSERT(m.find(-1)==m.emptyRange());
86  for(TheMap::const_iterator p=om.begin(); p!=om.end();++p) {
87  MII::range r = m.find((*p).first);
88  CPPUNIT_ASSERT(int(r.size())==(*p).first);
89  CPPUNIT_ASSERT(std::equal((*p).second.begin(), (*p).second.end(),r.begin()));
90  }
91 }
static const double m
Definition: Units.h:79
art::MapOfVectors< int, int > MII
intermediate_table::const_iterator const_iterator
void TestMapOfVectors::iterator ( )

Definition at line 93 of file MapOfVectors_t.cpp.

93  {
94  MII m(om);
95  TheMap::const_iterator op=om.begin();
96  unsigned int lt=0;
97  for(MII::const_iterator p=m.begin(); p!=m.end();++p) {
98  CPPUNIT_ASSERT((*p).first==(*op).first);
99  CPPUNIT_ASSERT(std::equal((*p).second.begin(), (*p).second.end(),(*op).second.begin()));
100  lt+=(*p).second.size();
101  ++op;
102  }
103  CPPUNIT_ASSERT(lt==tot);
104 }
static const double m
Definition: Units.h:79
unsigned int tot
art::MapOfVectors< int, int > MII
intermediate_table::const_iterator const_iterator
void TestMapOfVectors::setUp ( )
inline

Definition at line 31 of file MapOfVectors_t.cpp.

31 {}
void TestMapOfVectors::tearDown ( )
inline

Definition at line 32 of file MapOfVectors_t.cpp.

32 {}

Member Data Documentation

TheMap TestMapOfVectors::om

Definition at line 39 of file MapOfVectors_t.cpp.

unsigned int TestMapOfVectors::tot

Definition at line 40 of file MapOfVectors_t.cpp.


The documentation for this class was generated from the following file: