SORTIE C++ Test Documentation
Public Member Functions | Protected Member Functions | List of all members
clTestStormKiller Class Reference

Tests the clStormKiller class. More...

#include <TestStormKiller.h>

Inheritance diagram for clTestStormKiller:

Public Member Functions

void TestStormKiller ()
 Assembles all other testing functions into one test.
 

Protected Member Functions

void TestNormalProcessingRun1 (clSimManager *p_oSimManager)
 Tests normal processing.
 
void TestNormalProcessingRun2 (clSimManager *p_oSimManager)
 Tests normal processing.
 
void TestNormalProcessingRun3 (clSimManager *p_oSimManager)
 Tests normal processing.
 
void TestRun1Timestep1 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 1 of TestNormalProcessingRun1().
 
void TestRun1Timestep2 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 2 of TestNormalProcessingRun1().
 
void TestRun1Timestep3 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 3 of TestNormalProcessingRun1().
 
void TestRun1Timestep4 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 4 of TestNormalProcessingRun1().
 
void TestRun1Timestep5 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 5 of TestNormalProcessingRun1().
 
void TestRun3Timestep1 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 1 of TestNormalProcessingRun3().
 
void TestRun3Timestep2 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 2 of TestNormalProcessingRun3().
 
void TestRun3Timestep3 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 3 of TestNormalProcessingRun3().
 
void TestRun3Timestep4 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 4 of TestNormalProcessingRun3().
 
void TestRun3Timestep5 (clTreePopulation *p_oPop)
 Checks the expected results for timestep 5 of TestNormalProcessingRun3().
 
void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
 
const char * WriteXMLFile1 ()
 Writes the parameter file for TestNormalProcessing1().
 
const char * WriteXMLFile2 ()
 Writes the parameter file for TestNormalProcessing2().
 
const char * WriteXMLFile3 ()
 Writes the parameter file for TestNormalProcessing3().
 
const char * WriteXMLErrorFile1 ()
 Writes an error file where the storm behavior is not also enabled.
 
const char * WriteXMLErrorFile2 ()
 Writes an error file where the storm killer behavior is applied to seedlings.
 
const char * WriteXMLErrorFile3 ()
 Writes an error file where the storm damage applier behavior is not also enabled.
 
const char * WriteXMLErrorFile4 ()
 Writes an error file where the proportion of fully damaged trees that tip up is not a proportion.
 
const char * WriteXMLErrorFile5 ()
 Writes an error file where the max snag lifespan is negative.
 
const char * WriteXMLErrorFile6 ()
 Writes an error file where mortality behaviors aren't applied to all storm trees.
 
void WriteCommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files.
 
void WriteSnagBehaviorList (std::fstream &oOut)
 Writes a behavior list with snags.
 
void WriteNoSnagBehaviorList (std::fstream &oOut)
 Writes a behavior list with no snags.
 
void WriteStormParameters (std::fstream &oOut)
 Writes common storm parameters.
 

Detailed Description

Tests the clStormKiller class.

Member Function Documentation

void clTestStormKiller::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing.

Exceptions
errorif any of the errors are not caught, or an error other than the intended error is thrown by a parameter file.
void clTestStormKiller::TestNormalProcessingRun1 ( clSimManager *  p_oSimManager)
protected

Tests normal processing.

WriteXMLFile1() writes the parameter file. Aspects of the run:

  • Grid resolution of "Storm Damage" is default.
  • Run is 5 timesteps.
  • 1 year per timestep.
  • Snags are present in the run.
  • The following trees will be added:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 0.
    • Grid (0,1): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 1000.
    • Grid (0,2): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 2000.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 0.
    • Grid (1,1): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 1000.
    • Grid (1,2): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 2000.
    • All grids get 100 trees of DBH 4, Species 1, and DBH 5, Species 2, which are never damaged or killed.
    • All grids get 100 trees of DBH 20, Species 1, Snag, which are never removed.

The run proceeds for 5 timesteps and the number of trees with each damage counter is checked through time.

Parameters
p_oSimManagerSim Manager object to run our test run.
void clTestStormKiller::TestNormalProcessingRun2 ( clSimManager *  p_oSimManager)
protected

Tests normal processing.

