Need help in creating c++ stubs.
-
Hi Everyone, I'm working on a NT service which calls other Services in another machine. I know that for unit testing we can write stubs for other remote services to test the service. I've searched on the net but i couldn't find any tutorial to do this. Can anyone please tell me how to write stubs (the basic idea, i've absolutely no idea where to start) or direct me to any tutorial that would help me?? Regards,
-
Hi Everyone, I'm working on a NT service which calls other Services in another machine. I know that for unit testing we can write stubs for other remote services to test the service. I've searched on the net but i couldn't find any tutorial to do this. Can anyone please tell me how to write stubs (the basic idea, i've absolutely no idea where to start) or direct me to any tutorial that would help me?? Regards,
You just write a method with the same signature as the 'real' function, and add your own code to return a good or bad status as appropriate. For example the Windows function
GetFileVersionInfo()
could be coded like thisBOOL GetFileVersionInfo(LPCTSTR lptstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData
)
{
OutputDebugString("My test");return TRUE;
}
MVP 2010 - are they mad?