Re: [Cppunit-devel] toString() v.s. getName()
Brought to you by:
blep
From: Steve M. R. <ste...@vi...> - 2001-07-10 14:58:33
|
Hi, With respect to the toString/getName controversy: I realized yesterday that the "assertion_traits" class also has a toString() method. In this case one is converting an arbitrary type T to a string representation, so "toString()" fits better than "getName()". I'm starting to wonder whether it is better to eliminate getName() on the Test classes, and stick with toString() universally. Or, we could go ahead with the initial plan, and leave assertion_traits to be an exception. I'm leaning towards the first option. Thoughts? On Tue, Jul 10, 2001 at 04:36:57PM +0200, Baptiste Lepilleur wrote: > Quoting "Steve M. Robbins" <ste...@vi...>: > > My plan of attack is as follows: > > > > 1. Remove all use of toString() in the library. > > 2. Document toString() as deprecated in all classes that define it. > > 3. Replace all toString() implementations with "return getName()". > > 4. After a respectable number of public releases have been made, > > remove all toString() methods. > > > > Optionally, we could replace toString() methods with > > > > toString() { > > std::cerr << "Replace toString() with getName()." << endl; > > return getName(); > > } > (note that this is of no use for Windows user in GUI mode). Ah. What happens to the standard streams in GUI mode? Are they logged to a file somewhere, simply ignored, or does it cause a "general protection fault" :-) ? > I wouldn't even bother with point (2), (3) and (4). The next release will > break so many existing stuffs, and this one is really a minor detail (toString > isn't even used by CppUnit). True, it is a minor detail. On the other hand, if we maintain backwards compatibility without too much trouble, I'm willing to do that. > Documentation how to do the transition from one version to another should be > enough for now (we should start a document for that). I think that is a good idea. I have not used any release prior to 1.5.5, so I don't really know what is being broken or not broken. -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 |