Cppunit testing of classes

Apr 25, 2011 at 1:27pm
I am an intern in Hp Global software pvt ltd.My job out here is to test native cpp modules.I have encountered a serious problem.my code doesnt have any error but when i debug it,it breaks with a message
[Windows has triggered a breakpoint in STAR_RemoteDeployer.exe.
This may be due to a corruption of the heap, which indicates a bug in STAR_RemoteDeployer.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while STAR_RemoteDeployer.exe has focus.
The output window may have more diagnostic information.]

And i am directed to free.c page and the error shown is-
retval = HeapFree(_crtheap, 0, pBlock);
(error over here)-> if (retval == 0)
{
errno = _get_errno_from_oserr(GetLastError());
}

this is my main program
int main (int argc, char* argv[])
{
// informs test-listener about testresults
CPPUNIT_NS :: TestResult testresult;

// register listener for collecting the test-results
CPPUNIT_NS :: TestResultCollector collectedresults;
testresult.addListener (&collectedresults);

// register listener for per-test progress output
CPPUNIT_NS :: BriefTestProgressListener progress;
testresult.addListener (&progress);

// insert test-suite at test-runner by registry
CPPUNIT_NS :: TestRunner testrunner;
testrunner.addTest (CPPUNIT_NS :: TestFactoryRegistry::getRegistry().makeTest ());
testrunner.run (testresult);(this is the place where it is getting stuck everytime)

// output results in compiler-format
CPPUNIT_NS :: CompilerOutputter compileroutputter (&collectedresults, std::cerr);
compileroutputter.write ();

// return 0 if tests were successful
return collectedresults.wasSuccessful () ? 0 : 1;
}
please help.i have to give a presentation soon in my office.
Last edited on Apr 25, 2011 at 1:29pm
Apr 25, 2011 at 2:22pm
I would start by asking did this program ever work? Did it work on this station or on another one? If it worked on this station before then what has changed? Updates, Rollback or System Restore? If it worked but on another system then was it the same OS and Service Pack ("GetLastError()" is a Win32 API function so we already know this is Windows)?

Or you could Ctrl+F and see where "errno" gets output to, this should give you a translation of the Windows error code. If that isn't helpful try to grab the value returned by "GetLastError()" and run it up against here: http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx
Apr 26, 2011 at 9:25am
the main program worked fine when i used in a project of my own.when i decided to add the test cases in the same project that i was supposed to test,the problem arised(thats what i was asked to do by my team mentor).
The parent project is working fine individually and the cppunit testing is working fine when used individually,but when they are merged problem arises.
It worked on the same station,OS and there had been no updates,rollbacks or system restores.

the o/p to "errno" is not helping too
Apr 28, 2011 at 9:46am
while running in the debugging executable its running fine but while debugging in the debugging executable its breaking.
Any help?
Topic archived. No new replies allowed.