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

Tests the clWindstorm class. More...

#include <TestWindstorm.h>

Inheritance diagram for clTestWindstorm:

Public Member Functions

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

Protected Member Functions

void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
 
void TestNormalProcessingRun1 (clSimManager *p_oSimManager)
 Tests normal processing Run 1.
 
void TestNormalProcessingRun2 (clSimManager *p_oSimManager)
 Tests normal processing Run 2.
 
void TestNormalProcessingRun3 (clSimManager *p_oSimManager)
 Tests normal processing Run 3.
 
void TestNormalProcessingRun4 (clSimManager *p_oSimManager)
 Tests normal processing Run 4.
 
void TestNormalProcessingRun5 (clSimManager *p_oSimManager)
 Tests normal processing Run 5.
 
void TestNormalProcessingRun6 (clSimManager *p_oSimManager)
 Tests normal processing Run 6.
 
void TestNormalProcessingRun7 (clSimManager *p_oSimManager)
 Tests normal processing Run 7.
 
void TestNormalProcessingRun8 (clSimManager *p_oSimManager)
 Tests normal processing Run 8.
 
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 * WriteXMLFile4 ()
 Writes the parameter file for TestNormalProcessing4().
 
const char * WriteXMLFile5 ()
 Writes the parameter file for TestNormalProcessing5().
 
const char * WriteXMLFile6 ()
 Writes the parameter file for TestNormalProcessing6().
 
const char * WriteXMLFile7 ()
 Writes the parameter file for TestNormalProcessing7().
 
const char * WriteXMLFile8 ()
 Writes the parameter file for TestNormalProcessing8().
 
const char * WriteXMLErrorFile1 ()
 Writes an error file where the minimum DBH is negative.
 
const char * WriteXMLErrorFile2 ()
 Writes an error file where the storm damage applier behavior is applied to seedlings.
 
const char * WriteXMLErrorFile3 ()
 Writes an error file where the timestep to start storms is negative.
 
const char * WriteXMLErrorFile4 ()
 Writes an error file where the severity of a storm return interval is not between 0 and 1.
 
const char * WriteXMLErrorFile5 ()
 Writes an error file where mortality behaviors are not applied to all trees.
 
const char * WriteXMLErrorFile6 ()
 Writes an error file where the storm periodicity is zero.
 
void WriteCommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files.
 
void WriteSnagBehaviorList (std::fstream &oOut)
 Writes the behavior list for the test parameter files with snags.
 
void WriteNoSnagBehaviorList (std::fstream &oOut)
 Writes the behavior list for the test parameter files without snags.
 

Detailed Description

Tests the clWindstorm class.

Member Function Documentation

void clTestWindstorm::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing.

void clTestWindstorm::TestNormalProcessingRun1 ( clSimManager *  p_oSimManager)
protected

Tests normal processing Run 1.

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

  • 1 year per timestep.
  • Snag run.
  • This run tests correct damage calculation and killing.
  • The following trees will be added, with a storm of 0.2 triggered for timestep 1:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8.
    • All grids get 1000 trees of DBH 4, Species 1, and DBH 5, Species 2.

The run proceeds for 1 timestep. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well.

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

Tests normal processing Run 2.

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

  • 1 year per timestep.
  • Snag run.
  • This run tests correct damage calculation and killing.
  • The following trees will be added, with a storm of 0.8 triggered for timestep 1:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8.
    • All grids get 1000 trees of DBH 4, Species 1, and DBH 5, Species 2.

The run proceeds for 1 timestep. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well.

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

Tests normal processing Run 3.

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

  • 3 years per timestep.
  • Snag run.
  • This run tests multiple storms per timestep, and making sure dead trees are ignored.
  • The following trees will be added, with 3 storms of 0.2 triggered for timestep 1:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8.

The run proceeds for 1 timestep. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well.

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

Tests normal processing Run 4.

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

  • 1 year per timestep.
  • No snags.
  • This run tests correct handling when there are no snags.
  • The following trees will be added, with a storm of 0.4 triggered for timestep 1:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8.
    • All grids get 1000 trees of DBH 4, Species 1, and DBH 5, Species 2.

The run proceeds for 1 timestep. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well.

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

Tests normal processing Run 5.

WriteXMLFile5() writes the parameter file. Storm severities for all return intervals are 0, and this makes sure that no storms occur.

The run proceeds for 1 timestep. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well to make sure nothing died.

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

Tests normal processing Run 6.

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

  • 1 year per timestep.
  • No snags.
  • This run tests when storms don't start at timestep 1.
  • The following trees will be added, with a storm of 0.5 triggered for timestep 2:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8.

The run proceeds for 2 timesteps. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well. No storm should occur for timestep 1.

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

Tests normal processing Run 7.

WriteXMLFile7() writes the parameter file. This run tests to make sure the "Windstorm Results" grid is refreshed for each timestep.

The 1 year return interval is 0. This runs for 2 timesteps, and verifies that the results for the two in the "Windstorm Results" grid are different.

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

Tests normal processing Run 8.

WriteXMLFile8() writes the parameter file. This run tests to make sure storms below the minimum intensity are handled correctly. Aspects of the run:

  • 1 year per timestep.
  • No snags.
  • The following trees will be added, with a storm of 0.07 triggered for timestep 1:
    • Grid (0,0): 1000 trees of Species 1 and 2, DBH 30.
    • Grid (1,0): 1000 trees of Species 1 and 2, DBH 8.

The run proceeds for 1 timestep. The "Windstorm Results" grid is checked, and the actual number of trees alive and dead is checked as well.

Parameters
p_oSimManagerSim Manager object to run our test run.
void clTestWindstorm::TestWindstorm ( )

Assembles all other testing functions into one test.

void clTestWindstorm::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 clTestWindstorm::WriteNoSnagBehaviorList ( std::fstream &  oOut)
protected

Writes the behavior list for the test parameter files without snags.

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

Writes the behavior list for the test parameter files with snags.

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

Writes an error file where the minimum DBH is negative.

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

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

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

Writes an error file where the timestep to start storms is negative.

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

Writes an error file where the severity of a storm return interval is not between 0 and 1.

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

Writes an error file where mortality behaviors are not applied to all trees.

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

Writes an error file where the storm periodicity is zero.

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

Writes the parameter file for TestNormalProcessing1().

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

Writes the parameter file for TestNormalProcessing2().

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

Writes the parameter file for TestNormalProcessing3().

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

Writes the parameter file for TestNormalProcessing4().

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

Writes the parameter file for TestNormalProcessing5().

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

Writes the parameter file for TestNormalProcessing6().

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

Writes the parameter file for TestNormalProcessing7().

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

Writes the parameter file for TestNormalProcessing8().

Returns
File name of the freshly written parameter file.

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