39 lines
847 B
C++
39 lines
847 B
C++
#include "inputCoucheTest.h"
|
|
void InputCoucheTest::setUp(){
|
|
// construction du test
|
|
Input2 = InputCouche(10);
|
|
Input1 = InputCouche(5,&Input2);
|
|
}
|
|
|
|
void InputCoucheTest::tearDown(){
|
|
// destruction du test
|
|
// delete Output;
|
|
// delete Input;
|
|
}
|
|
|
|
void InputCoucheTest::testActivate(){
|
|
vector<bool> v;
|
|
v.push_back(1);
|
|
v.push_back(0);
|
|
v.push_back(1);
|
|
v.push_back(1);
|
|
Input1.activate(v);
|
|
CPPUNIT_ASSERT( Input1[0].getWeight() == 1.0 );
|
|
CPPUNIT_ASSERT( Input1[1].getWeight() == 0.0 );
|
|
}
|
|
|
|
void InputCoucheTest::testGetChange(){
|
|
CPPUNIT_ASSERT( Input1.getChange(2,2) == 0.0 );
|
|
}
|
|
|
|
void InputCoucheTest::testActivateWrongSize(){
|
|
vector<bool> v(6);
|
|
Input1.activate(v);
|
|
}
|
|
|
|
void InputCoucheTest::testCopy(){
|
|
Input2[2] = 3.2;
|
|
Input1 = Input2;
|
|
CPPUNIT_ASSERT( Input1[2].getWeight() == 3.2 );
|
|
}
|