Advertisement
GeeckoDev

Ensuring It Only Works In Debug Mode

Oct 30th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Ensuring It Only Works In Debug Mode
  2. If you've defined TESTING as 1
  3.  
  4. #define TESTING 1
  5.  
  6. this gives you the wonderful opportunity to have separate code sections, such as
  7.  
  8. #if TESTING==1
  9. #endif
  10.  
  11. which can contain such indispensable tidbits as
  12.  
  13. x = rt_val;
  14.  
  15. so that if anyone resets TESTING to 0, the program won't work. And with the tiniest bit of imaginative work, it will not only befuddle the logic, but confound the compiler as well.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement