
bool HTest_Empty(bool Forward, bool Back, DWORD History);
void HTest_EmptyErr(bool Forward, bool Back, DWORD History);
void HTest_Add(int ID, DWORD History);
/*
DWORD __stdcall gosGml_RRCreateDisplay(char* fontPath, char* imagePath, int tabwidth); //create Gml system window, blank
void __stdcall gosGml_RRDestroyDisplay(DWORD Victim); //destroy a Gml system window
int __stdcall gosGml_RRDisplayGML(char* TextData, rect& DisplayTextArea, DWORD DisplaySystem); //display this Gml; does not clear pane if that is relevant
void __stdcall gosGml_RRClearGML(DWORD DisplaySystem); //clear the Gml system, if relevant
char* __stdcall gosGml_RRClick(int X, int Y, DWORD DisplaySystem);

DWORD __stdcall gosGml_RRCreateHistory(); //create a history system
void __stdcall gosGml_RRDestroyHistory(DWORD Victim); //destroy a history system
char* __stdcall gosGml_RRHistoryForward(DWORD HistorySystem); //move forwards in history list, return next page
char* __stdcall gosGml_RRHistoryBack(DWORD HistorySystem); //move backwards in history list, return previous page
void __stdcall gosGml_RRHistoryAdd(char* Entry, DWORD HistorySystem); //add item to history list, clear all forward items
void __stdcall gosGml_RRHistoryClear(DWORD HistorySystem); //clear history list
bool __stdcall gosGml_RRHistoryForwardEmpty(DWORD HistorySystem); //are there any forward items?
bool __stdcall gosGml_RRHistoryBackEmpty(DWORD HistorySystem); //are there any back items?
*/
void HTest()
{
	char* TempText;
	DWORD Display=gosGml_RRCreateDisplay("assets\\fonts\\", "assets\\Graphics\\",15);
	gosGml_RRDestroyDisplay(Display);
	DWORD History=gosGml_RRCreateHistory();
	HTest_Add(0, History);
	HTest_Add(1, History);
	HTest_Add(2, History);
	HTest_EmptyErr(1,0,History);

	TempText=gosGml_RRHistoryForward(History);
	TempText=gosGml_RRHistoryForward(History);
	HTest_EmptyErr(1,0,History);
	TempText=gosGml_RRHistoryBack(History);
	HTest_EmptyErr(0,0,History);
	TempText=gosGml_RRHistoryBack(History);
	HTest_EmptyErr(0,1,History);
	TempText=gosGml_RRHistoryForward(History);
	HTest_EmptyErr(0,0,History);
	TempText=gosGml_RRHistoryBack(History);
	HTest_EmptyErr(0,1,History);
	TempText=gosGml_RRHistoryBack(History);
	HTest_EmptyErr(0,1,History);
	TempText=gosGml_RRHistoryForward(History);
	HTest_EmptyErr(0,0,History);
	TempText=gosGml_RRHistoryForward(History);
	HTest_EmptyErr(1,0,History);
	TempText=gosGml_RRHistoryForward(History);
	HTest_EmptyErr(1,0,History);
	TempText=gosGml_RRHistoryBack(History); //by this point, the forward and backward movement items are tested
	HTest_EmptyErr(0,0,History);
	HTest_Add(3, History);//test of Add when neither side is empty
	HTest_EmptyErr(1,0,History);
	HTest_Add(4, History);//test of Add when forward is empty
	HTest_EmptyErr(1,0,History);
	TempText=gosGml_RRHistoryBack(History);
	TempText=gosGml_RRHistoryBack(History);
	TempText=gosGml_RRHistoryBack(History);//use a debugger here to see that things come out in the right order
	TempText=gosGml_RRHistoryBack(History);
	HTest_Add(5, History);//test of Add when back is empty
	HTest_EmptyErr(1,0,History);

	//from here, only the clear function is being tested

	gosGml_RRHistoryClear(History); //clear when back is empty
	HTest_EmptyErr(1,1,History);
	HTest_Add(0, History);
	HTest_Add(1, History);
	HTest_Add(2, History);
	gosGml_RRHistoryClear(History); //clear when forward is empty
	HTest_EmptyErr(1,1,History);
	HTest_Add(0, History);
	HTest_Add(1, History);
	HTest_Add(2, History);
	TempText=gosGml_RRHistoryBack(History);
	gosGml_RRHistoryClear(History); //clear when neither is empty
	HTest_EmptyErr(1,1,History);
	HTest_Add(0, History);
	HTest_Add(1, History);
	TempText=gosGml_RRHistoryBack(History);
	gosGml_RRDestroyHistory(History);
}

bool HTest_Empty(bool Forward, bool Back, DWORD History)
{
	if(Forward!=gosGml_RRHistoryForwardEmpty(History) || Back!=gosGml_RRHistoryBackEmpty(History))
		return false;
	return true;
}

void HTest_EmptyErr(bool Forward, bool Back, DWORD History)
{
	if(Forward!=gosGml_RRHistoryForwardEmpty(History) || Back!=gosGml_RRHistoryBackEmpty(History))
		PAUSE(("Test gosGML: HTest_EmptyErr (trivial)"));
	return;
}

#pragma warning(disable:4244)
void HTest_Add(int ID, DWORD History)
{
	char* TempText=new char[7];
	strcpy(TempText,"test00");
	if(ID>9)
	{
		TempText[4]+=(char)(ID/10);
		ID%=10;
	}
	TempText[5]+=(char)ID;
	gosGml_RRHistoryAdd(TempText,History);
}
#pragma warning(default:4244)
