Re: [Cppunit-devel] Most user-friendly version of CppUnit
Brought to you by:
blep
From: Duane M. <dua...@ma...> - 2003-08-12 15:16:52
|
--- At Tue, 12 Aug 2003 09:31:18 +0200, Baptiste Lepilleur wrote: >> - I just don't like using macros for code generation purposes, there are >better tools out there for this > >Those macros are designed to remove code duplication. They also help isolate >the test code from the underlying framework (switching to cppunit v2 will me >much simpler if you are using those macro, as it is fairly simple to write >an a portability layer for them). > >I don't know of any better way to 'generate' code than those 'fairly' simple >macro. May be you would like to share (cppunit v2 is relying on a similar >scheme at the time). This comment greatly concerns me about the future of CppUnit. I hope that there is simply a misunderstanding of what the need for these macros are. The macros are _not_ needed to remove code duplication. Simple functions can do that just fine. Template functions and classes can do it if there are type or naming problems. The real reason I see for using the macros is the necessity of including __FILE__ and __LINE__ (and sometimes __func__) in the exception and error reporting. There is no good way of getting this information easily out of the code without macros (aside from the user actually typing them). The only macro's I use are the ones that involve the actuall testing. I dont use any of the other macros so maybe I'm not a typical user. ...Duane |