From: Carlo Wood
Also, the above is slightly dangerous, as the 'public' would 'leak' beyond the #ifdef when TESTING is defined. You'd have to make sure that the test block at the end of the class.
This is a very good point. A method defined as public in test might fail to compile as private in production.
Personally, I like the #define private public best, because it doesn't polute the real code.
But this contradicts your prior good point. This is even more dangerous than the conditional public: which you objected to, because now *every* method is public! At least with the other method, you can do it safely if you're careful. - James Jones Administrative Data Mgmt. (v)732-510-1806 375 Raritan Center Pkwy, Suite A (f)732-510-1855 Edison, NJ 08837 Visit us on the web at http://www.firstinvestors.com/