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

Tests the clMicroEstablishment class. More...

#include <TestMicroEstablishment.h>

Inheritance diagram for clTestMicroEstablishment:

Public Member Functions

void TestMicroEstablishment ()
 Collection of other tests.
 

Protected Member Functions

void TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
 
void TestSetZAndRespite (clSimManager *p_oSimManager)
 Tests the functions clMicroEstablishment::SetFreshLogZAndRespite, SetMoundZAndRespite, and SetGroundZAndRespite.
 
void TestMoundZDistributions (clSimManager *p_oSimManager)
 Produces 1000 seeds in cell 0,0, and lets them all germinate (by setting substrate favorabilities to 1).
 
void TestFreshLogZDistributions (clSimManager *p_oSimManager)
 Tests the function clMicroEstablishment::SetFreshLogZAndRespite, to make sure that seedling z heights are properly distributed.
 
void TestGetSubstrateProportions (clSimManager *p_oSimManager)
 Tests the function clMicroEstablishment::GetSubstrateProportions.
 
void TestGetFreshLogProportions (clSimManager *p_oSimManager)
 Tests the function clMicroEstablishment::GetFreshLogProportions.
 
const char * WriteXMLFile1 ()
 Writes a parameter file that sets up 6 species, 3 of which get establishment.
 
const char * WriteXMLFile2 ()
 Writes a parameter file that sets up 1 species.
 
const char * WriteXMLFile3 ()
 Writes a parameter file that sets up 6 species, 3 of which get establishment.
 
const char * WriteXMLErrorFile1 ()
 Writes a parameter file that contains a mound proportion that is negative.
 
void WriteCommonStuff (std::fstream &oOut)
 Writes common portions of the test parameter files (tree pop, plot, etc).
 

Detailed Description

Tests the clMicroEstablishment class.

Member Function Documentation

void clTestMicroEstablishment::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing.

WriteXMLErrorFile1 is written to see if the expected errors are triggered.

Parameters
p_oSimManagerSim manager object.
void clTestMicroEstablishment::TestFreshLogZDistributions ( clSimManager *  p_oSimManager)
protected

Tests the function clMicroEstablishment::SetFreshLogZAndRespite, to make sure that seedling z heights are properly distributed.

This places 1000 cells in cell 0,0, and lets them all germinate. The substrate type is set to all fresh log. WriteXMLFile3() is used to set up. Then the z's of the seedlings are collected and written to FreshLogZ.txt.

void clTestMicroEstablishment::TestGetFreshLogProportions ( clSimManager *  p_oSimManager)
protected

Tests the function clMicroEstablishment::GetFreshLogProportions.

There are three setup files: WriteXMLFile2(), WriteXMLFile3(), and WriteXMLFile5(). For all three, specific substrate proportions are assigned to cells and the results compared.

Parameters
p_oSimManagerSim manager object.
void clTestMicroEstablishment::TestGetSubstrateProportions ( clSimManager *  p_oSimManager)
protected

Tests the function clMicroEstablishment::GetSubstrateProportions.

There are three setup files: WriteXMLFile2(), WriteXMLFile3(), and WriteXMLFile5(). For all three, specific substrate proportions are assigned to cells and the results compared. Then we check seed distribution by checking the number of seedlings out of an original 100 that have z values greater than 0.

Parameters
p_oSimManagerSim manager object.
void clTestMicroEstablishment::TestMicroEstablishment ( )

Collection of other tests.

void clTestMicroEstablishment::TestMoundZDistributions ( clSimManager *  p_oSimManager)
protected

Produces 1000 seeds in cell 0,0, and lets them all germinate (by setting substrate favorabilities to 1).

WriteXMLFile3() gives us the setup file, with mound proportion = 1. The substrate type is set to all moss (so fresh logs don't interfere). Then the z's of the seedlings will be collected and written to MoundZ.txt.

Parameters
p_oSimManagerSim manager object.
void clTestMicroEstablishment::TestSetZAndRespite ( clSimManager *  p_oSimManager)
protected

Tests the functions clMicroEstablishment::SetFreshLogZAndRespite, SetMoundZAndRespite, and SetGroundZAndRespite.

It passes in a seedling to each to see if the expected results are correct for the last two (greater than 0 for z and 0 for respite in the first case, 0 for both z and respite in the second case). Then 1000 seeds of species 2 are added to cell (0,0) and the substrate set to all fresh logs. The fresh log proportions array will be split evenly between the four possible ages: 0, 2, 4, and 6. Then the seedlings are checked to make sure they're roughly equal to those ages.

Parameters
p_oSimManagerSim manager object.
void clTestMicroEstablishment::WriteCommonStuff ( std::fstream &  oOut)
protected

Writes common portions of the test parameter files (tree pop, plot, etc).

This ends with </allometry&gt.

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

Writes a parameter file that contains a mound proportion that is negative.

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

Writes a parameter file that sets up 6 species, 3 of which get establishment.

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

Writes a parameter file that sets up 1 species.

All favorabilities are set to 1. Mound proportion is set to 1. Mound mean height is 3 m. Mound standard deviation is 0.5 m.

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

Writes a parameter file that sets up 6 species, 3 of which get establishment.

All favorabilities are set to 1. Mound proportion is set to 0.

Returns
Filename written.

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