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

Tests the class clHarvestInterface. More...

#include <TestHarvestInterface.h>

Inheritance diagram for clTestHarvestInterface:

Public Member Functions

void TestHarvestInterface ()
 Performs all the tests from one function.
 

Protected Member Functions

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 TestErrorProcessing (clSimManager *p_oSimManager)
 Tests error processing.
 
const char * WriteXMLFile1 ()
 Writes a parameter file for normal processing run 1.
 
const char * WriteXMLFile2 ()
 Writes a parameter file for normal processing run 2.
 
const char * WriteXMLFile3 ()
 Writes a parameter file for normal processing run 3.
 
const char * WriteXMLFile4 ()
 Writes a parameter file for normal processing run 4.
 
const char * WriteXMLFile5 ()
 Writes a parameter file for normal processing run 5.
 
const char * WriteXMLFile6 ()
 Writes a parameter file for normal processing run 6.
 
const char * WriteXMLBatch1 ()
 Writes batch file 1, for normal processing run 5.
 
const char * WriteXMLErrorBatch1 ()
 Writes a batch file to provoke an error in the length of the batch parameters file.
 
const char * WriteAllParamsFile ()
 Writes a parameters file, for normal processing run 5.
 
const char * WriteXMLErrorFile1 ()
 Writes an error file where the harvest executable isn't where it's supposed to be.
 
const char * WriteXMLErrorFile2 ()
 Writes an error file where the harvest period is negative.
 
const char * WriteXMLErrorFile3 ()
 Writes an error file where requested tree attributes don't exist at all.
 
const char * WriteXMLErrorFile4 ()
 Writes an error file where requested tree attributes don't exist for all species.
 
const char * WriteXMLErrorFile5 ()
 Writes an error file where the harvest return file will not exist.
 
const char * WriteXMLErrorFile6 ()
 Writes an error file where the update return file will not exist.
 
const char * WriteXMLErrorFile7 ()
 Writes an error file where a tree to harvest will not exist.
 
const char * WriteXMLErrorFile8 ()
 Writes an error file where a tree to update will not exist.
 
const char * WriteXMLErrorFile9 ()
 Writes an error file where the parameter batch file is missing.
 
void WriteTrees (std::fstream &oOut)
 Writes the tree portions of the test parameter files, from <trees> to </trees>.
 
void WriteAllometry (std::fstream &oOut)
 Writes the allometry portions of the test parameter files, from <allometry> to </allometry>.
 

Detailed Description

Tests the class clHarvestInterface.

Member Function Documentation

void clTestHarvestInterface::TestErrorProcessing ( clSimManager *  p_oSimManager)
protected

Tests error processing.

This uses WriteXMLErrorFileX() to introduce errors and make sure that they are caught.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::TestHarvestInterface ( )

Performs all the tests from one function.

void clTestHarvestInterface::TestNormalProcessingRun1 ( clSimManager *  p_oSimManager)
protected

Tests normal processing, run 1.

WriteXMLFile1() does setup. Then 55 trees are created. Two timesteps are run. In the first, the following trees should be dead: 2, 3, 9, 15, 19, 20, 21, 22, 34, 48, 50. In the second timestep, the following trees should be dead: 1,4, 30, 31.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::TestNormalProcessingRun2 ( clSimManager *  p_oSimManager)
protected

Tests normal processing, run 2.

This tests extra columns desired in the files. WriteXMLFile2() does setup. Then 55 trees are created. Three timesteps are run. In the first, the following trees should be dead: 2, 3, 9, 15, 19, 20, 21, 22, 34, 48, 50. In the second timestep, all remaining trees are cut. The third timestep tests the situation when there are no trees.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::TestNormalProcessingRun3 ( clSimManager *  p_oSimManager)
protected

Tests normal processing, run 3.

This tests extra columns desired in the files, and new tree members to be added and updated. WriteXMLFile3() does setup.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::TestNormalProcessingRun4 ( clSimManager *  p_oSimManager)
protected

Tests normal processing, run 4.

This tests applying the behavior to only a subset of trees. WriteXMLFile4() does setup.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::TestNormalProcessingRun5 ( clSimManager *  p_oSimManager)
protected

Tests normal processing, run 5.

This tests batch running. WriteXMLBatch1() runs WriteXMLFile5() for setup.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::TestNormalProcessingRun6 ( clSimManager *  p_oSimManager)
protected

Tests normal processing, run 6.

This tests batch running with no extra parameters file. WriteXMLBatch1() runs WriteXMLFile6() for setup.

Parameters
p_oSimManagerSim Manager object to call for runs.
void clTestHarvestInterface::WriteAllometry ( std::fstream &  oOut)
protected

Writes the allometry portions of the test parameter files, from <allometry> to </allometry>.

Parameters
oOutFile stream to write to.
const char* clTestHarvestInterface::WriteAllParamsFile ( )
protected

Writes a parameters file, for normal processing run 5.

Returns
Filename written.
void clTestHarvestInterface::WriteTrees ( std::fstream &  oOut)
protected

Writes the tree portions of the test parameter files, from <trees> to </trees>.

Parameters
oOutFile stream to write to.
const char* clTestHarvestInterface::WriteXMLBatch1 ( )
protected

Writes batch file 1, for normal processing run 5.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorBatch1 ( )
protected

Writes a batch file to provoke an error in the length of the batch parameters file.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile1 ( )
protected

Writes an error file where the harvest executable isn't where it's supposed to be.

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

Writes an error file where the harvest period is negative.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile3 ( )
protected

Writes an error file where requested tree attributes don't exist at all.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile4 ( )
protected

Writes an error file where requested tree attributes don't exist for all species.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile5 ( )
protected

Writes an error file where the harvest return file will not exist.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile6 ( )
protected

Writes an error file where the update return file will not exist.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile7 ( )
protected

Writes an error file where a tree to harvest will not exist.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile8 ( )
protected

Writes an error file where a tree to update will not exist.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLErrorFile9 ( )
protected

Writes an error file where the parameter batch file is missing.

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

Writes a parameter file for normal processing run 1.

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

Writes a parameter file for normal processing run 2.

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

Writes a parameter file for normal processing run 3.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLFile4 ( )
protected

Writes a parameter file for normal processing run 4.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLFile5 ( )
protected

Writes a parameter file for normal processing run 5.

Returns
Filename written.
const char* clTestHarvestInterface::WriteXMLFile6 ( )
protected

Writes a parameter file for normal processing run 6.

Returns
Filename written.

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