#include <TestHelpers.h>
Definition at line 88 of file TestHelpers.h.
◆ TestHelpers()
| toolbox::particles::assignmentchecks::tests::TestHelpers::TestHelpers |
( |
| ) |
|
◆ run()
| virtual void toolbox::particles::assignmentchecks::tests::TestHelpers::run |
( |
| ) |
|
|
overridevirtual |
◆ testAddingParticleEvents()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testAddingParticleEvents |
( |
| ) |
|
|
private |
Test the adding of particle events to the database.
This also serves as a unit test for all possible events: I let the particles run through some meaningless mesh sweeps, and add all the event types.
Here, I only use static particles, so the identifier remains the same all the time. Switching particle identifiers will be done in a separate test. We're also adding events without them having any meaning. Proper event tracing including consistency checks will also be done later.
◆ testAddingParticleMovingEvents()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testAddingParticleMovingEvents |
( |
int | nsweeps = 100, |
|
|
int | nEventsToKeep = 1000 ) |
|
private |
Test the adding of particle events to the database with a moving particle.
The catch is twofold: Firstly, the fuzzy search needs to work. Secondly, a moving particle will eventually need to change its identifier in the database. This tests both of these cases, but not the event deletion when the database becomes too large.
We're also adding events without them having any meaning. Proper event tracing including consistency checks will also be done in a different test.
Note that this stupidly just adds new move events to the database. This is not what we do in the actual tracing, where consecutive move events are compacted into a single one. That too will be tested in different test methods. Here we just test the adding of events and the replacement of the identifier once a particle has moved too much.
- Parameters
-
| nsweeps | How many mesh sweeps to simulate. |
| nEventsToKeep | How many events per particle the database should keep. If < nsweeps, then events from the database will be purged. |
◆ testAddingSweepsToDatabase()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testAddingSweepsToDatabase |
( |
| ) |
|
|
private |
Make sure that adding mesh sweeps to the database works.
◆ testParticleLiftDrop()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testParticleLiftDrop |
( |
| ) |
|
|
private |
Test a particle being assigned up and down the vertex hierarchy.
◆ testParticleMoveEvents()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testParticleMoveEvents |
( |
| ) |
|
|
private |
Test adding move events of particles.
Calls testAddingParticleMovingEvents() with different configurations.
◆ testParticleWalk()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testParticleWalk |
( |
| ) |
|
|
private |
Test a particle walking through the box using lift-drop vertex assignments.
◆ testParticleWalkSameTreeLevel()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testParticleWalkSameTreeLevel |
( |
| ) |
|
|
private |
Test a particle walking from vertex to vertex on the same depth of the tree, i.e.
assignments from vertex to vertex without lifts and drops.
◆ testPeriodicBoundaryConditions()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testPeriodicBoundaryConditions |
( |
| ) |
|
|
private |
Particles are identified in the events database using their unique ID.
However, if we have periodic boundary conditions, we may find that particles with the same ID exist several times on the same tree, on either side of the boundary, provided the tree spans both edges of the domain. So check that we indeed find the correct ancestors.
◆ testPeriodicBoundaryConditionsCorner()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testPeriodicBoundaryConditionsCorner |
( |
| ) |
|
|
private |
Test the periodic boundary conditions of a particle in a corner, being replicated to any other corner of the box.
The assignment checks struggled with PBCs in the past, and they also had several bugs in it. So this test should prevent them from reoccurring. We assume that particles never cross the boundary.
◆ testRemovingParticleEvents()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testRemovingParticleEvents |
( |
| ) |
|
|
private |
Test the removal of particle events once their history gets too long.
◆ testSieveSet()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testSieveSet |
( |
| ) |
|
|
private |
Test particle assignments to sieve sets.
◆ testTruthTableSearchAndIDKeys()
| void toolbox::particles::assignmentchecks::tests::TestHelpers::testTruthTableSearchAndIDKeys |
( |
| ) |
|
|
private |
Test whether ParticleIdentifier and ParticleSearchIdentifier work as intended in a map for a fuzzy search.
The documentation for this class was generated from the following file: