summaryrefslogtreecommitdiff
path: root/tests.cpp
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-01-16 02:51:22 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2023-01-16 02:51:22 -0500
commite37d4911c750550896c4155f452736200d977b83 (patch)
treed9aa75757d6bb22e0b1e2a55b7cc047f9e961662 /tests.cpp
parent766f377da3f63ea674ae3903c95cf0b512834049 (diff)
Almost done...
Diffstat (limited to 'tests.cpp')
-rw-r--r--tests.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests.cpp b/tests.cpp
index e3a283c..9a2f359 100644
--- a/tests.cpp
+++ b/tests.cpp
@@ -197,6 +197,74 @@ void Tests::tests_unitaires_couche() {
// Tests sur la classe Canevas {{{
void Tests::tests_unitaires_canevas() {
+ cout << "----- Tests de la classe Canevas -----\n\n";
+
+ cout << "--- Initialisation d'un canevas ---\n";
+ Canevas c1;
+ cout << "Couches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Ajout d'une forme (doit aller dans la couche 0) ---\n";
+ cout << "Couches: ";
+ c1.getEtats(cout);
+ cout << "Reussite: " << (c1.ajouterForme(new Carre())? "Oui":"Non")
+ << "\nAffichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Activation de la couche 3 ---\n";
+ cout << "Reussite: " << (c1.activerCouche(3)? "Oui":"Non")
+ << "\nCouches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Ajout de forme (doit aller dans la couche 3) ---\n";
+ cout << "Reussite: " << (c1.ajouterForme(new Carre())? "Oui":"Non")
+ << "\nCouches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Reinitialisation de la couche active (3) ---\n";
+ cout << "Reussite: " << (c1.reinitialiserCouche(3)? "Oui":"Non")
+ << "\nCouches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Translation de couche initialisée (couche 3 par 1,2) ---\n";
+ cout << "Reussite: " << (c1.translater(1, 2)? "Oui":"Non")
+ << "\nCouches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Translation d'une couche active (couche 0 par 1,2) ---\n";
+ c1.activerCouche(0);
+ cout << "Reussite: " << (c1.translater(1, 2)? "Oui":"Non")
+ << "\nCouches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n\n";
+
+ cout << "--- Réinitialisation du canevas ---\n";
+ cout << "Reussite: " << (c1.reinitialiser()? "Oui":"Non")
+ << "\nCouches: ";
+ c1.getEtats(cout);
+ cout << "Affichage: {\n";
+ c1.afficher(cout);
+ cout << "}\n";
+
+
}; // }}}
// Execution de tout les tests unitaires {{{