SORTIE C++ Test Documentation
|
#include <stddef.h>
Classes | |
class | clFakeLinkedList |
Tests the clTreePopulation class. 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... | |
Functions | |
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. More... | |
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. More... | |
void | LoadTrees2 (clTreePopulation *p_oPop, clTree **p_oTreeSet, bool bFullCheck) |
Loads the first set of trees for hash table checking. More... | |
void | EmptyFakeHashTable (clTree ****p_oShortestHD, clTree ****p_oTallestHD, clFakeLinkedList ***p_oShort, clFakeLinkedList ***p_oTall, int iNumXCells, int iNumYCells) |
Cleans up memory for CheckHashTable. More... | |
void | DoSet1Searches (clTreePopulation *p_oPop, clTree **p_oTreeSet) |
Performs the first set of tree search tests. More... | |
void | DoSet2Searches (clTreePopulation *p_oPop, clTree **p_oTreeSet) |
Performs the second set of tree search tests. More... | |
void | DoSet3Searches (clTreePopulation *p_oPop) |
Performs the third set of tree search tests. More... | |
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. More... | |
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. More... | |
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. More... | |
const char * | WriteTreePopulationXMLFile1 () |
Writes a parameter file for testing. More... | |
const char * | WriteTreePopulationXMLFile2 () |
Writes a parameter file for testing. More... | |
const char * | WriteTreePopulationXMLFile3 () |
Writes a parameter file for testing. More... | |
const char * | WriteTreePopulationXMLFile4 () |
Writes a parameter file for testing. More... | |
const char * | WriteTreePopulationXMLFile5 () |
Writes a parameter file for testing. More... | |
const char * | WriteTreePopulationXMLFile6 () |
Writes a parameter file for testing distance-height tree searches on a plot which has odd-sized end grids (100X100 m plot). More... | |
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.
p_oPop | Pointer to tree population. |
p_oShortestHD | Shortest links |
p_oTallestHD | Tallest links |
p_oShort | Fake shortest hash table. |
p_oTall | Fake tallest hash table. |
iNumXCells | Number population X cells. |
iNumYCells | Number population Y cells. |
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.
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.
p_expected | Array of treeResults which shows expected values. There can be trees in this list that are not expected to be found. |
iNumResults | Number of elements in p_expected array. |
p_oActual | Tree search object to test. |
p_oFirstTree | The expected first tree found. |
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.
p_oPop | Pointer to tree population object |
p_oShortestHD | Shortest links |
p_oTallestHD | Tallest links |
p_oShort | Fake shortest hash table. |
p_oTall | Fake tallest hash table. |
iNumXCells | Number population X cells. |
iNumYCells | Number population Y cells. |
p_oTreeSet | The set of trees |
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 EmptyFakeHashTable | ( | clTree **** | p_oShortestHD, |
clTree **** | p_oTallestHD, | ||
clFakeLinkedList *** | p_oShort, | ||
clFakeLinkedList *** | p_oTall, | ||
int | iNumXCells, | ||
int | iNumYCells | ||
) |
Cleans up memory for CheckHashTable.
p_oShortestHD | Shortest links |
p_oTallestHD | Tallest links |
p_oShort | Fake shortest hash table. |
p_oTall | Fake tallest hash table. |
iNumXCells | Number population X cells. |
iNumYCells | Number population Y cells. |
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.
p_oPop | Pointer to tree population. |
p_oShortestHD | Shortest links |
p_oTallestHD | Tallest links |
p_oShort | Fake shortest hash table. |
p_oTall | Fake tallest hash table. |
iNumXCells | Number population X cells. |
iNumYCells | Number population Y cells. |
p_oTreeSet | The set of trees to create |
bFullCheck | If true, the function checks the hash table after each tree is created to make sure it is correct. |
bUpdateHashTable | If true, this creates the fake hash table and keeps it updated. |
void LoadTrees2 | ( | clTreePopulation * | p_oPop, |
clTree ** | p_oTreeSet, | ||
bool | bFullCheck | ||
) |
Loads the first set of trees for hash table checking.
p_oPop | Pointer to tree population. |
p_oTreeSet | The set of trees to create |
bFullCheck | If true, the function checks the hash table after each tree is created to make sure it is correct. |
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.
p_oPop | Pointer to tree population object |
p_oShortestHD | Shortest links |
p_oTallestHD | Tallest links |
p_oShort | Fake shortest hash table. |
p_oTall | Fake tallest hash table. |
iNumXCells | Number population X cells. |
iNumYCells | Number population Y cells. |
p_oTreeSet | The set of trees to create |
bFullCheck | Whether to check the hash table after each update |
bUpdateNow | Matches the trees' bUpdateNow argument |
bUpdateAllometry | Matches the trees' bUpdateAllometry argument |
const char* WriteTreePopulationXMLFile1 | ( | ) |
Writes a parameter file for testing.
This is primarily for hash table sorting. Characteristics:
const char* WriteTreePopulationXMLFile2 | ( | ) |
Writes a parameter file for testing.
This is primarily for hash table sorting. Characteristics:
const char* WriteTreePopulationXMLFile3 | ( | ) |
Writes a parameter file for testing.
Characteristics:
const char* WriteTreePopulationXMLFile4 | ( | ) |
Writes a parameter file for testing.
Characteristics:
const char* WriteTreePopulationXMLFile5 | ( | ) |
Writes a parameter file for testing.
Characteristics:
const char* WriteTreePopulationXMLFile6 | ( | ) |
Writes a parameter file for testing distance-height tree searches on a plot which has odd-sized end grids (100X100 m plot).