Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
88976e07
Unverified
Commit
88976e07
authored
May 29, 2021
by
Merwane Bouri
Browse files
Alphabet test
parent
ca9d9c7e
Pipeline
#78773
passed with stages
in 18 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/interface.cpp
View file @
88976e07
...
...
@@ -11,6 +11,8 @@
#include "neighborhoodWidget.hpp"
#include <QJsonArray>
#include <QDate>
#include <QTextStream>
MainWindow
::
MainWindow
(
QWidget
*
parent
)
:
QMainWindow
(
parent
)
...
...
src/modelloadingdialog.cpp
View file @
88976e07
...
...
@@ -3,6 +3,7 @@
#include <QJsonDocument>
#include <QMessageBox>
#include <QTextStream>
ModelLoadingDialog
::
ModelLoadingDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
),
...
...
src/structurereader.cpp
View file @
88976e07
...
...
@@ -15,6 +15,7 @@
#include <QFileInfo>
#include "structure.hpp"
#include <vector>
#include <QTextStream>
char
StructureReader
::
peek
()
const
{
...
...
tests/alphabet_test.cpp
View file @
88976e07
...
...
@@ -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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment