Re: [Cppunit-devel] toString() is not used...
Brought to you by:
blep
From: Steve M. R. <ste...@vi...> - 2001-06-11 22:38:32
|
On Sat, Jun 10, 2000 at 02:59:02PM +0200, Baptiste Lepilleur wrote: > Well, I looked around in the code, and the method toString() which is > defined in most of the classes does not seem to be used (getName() is used > instead). > > Since it is not used, why not remove it ? I think this is a leftover > from the junit port, but I don't see any use for it. > > Having a toString() and a getName() is confusing for newbies (I remember > I was confused at first). I think it is confusing mainly because the base class Test doesn't document what the two functions are supposed to do. [Indeed, Test doesn't document what *any* of its functions are supposed to do.] I'm all for simplifying the interface. I guess we'll have to first articulate what these functions are intended to do. TestCase (a subclass of Test), for example, defines toString() and getName() differently. TestCase objects have a "name" (m_name, rather) variable; getName() returns this name. The function toString(), however, prepends a class name to it. The behaviour of toString() seems quite useful; maybe that is the interface to standardize on. I haven't really looked at the code closely. Hopefully someone with a longer history with the project will speak up ;-) -S -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |