Re: [Cppunit-devel] toString() v.s. getName()
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2001-07-16 14:44:53
|
Quoting "Steve M. Robbins" <ste...@vi...>: > On Tue, Jul 10, 2001 at 05:25:51PM +0200, Baptiste Lepilleur wrote: > > > toString() and getName() have very different semantic. > > > > * getName(): give me the name of that test so I can identify it. > > > > * toString(): dump this object as a string so I can diagnose the > problem (why > > is not equal to that other one) without running the debugger. > > > > So, I would exterminate toString() from CppUnit, with the exception > of > > assertion_traits. > > OK, now I have found one place where the real name of the test is > required, and not just the "diagnostic string". In TextTestRunner, > there are findTestByName() and runTestByName() methods. Presumably, > one doesn't want to resort to searching for "footest (suite)". > > Perhaps it is best to retain both getName() and toString(). As I said, getName() is used to "identify" the test. Identification is used in three ways at the current time: - reporting which test failed - look up a test in the tests provided to the TestRunner - browsing the tests provided to the TestRunner. toString() make a diagnostic string for an object. Therefore, for TestFailure, it dump the test name and the exception message. This implementation of toString () is not use for reporting test failure and is of no use for CppUnit. Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Language: English, French |