RE: [Cppunit-devel] CppUnit 1.8.0 features...
Brought to you by:
blep
From: Summerwill, B. <BSu...@eu...> - 2001-09-25 13:22:34
|
Baptiste wrote ... >> I'm not saying to change CppUnit as a whole. The only thing I want to change >> is those part of CppUnit that would impose on the "user" policy: Fair enough. Was this the result of a specific problem or bug report? Sorry if my last e-mail comes across badly. I think that the work that's been done on CppUnit in the last few months is really positive, and am just wary of large-scale changes being made, such as virtuals for everything. Cheers, Bob -----Original Message----- From: Baptiste Lepilleur [mailto:gai...@fr...] Sent: 25 September 2001 13:57 To: Summerwill, Bob Cc: Baptiste Lepilleur; Baptiste Lepilleur; Cpp Unit Develpment Mailing List Subject: RE: [Cppunit-devel] CppUnit 1.8.0 features... Quoting "Summerwill, Bob" <BSu...@eu...>: > > Baptiste wrote: > > >> I would actually call that one a bug fix. While const is usefull when > > >> manipulating value object, it is a strong constraint. Personnaly, I > have > taken > >> Michael Feather's advice on XP and C++ and don't use const on > reference > object > >> (object who don't have public copy constructor). This make > refactoring a > lot > >> easier, but writing assertion_traits black magic :-(. > > Please could you clarify why you wouldn't want const references? > Maybe > provide > a link to Michael Feather's advice? > > I've always found const-correctness very useful, and would see > removing > const-correctness from CppUnit as a backwards step. There are a number > of > other > areas in the framework which I spotted as not being const-correct. Is > this > a > policy decision, that you aren't being const-correct? See other mail for urls. Note that the framework was first written by Michael Feather, who did not use const (which explain why the constness is shacky). I'm not saying to change CppUnit as a whole. The only thing I want to change is those part of CppUnit that would impose on the "user" policy: struct assertion_traits { static bool equal( const T& x, const T& y ) => change to static bool equal( T& x, T& y ) and template <class T> void assertEquals( const T& expected, const T& actual, => change to: template <class T> void assertEquals( T& expected, T& actual, The change is invisible for user that apply the "const" policy, and allow user who don't to use the assertEquals without having to do const_cast. Baptiste. > > > Cheers, > Bob > --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Language: English, French |