Re: [Cppunit-devel] CPPUnit Cookbook Bug
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2002-06-01 11:39:01
|
----- Original Message ----- From: "Loh, Choo Woon" <Cho...@au...> To: <cpp...@li...> Sent: Thursday, May 30, 2002 7:15 AM Subject: [Cppunit-devel] CPPUnit Cookbook Bug > In the line, > > #include <cppunit/extensions/HelperMacros.h > > CPPUNIT_TEST_SUITE_REGISTRATION( ComplexNumber ); > > Behind the scene, a static variable type of AutoRegisterSuite is declared. > On construction, it will register a TestSuiteFactory into the > TestFactoryRegistry. The TestSuiteFactory returns the TestSuite returned by > ComplexNumber::suite(). > > should be corrected as (highlighted in bold) :- > > #include <cppunit/extensions/HelperMacros.h > > CPPUNIT_TEST_SUITE_REGISTRATION( ComplexNumberTest ); > > Behind the scene, a static variable type of AutoRegisterSuite is declared. > On construction, it will register a TestSuiteFactory into the > TestFactoryRegistry. The TestSuiteFactory returns the TestSuite returned by > ComplexNumberTest::suite(). Fixed. > As a suggestion, you could improve the final example to use the other helper > macros as well :- > > CPPUNIT_TEST_SUITE_REGISTRATION( ComplexNumberTest ); > CPPUNIT_TEST_SUITE( ComplexNumberTest ); > CPPUNIT_TEST( testEquality ); > CPPUNIT_TEST( testAddition ); > CPPUNIT_TEST_SUITE_END(); Could you explain in more details ? Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/ |