简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM