init commit

This commit is contained in:
2024-11-12 17:41:10 +01:00
parent 1e4f1f955b
commit 20bc9108d3
146 changed files with 24465 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#include "synapseMatrixTest.h"
void SynapseMatrixTest::setUp(){
// construction du test
SynM1 = new SynapseMatrix(3,2);
SynM2 = new SynapseMatrix(4,4);
}
void SynapseMatrixTest::tearDown(){
// destruction du test
delete SynM1;
delete SynM2;
}
void SynapseMatrixTest::testOperatorIndex(){
SynapseMatrix SynM3(3,5);
SynM3(0,4) = 2.1;
CPPUNIT_ASSERT( SynM3(0,4).getWeight()==2.1 );
}
void SynapseMatrixTest::testOperatorAssign(){
SynapseMatrix SynM4(5,4);
SynapseMatrix SynM5(2,2);
SynM4(3,2) = 3.2;
SynM5 = SynM4;
CPPUNIT_ASSERT( SynM5(3,2).getWeight()==3.2 );
}
void SynapseMatrixTest::testInit(){
// verifie les assignations du constructeur de la classe
CPPUNIT_ASSERT( SynM1->getLineCount()==3 );
CPPUNIT_ASSERT( SynM2->getLineCount()==4 );
CPPUNIT_ASSERT( SynM1->getColumnCount()==2 );
CPPUNIT_ASSERT( SynM2->getColumnCount()==4 );
}