Re: [Cppunit-devel] name of my fixture
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2002-03-26 20:42:46
|
TestFixture aren't named and don't really need to inherit TestCase (in fact, a TestFixture class is being introduced, which define only setUp() and tearDown() ). They're only support class to write unit test. The TestCaller is the actual TestCase that is added to the TestSuite. The TestCaller only requires that your fixture define setUp() and tearDown(), and a default constructor. Therefore you fixture, MoneyTest, don't need to inherit TestCase. In the current version, you would inherit TestFixture instead, which defines the required methods. This doesn't really answer your question but explains why TestFixture aren't named. Why do you need a different name for ? Baptiste. ----- Original Message ----- From: "Rachel ANDRE" <rac...@so...> To: "cppUnit" <cpp...@li...> Sent: Monday, March 18, 2002 3:16 PM Subject: [Cppunit-devel] name of my fixture > Hi, > I have a little question. I write the classical static suite() method in my > test Class (called MoneyTest): > > CppUnit::Test * MoneyTest::suite() > { > CppUnit::TestSuite *suite = new CppUnit::TestSuite("MoneyTestSuite"); > suite->addTest(new > CppUnit::TestCaller<MoneyTest>("testGetValue",&MoneyTest::testAdd)); > return suite; > } > > It works, but the creator of TestCaller calls "MoneyTest()" (constructor > without parameters) instead of "MoneyTest(std::String name)". > > MoneyTest::MoneyTest(std::string nameParam) > { > TestCase (nameParam); > } > MoneyTest::MoneyTest() > { > TestCase ("mewName"); > } > I don't want to give ever the same name for my fixture ! How can I do ? > > Thanks > > > > > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppunit-devel > |