Passer de Cpptest à Cppunittest
Salut, chers developpeur!
J'ai en fait une question concernant le cppunit_test. En fait j'ai un cpptest avec, exemple comme suit:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#ifndef Bel_attributtionData suite_H
#defineBel_attributtionData suite_H
#include<Cpptest/src/cpptest.h>
using namespace FEATURE
class AttributionDataSuite: public Test::Suite
{
public:
AttributionDataSuite(void)
protected:
virtual void setUp();
virtual void TearDown();
private:
/* name testfunctions */
void construction();
void size();
void add_destination();
private:
AttributionData* theDataPtr;
};
#endif// Les tests en eux mêmes |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
AttributuinDataSuite::attributionDataSuite(void)
:Test::Suite()
{
TEST_ADD(AttributionDataSuite::construction)
TEST_ADD(AttributionDataSuite::size)
TEST_ADD(AttributionDataSuite::add_destination)
}
void AttributionDataSuite::construction()
{
FeatAttrList fal;
ElemIdKenn e(1, fal);
TEST_ASSERT( e==theDataPtr_->get_source() );
}
void AttributionDataSuite::size()
{
FeatAttrList fal;
ElemIdKenn e(1, fal);
TEST_ASSERT_MSG( theDataPtr_->size()==0, "EmptyData.... " );
theDataPtr_->add_destination( f );
TEST_ASSERT_MSG( theDataPtr_->size()==1, "EmptyData.... " );
} |
En effet j'aimerai transformer ce Cpptest en CppUnitTest. Comment dois-je proceder? Quelqu'un peut-il me faire un exemple de Cpptest -> Cppunittest.
Je vous remercie d'avance
Merlinerick