12 #include <utl/ShowerParticleList.h>
13 #include <utl/ShowerParticleIterator.h>
16 #include <utl/CoordinateSystem.h>
17 #include <utl/Point.h>
18 #include <utl/Vector.h>
19 #include <utl/AugerException.h>
21 #include <tst/Verify.h>
23 #include <cppunit/extensions/HelperMacros.h>
45 CPPUNIT_TEST(testConstruction);
46 CPPUNIT_TEST(testSettingInterface);
47 CPPUNIT_TEST(testSize);
48 CPPUNIT_TEST(testSTLEqualInitialised);
49 CPPUNIT_TEST(testSTLEqual);
50 CPPUNIT_TEST_SUITE_END();
64 utl::CoordinateSystem::GetRootCoordinateSystem()),
66 utl::CoordinateSystem::GetRootCoordinateSystem()),
68 fFileIterator->AddParticle(p);
69 fInsertedParticles.push_back(p);
75 fCS = utl::CoordinateSystem::GetRootCoordinateSystem();
88 delete fInitialisedParticleList;
95 CPPUNIT_ASSERT(fParticleList->ParticlesBegin(fCS) == fParticleList->ParticlesEnd(fCS));
96 CPPUNIT_ASSERT(fInitialisedParticleList->ParticlesBegin(fCS) != fInitialisedParticleList->ParticlesEnd(fCS));
101 CPPUNIT_ASSERT(fParticleList->ParticlesBegin(fCS) == fParticleList->ParticlesEnd(fCS));
102 fParticleList->SetFileInterface(fFileIterator);
103 CPPUNIT_ASSERT(fParticleList->ParticlesBegin(fCS) != fParticleList->ParticlesEnd(fCS));
104 fParticleList->SetFileInterface(0);
105 CPPUNIT_ASSERT(fParticleList->ParticlesBegin(fCS) == fParticleList->ParticlesEnd(fCS));
110 CPPUNIT_ASSERT(std::distance(fInitialisedParticleList->ParticlesBegin(fCS), fInitialisedParticleList->ParticlesEnd(fCS)) ==
int(fInsertedParticles.size()));
112 fParticleList->SetFileInterface(fFileIterator);
113 CPPUNIT_ASSERT(std::distance(fParticleList->ParticlesBegin(fCS), fParticleList->ParticlesEnd(fCS)) ==
int(fInsertedParticles.size()));
118 vector<Particle>::iterator cur = fInsertedParticles.begin();
120 CPPUNIT_ASSERT(std::equal(fInitialisedParticleList->ParticlesBegin(fCS), fInitialisedParticleList->ParticlesEnd(fCS), cur,
compareNames));
125 vector<Particle>::iterator cur = fInsertedParticles.begin();
127 CPPUNIT_ASSERT(std::equal(fParticleList->ParticlesBegin(fCS), fParticleList->ParticlesEnd(fCS), cur,
compareNames));
std::string GetName() const
string with particle name
Describes a particle for Simulation.
ShowerParticleList * fParticleList
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
static bool compareNames(const Particle &p1, const Particle &p2)
vector< Particle > fInsertedParticles
A TimeInterval is used to represent time elapsed between two events.
ShowerParticleList * fInitialisedParticleList
testShowerFileParticleIterator * fFileIterator
void addParticle(const std::string &)
void testSettingInterface()
Interface class for accessing a list of particles from a shower file.
void testSTLEqualInitialised()