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

Tests the clWeibullSnagMort class. More...

#include <TestWeibullSnagMort.h>

Inheritance diagram for clTestWeibullSnagMort:

Public Member Functions

void TestWeibullSnagMort ()
 Encapsulates all the testing functions together.
 
void TestNormalProcessing (clSimManager *p_oSimManager)
 Tests the mortality classes.
 
void TestExceptionProcessing (clSimManager *p_oSimManager)
 Tests exception processing.
 
void TestBackwardsCompatibility (clSimManager *p_oSimManager)
 This tests backwards compatibility with version 1.0.
 

Protected Member Functions

const char * WriteXMLFile1 ()
 Writes a parameter file with the specifications given for TestWeibullSnagMort(), run 1.
 
const char * WriteXMLFile2 ()
 Writes a parameter file with the specifications given for TestWeibullSnagMort, run 2.
 
const char * WriteXMLFile3 ()
 Writes a parameter file with the specifications given for TestBackwardsCompatibility().
 
const char * WriteXMLErrorFile1 ()
 Writes a file where the size classes overlap.
 
const char * WriteXMLErrorFile2 ()
 Writes a file where a tree type other than snag is assigned to the behavior.
 

Detailed Description

Tests the clWeibullSnagMort class.

Author
Lora E. Murphy

Member Function Documentation

void clTestWeibullSnagMort::TestBackwardsCompatibility ( clSimManager *  p_oSimManager)

This tests backwards compatibility with version 1.0.

This will enter a parameter file where the size class definitions are in the old style as single values. This tests to make sure that the single values are assigned to all species. This runs a test like TestNormalProcessing, if all size classes were the same as species 1. WriteXMLFile3 is used for setup.

void clTestWeibullSnagMort::TestExceptionProcessing ( clSimManager *  p_oSimManager)

Tests exception processing.

Tests the following error conditions:

  • Size classes overlap
  • Behavior assigned to a tree type other than snag
Parameters
p_oSimManagerObject to run the testing.
void clTestWeibullSnagMort::TestNormalProcessing ( clSimManager *  p_oSimManager)

Tests the mortality classes.

First run: WriteXMLFile1() creates the parameter file. The file has the following characteristics:

  • Timestep length of 1 year.
  • 4 species: Species 1, Species 2, Species 3, Species 4.
  • Snag weibull mort behavior, applied to snags of Species 1, 3, 4.
  • Tree remover, applied to snags of Species 1, 3, 4.
  • Size classes are 8 and 30.

The function does the following:

  1. 1000 snags are created of each tree species in each of the size classes.
  2. The model is run for 10 timesteps. After each timestep, the remaining trees of each tree type and size class are counted.
  3. The counts are compared to expected results, give or take 5%.

Second run: WriteXMLFile2() creates the parameter file. The file has the following characteristics:

  • Timestep length of 3 years.
  • 4 species: Species 1, Species 2, Species 3, Species 4.
  • Snag weibull mort behavior, applied to snags of Species 1, 3, 4.
  • Tree remover, applied to snags of Species 1, 3, 4.
  • Size classes are 12 and 30.

The function does the following:

  1. 1000 snags are created of each tree species in each of the size classes.
  2. The model is run for 10 timesteps. After each timestep, the remaining trees of each tree type and size class are counted.
  3. The counts are compared to expected results, give or take 5% (greater margins are allowed for smaller numbers).
Parameters
p_oSimManagerObject to run the testing.
void clTestWeibullSnagMort::TestWeibullSnagMort ( )

Encapsulates all the testing functions together.

const char* clTestWeibullSnagMort::WriteXMLErrorFile1 ( )
protected

Writes a file where the size classes overlap.

Returns
Filename written.
const char* clTestWeibullSnagMort::WriteXMLErrorFile2 ( )
protected

Writes a file where a tree type other than snag is assigned to the behavior.

Returns
Filename written.
const char* clTestWeibullSnagMort::WriteXMLFile1 ( )
protected

Writes a parameter file with the specifications given for TestWeibullSnagMort(), run 1.

Returns
Filename written.
const char* clTestWeibullSnagMort::WriteXMLFile2 ( )
protected

Writes a parameter file with the specifications given for TestWeibullSnagMort, run 2.

Returns
Filename written.
const char* clTestWeibullSnagMort::WriteXMLFile3 ( )
protected

Writes a parameter file with the specifications given for TestBackwardsCompatibility().

Returns
Filename written.

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