Search code examples
c++cppunit

Error while using cppunit


I am using cppunit for testing my project code. In my code in some places I have put some print statements for the debugging purpose like,

void TestSample()
{  
   //getting value from registry
   if( false == getvalue())
     printf("Error : Getting value form registry failed.");
   //.....
}

when I run this code I am getting anerror and the project is failing with an EXEC error.

 EXEC : Error : Getting value form registry failed.

Actually this is not an issue with the code. Its only with that print statement. When I replaced this printf its working fine. The only problem is the " Error : " keyword in the print statement.

How can I solve this issue? The print statement can't be removed. I think there will be an option in VS2010 for avoiding such an error. Help pls.


Solution

  • This is the answer, that I want,

    http://blogs.msdn.com/b/dsvc/archive/2012/02/29/output-from-exec-task-resulting-in-build-failure.aspx