Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » CHECK macro
Re: CHECK macro [message #5995 is a reply to message #5994] Fri, 27 October 2006 04:05 Go to previous messageGo to previous message
exolon is currently offline  exolon
Messages: 62
Registered: July 2006
Location: 53'21N 6'18W
Member
luzr wrote on Fri, 27 October 2006 02:41

It is similar to ASSERT, but expression gets evaluated even in release mode (therefore you do not lose desired side effects - e.g. you can use CHECK to test the return code of some routine. If you would do it with ASSERT, routine would not get called in release mode).

So it's a sort of design-by-contract "defensive programming" thing?

luzr wrote on Fri, 27 October 2006 02:41

I guess the simple thing to do is #undef CHECK before including your unit testing stuff.

Well, doing this caused a lot of errors since CHECK was redefined and some code in Core is trying to use it. It's not a big deal, I made a terrible sed script to do some of the replacements. And if, as you say, unit testing is a future consideration for U++ (a very good thing!!), I'll participate as much as my limited experience allows on that topic. Smile
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: strcmp() works with String?
Next Topic: dynamic loading of Ctrls using dli?
Goto Forum:
  


Current Time: Sun Apr 27 22:30:38 CEST 2025

Total time taken to generate the page: 0.00942 seconds