WriteXMLFile2() writes the parameter file. Aspects of the run:

  • Grid resolution of "Storm Damage" is default.
  • Run is 3 timesteps.
  • 3 year per timestep.
  • Snags are present in the run.
  • The following trees will be added:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 0.
    • Grid (0,1): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 1000.
    • Grid (0,2): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 2000.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 0.
    • Grid (1,1): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 1000.
    • Grid (1,2): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 2000.
    • All grids get 100 trees of DBH 4, Species 1, and DBH 5, Species 2, which are never damaged or killed.
    • All grids get 100 trees of DBH 20, Species 1, Snag, which are never removed.

The run proceeds for 3 timesteps and the number of trees with each damage counter is checked through time.

Parameters
p_oSimManagerSim Manager object to run our test run.
void clTestStormKiller::TestNormalProcessingRun3 ( clSimManager *  p_oSimManager)
protected

Tests normal processing.

WriteXMLFile3() writes the parameter file. Aspects of the run:

  • Grid resolution of "Storm Damage" is default.
  • Run is 3 timesteps.
  • 3 year per timestep.
  • No snags in the run.
  • The following trees will be added:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 0.
    • Grid (0,1): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 1000.
    • Grid (0,2): 1000 trees of Species 1 and 2, DBH 30. Damage counter is 2000.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 0.
    • Grid (1,1): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 1000.
    • Grid (1,2): 1000 trees of Species 1 and 2, DBH 8. Damage counter is 2000.
    • All grids get 100 trees of DBH 4, Species 1, and DBH 5, Species 2, which are never damaged or killed.
    • All grids get 100 trees of DBH 20, Species 1, Snag, which are never removed.

The run proceeds for 5 timesteps and the number of trees with each damage counter is checked through time.

Parameters
p_oSimManagerSim Manager object to run our test run.
void clTestStormKiller::TestRun1Timestep1 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 1 of TestNormalProcessingRun1().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun1Timestep2 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 2 of TestNormalProcessingRun1().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun1Timestep3 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 3 of TestNormalProcessingRun1().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun1Timestep4 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 4 of TestNormalProcessingRun1().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun1Timestep5 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 5 of TestNormalProcessingRun1().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun3Timestep1 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 1 of TestNormalProcessingRun3().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun3Timestep2 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 2 of TestNormalProcessingRun3().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun3Timestep3 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 3 of TestNormalProcessingRun3().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun3Timestep4 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 4 of TestNormalProcessingRun3().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestRun3Timestep5 ( clTreePopulation *  p_oPop)
protected

Checks the expected results for timestep 5 of TestNormalProcessingRun3().

Parameters
p_oPopTree population object.
void clTestStormKiller::TestStormKiller ( )

Assembles all other testing functions into one test.

void clTestStormKiller::WriteCommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files.

Starts with <randomSeed> and ends with </allometry>.

Parameters
oOutFile stream to write to.
void clTestStormKiller::WriteNoSnagBehaviorList ( std::fstream &  oOut)
protected

Writes a behavior list with no snags.

Parameters
oOutFile stream to write to.
void clTestStormKiller::WriteSnagBehaviorList ( std::fstream &  oOut)
protected

Writes a behavior list with snags.

Parameters
oOutFile stream to write to.
void clTestStormKiller::WriteStormParameters ( std::fstream &  oOut)
protected

Writes common storm parameters.

Starts with <storm> and ends with </storm>.

Parameters
oOutFile stream to write to.
const char* clTestStormKiller::WriteXMLErrorFile1 ( )
protected

Writes an error file where the storm behavior is not also enabled.

(By necessity the storm damage applier behavior is not enabled either, otherwise it would catch the error.)

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLErrorFile2 ( )
protected

Writes an error file where the storm killer behavior is applied to seedlings.

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLErrorFile3 ( )
protected

Writes an error file where the storm damage applier behavior is not also enabled.

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLErrorFile4 ( )
protected

Writes an error file where the proportion of fully damaged trees that tip up is not a proportion.

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLErrorFile5 ( )
protected

Writes an error file where the max snag lifespan is negative.

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLErrorFile6 ( )
protected

Writes an error file where mortality behaviors aren't applied to all storm trees.

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLFile1 ( )
protected

Writes the parameter file for TestNormalProcessing1().

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLFile2 ( )
protected

Writes the parameter file for TestNormalProcessing2().

Returns
File name of the freshly written parameter file.
const char* clTestStormKiller::WriteXMLFile3 ( )
protected

Writes the parameter file for TestNormalProcessing3().

Returns
File name of the freshly written parameter file.

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