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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
class ConnexionTest : public CppUnit::TestFixture {
Connexion * connexiontToClient;
public:
//~ Call before tests
void setUp(void)
{
}
//~ Call after tests
void tearDown(void)
{
}
void createConnexion()
{
ENetAddress adresse;
bool flagTest = false;
connexiontToClient = new Connexion();
adresse.host = ENET_HOST_ANY;
adresse.port = (enet_uint16) 60000;
flagTest = connexiontToClient->createConnexion(adresse,100);
CPPUNIT_ASSERT(flagTest);
}
void deleteConnexion()
{
bool flagTest = false;
flagTest = connexiontToClient->deleteConnexion();
delete connexiontToClient;
CPPUNIT_ASSERT(flagTest);
}
CPPUNIT_TEST_SUITE(ConnexionTest);
CPPUNIT_TEST(createConnexion);
CPPUNIT_TEST(deleteConnexion);
CPPUNIT_TEST_SUITE_END(); |
Partager