Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / MFC

Unit Test's Reporter

Rate me:
Please Sign up or sign in to vote.
4.86/5 (28 votes)
19 Feb 2006CPOL11 min read 64.8K   2.8K   58  
The article describes an application built to visualise testing processes for the unit test framework of CppUnitLite.
#ifndef	TVT_INTERFACE_H
#define	TVT_INTERFACE_H

#include	<Windows.h>
#include	<tchar.h>

#include	"xmlParser.h"

#pragma warning(disable : 4996)

#define	TVT_START			0x01
#define	TVT_FINAL			0x02
#define	TVT_INSERT_TEST		0x03
#define	TVT_INSERT_MACRO	0x04
#define	TVT_UPDATE_TEST		0x05
#define	TVT_UPDATE_MACRO	0x06
#define	TVT_FINALIZE		0x07

DWORD	TVTSessionID		(void);
LPVOID	TVTCreatePacket		(TCHAR*,int&);
bool	TVTStartConnection	(TCHAR*);
bool	TVTFinalConnection	(TCHAR*);
bool	TVTFinalize			(const char*);
bool	TVTInsertTest		(TCHAR*);
bool	TVTInsertMacro		(TCHAR*,TCHAR*,TCHAR*,TCHAR*,int);
bool	TVTUpdateTest		(TCHAR*,TCHAR*,TCHAR*,TCHAR*,TCHAR*);
bool	TVTUpdateMacro		(TCHAR*,TCHAR*,TCHAR*,TCHAR*);
void	TVTSendTestInfo		(char*,char*);
void	TVTSendTestSuccess	(char*,char*,int,int,int,int,int,int,int);
void	TVTSendTestError	(char*,char*,int,int,int,int,int,int,int);
void	TVTSendTestFailure	(TCHAR*,TCHAR*,TCHAR*,TCHAR*,TCHAR*,int);
XMLNode	TVTAddXMLLine		(XMLNode&);
void	TVTAddXMLToken		(XMLNode&,TCHAR*);

#include <string>
using namespace std;

std::string	TransformXML2PlainText(std::string&	string);
std::string	TransformXML2PlainText(XMLNode&	entityNode);

class TestTask
{
public:

	TestTask()
	{
		TCHAR	activityEvent	[MAX_PATH];
		_stprintf(activityEvent,TEXT("ActivityEvent_Task_%8.8x"),TVTSessionID());
		hActivityEvent = CreateEvent(NULL, TRUE, FALSE, TEXT("FaceCodeIsActive"));
	}

	~TestTask()
	{
		if (hActivityEvent)
			CloseHandle(hActivityEvent)
		;
	}
private:
//	Data
	HANDLE	hActivityEvent;
};

//	Data transmission to program TreeViewerTest. Some reasons to the
//	occasion of the interface.
//	16.06.2005,	Mk
//DWORD	TVTSessionID()
//{
//	return	GetCurrentProcessId();
//}

//	To construct a skeleton of a tree of tests,
//	enough these three functions 

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Israel Israel
MSc in System Engineering from Tallinn Technical University, Estonia. Currently, I work in a hitech enterprise in Israel.

Comments and Discussions