#include <TestTreePopulation.h>
Public Member Functions | |
void | TestTreePopulation () |
Combines all the tests for testing the tree population. | |
Protected Member Functions | |
void | TestKillTree (clSimManager *p_oSimManager) |
Tests tree killing. | |
void | TestGetters (clSimManager *p_oSimManager) |
Tests tree population getter functions. | |
void | TestSnagAges (clSimManager *p_oSimManager) |
This tests the snag age updating. | |
void | TestHashTable (clSimManager *p_oSimManager) |
Tests hash table loading and organization. | |
void | TestHashTableNoAllomUpdate (clSimManager *p_oSimManager) |
Does the same tests as TestHashTable, but does it with no updates and no automatic allometry updating. | |
void | TestTreeSearching (clSimManager *p_oSimManager) |
Tests tree searching. | |
void | CheckHashTable (clTreePopulation *p_oPop, clTree ****p_oShortestHD, clTree ****p_oTallestHD, clFakeLinkedList ***p_oShort, clFakeLinkedList ***p_oTall, int iNumXCells, int iNumYCells) |
Checks the real hash table against the predicted results. | |
void | LoadTrees1 (clTreePopulation *p_oPop, clTree ****p_oShortestHD, clTree ****p_oTallestHD, clFakeLinkedList ***p_oShort, clFakeLinkedList ***p_oTall, clTree **p_oTreeSet, int iNumXCells, int iNumYCells, bool bFullCheck, bool bUpdateHashTable) |
Loads the first set of trees for hash table checking. | |
void | LoadTrees2 (clTreePopulation *p_oPop, clTree **p_oTreeSet, bool bFullCheck) |
Loads the first set of trees for hash table checking. | |
void | EmptyFakeHashTable (clTree ****p_oShortestHD, clTree ****p_oTallestHD, clFakeLinkedList ***p_oShort, clFakeLinkedList ***p_oTall, int iNumXCells, int iNumYCells) |
Cleans up memory for CheckHashTable. | |
void | DoSet1Searches (clTreePopulation *p_oPop, clTree **p_oTreeSet) |
Performs the first set of tree search tests. | |
void | DoSet2Searches (clTreePopulation *p_oPop, clTree **p_oTreeSet) |
Performs the second set of tree search tests. | |
void | DoSet3Searches (clTreePopulation *p_oPop) |
Performs the third set of tree search tests. | |
void | CheckTreeSearch (struct treeResults *p_expected, short int iNumResults, clTreeSearch *p_oActual, clTree *p_oFirstTree) |
Checks the tree results against a list of expected results. | |
void | UpdateHashTableTrees (clTreePopulation *p_oPop, clTree ****p_oShortestHD, clTree ****p_oTallestHD, clFakeLinkedList ***p_oShort, clFakeLinkedList ***p_oTall, clTree **p_oTreeSet, int iNumXCells, int iNumYCells, bool bFullCheck, bool bUpdateNow, bool bUpdateAllometry) |
Performs updates of the tree set to make sure the hash table is updated correctly. | |
void | DeleteHashTableTrees (clTreePopulation *p_oPop, clTree ****p_oShortestHD, clTree ****p_oTallestHD, clFakeLinkedList ***p_oShort, clFakeLinkedList ***p_oTall, clTree **p_oTreeSet, int iNumXCells, int iNumYCells) |
Deletes the set of trees in a certain order to make sure the hash table is updated correctly. | |
char * | WriteXMLFile1 () |
Writes a parameter file for testing. | |
char * | WriteXMLFile2 () |
Writes a parameter file for testing. | |
char * | WriteXMLFile3 () |
Writes a parameter file for testing. | |
char * | WriteXMLFile4 () |
Writes a parameter file for testing. | |
char * | WriteXMLFile5 () |
Writes a parameter file for testing. | |
Classes | |
class | clFakeLinkedList |
This is for making a fake linked list. More... | |
struct | treeResults |
This structure is for testing tree results - arrays of this struct can tell, for a given list of trees, which should be found, and which actually were. More... |
The test script guiding the test is Population Test.xls.
|
Checks the real hash table against the predicted results.
|
|
Checks the tree results against a list of expected results. This will check for trees not found that should be found, trees that are found which should not be found, and trees found multiple times. This will also make sure that tree searches can handle continued calls to NextTree() after NULL-ing without choking. Results are directed to the log file.
|
|
Deletes the set of trees in a certain order to make sure the hash table is updated correctly.
|
|
Cleans up memory for CheckHashTable.
|
|
Loads the first set of trees for hash table checking.
|
|
Loads the first set of trees for hash table checking.
|
|
Tests tree population getter functions. WriteXMLFile1() is used to load a file.
|
|
Tests hash table loading and organization. Particular sets of trees are created and hard-coded into a hash table in the correct sort. This test hash table is then compared to the real hash table to see if they match. The set of trees has been chosen to test the hash table sorting as much as possible. WriteXMLFile1() is used to load a file. This function is structured the way it is because it was ported from other code.
|
|
Does the same tests as TestHashTable, but does it with no updates and no automatic allometry updating. WriteXMLFile1() is used to load a file. This function is structured the way it is because it was ported from other code.
|
|
Tests tree killing. To test to make sure snags are correctly created, WriteXMLFile3() is used to load a file. Seedlings, saplings, adults, and snags with all dead reasons are fed to KillTree() to make sure that the right thing happens. Then, to make sure snags aren't created when they aren't wanted, WriteXMLFile4() is used to load a file and the same thing done to the trees.
|
|
This tests the snag age updating. It uses WriteXMLFile4() to create a run where snags are supported. Two snags are created in the file. Another is created by the function. It is verified that the ages of all are 0. Then a timestep is run, and it is verified that the ages of all snags are 1. The process is repeated with WriteXMLFile5(), which does the same thing except with three years per timestep. |
|
Tests tree searching. A known list of trees is loaded. Then the expected results of a search, hard-coded, are compared against the actual search returned. An array of trees has a place to count the number of trees each tree is found (this makes sure that trees are not returned multiple times). The hard-coded expected results indicates whether the tree should have been found or not. Then CheckTreeSearch validates the results of each search. WriteXMLFile2() is used to load a file. This is structured like it is because it was ported from other code.
|
|
Performs updates of the tree set to make sure the hash table is updated correctly.
|
|
Writes a parameter file for testing. This is primarily for hash table sorting. Characteristics:
|
|
Writes a parameter file for testing. This is primarily for hash table sorting. Characteristics:
|
|
Writes a parameter file for testing. Characteristics:
|
|
Writes a parameter file for testing. Characteristics:
|
|
Writes a parameter file for testing. Characteristics:
|