Unverified Commit 88976e07 authored by Merwane Bouri's avatar Merwane Bouri
Browse files

Alphabet test

parent ca9d9c7e
Pipeline #78773 passed with stages
in 18 seconds
......@@ -11,6 +11,8 @@
#include "neighborhoodWidget.hpp"
#include <QJsonArray>
#include <QDate>
#include <QTextStream>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
......
......@@ -3,6 +3,7 @@
#include <QJsonDocument>
#include <QMessageBox>
#include <QTextStream>
ModelLoadingDialog::ModelLoadingDialog(QWidget *parent) :
QDialog(parent),
......
......@@ -15,6 +15,7 @@
#include <QFileInfo>
#include "structure.hpp"
#include <vector>
#include <QTextStream>
char StructureReader::peek() const
{
......
......@@ -7,35 +7,35 @@
void CellulutTests::test_alphabet(){
Alphabet a;
stateColor c1('a','b','c');
stateColor c1(1,5,126);
state s1(c1,"Alpha");
a.newEtat(s1);
stateColor c2('d','e','f');
stateColor c2(144,245,74);
state s2(c2,"beta");
a.newEtat(s2);
stateColor c3('g','h','i');
/*stateColor c3('g','h','i');
state s3(c3,"gamma");
a.newEtat(s3);
a.newEtat(s3);*/
// L'alphabet possède toujours un état 0, chaque état qui est ajouté commence au numéro 1
state test=a.getState(1);
stateColor sc =test.getColor();
char cb=sc.getBlue();
char cr=sc.getRed();
char cg=sc.getGreen();
QCOMPARE(cb,'c');
QCOMPARE(cg,'b');
QCOMPARE(cr,'a');
unsigned char cb=sc.getBlue();
unsigned char cr=sc.getRed();
unsigned char cg=sc.getGreen();
QCOMPARE(cb,126);
QCOMPARE(cg,5);
QCOMPARE(cr,1);
state test2=a.getState(2);
stateColor sc2 =test2.getColor();
char cb2=sc2.getBlue();
char cr2=sc2.getRed();
char cg2=sc2.getGreen();
QCOMPARE(cb2,'f');
QCOMPARE(cg2,'e');
QCOMPARE(cr2,'d');
unsigned char cb2=sc2.getBlue();
unsigned char cr2=sc2.getRed();
unsigned char cg2=sc2.getGreen();
QCOMPARE(cb2,74);
QCOMPARE(cg2,245);
QCOMPARE(cr2,144);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment