diff --git a/forms/neighborhoodDialog.ui b/forms/neighborhoodDialog.ui index 7232c50fd49cc206ccdd2c3a1306a1208a305d93..e36028f3fb342492e44b887eba0404dea70c35f8 100644 --- a/forms/neighborhoodDialog.ui +++ b/forms/neighborhoodDialog.ui @@ -63,7 +63,7 @@ <string>Width :</string> </property> <property name="buddy"> - <cstring>widthSpinBox</cstring> + <cstring>widthSpinBox_2</cstring> </property> </widget> </item> @@ -86,7 +86,7 @@ <string>Height :</string> </property> <property name="buddy"> - <cstring>heightSpinBox</cstring> + <cstring>heightSpinBox_2</cstring> </property> </widget> </item> diff --git a/include/neighborhoodrule.hpp b/include/neighborhoodrule.hpp index 97ae842ba6f27c74d49a690488d5bc9c8bd00b89..01a57ba75002642f081a3736f541376e701eba1a 100644 --- a/include/neighborhoodrule.hpp +++ b/include/neighborhoodrule.hpp @@ -49,7 +49,7 @@ public: //! \brief Change le numéro de génération de la règle de voisinage d'une génération //! Fait avancer ou reculer l'état de la règle de voisinage d'une génération. Cette fonction est utilisée pour les voisinages tels que celui de Margolus, qui dépendent de la parité de la génération actuelle. //! \remark L'implémentation par défaut ne fait rien. - virtual void update_generation(unsigned gen) {} + virtual void update_generation(unsigned gen) { (void)gen; } }; #endif // NEIGHBORHOODRULE_HPP diff --git a/src/structurelibraryview.cpp b/src/structurelibraryview.cpp index 7314f1142e777b835c55ad8d3ab1420ceb2bf13c..2ae234f3a17b4ec3c37c209450923ab1014807c7 100644 --- a/src/structurelibraryview.cpp +++ b/src/structurelibraryview.cpp @@ -126,7 +126,6 @@ void StructureLibraryView::update_preview(const Structure &s) QImage StructureLibraryView::create_preview_image(const Structure &s, bool transparent) { - stateColor bg = m_alph.getState(0).getColor(); QImage img(s.width(), s.height(), QImage::Format_ARGB32); if (transparent) img.fill(Qt::transparent); diff --git a/tests/arbitraryneighborhoodrule_test.cpp b/tests/arbitraryneighborhoodrule_test.cpp index 99d58b5d4f5e9b65adbe1c25c541ebda4aa61766..71c57550e21ca0ae5dcb40698aefe7906b5956f2 100644 --- a/tests/arbitraryneighborhoodrule_test.cpp +++ b/tests/arbitraryneighborhoodrule_test.cpp @@ -31,7 +31,7 @@ void CellulutTests::test_arbitrary_neighborhood_rule() prop->accept(visit); } - QCOMPARE(rule.getFormats().size(), 1); + QCOMPARE(rule.getFormats().size(), 1ul); QCOMPARE(rule.getFormats()[0].positions.size(), coords.size()); auto list = rule.getFormats()[0].positions; diff --git a/tests/circulartransition_test.cpp b/tests/circulartransition_test.cpp index 1e9f47446890ad92cf4082a90968f37d10f70a45..609734f9d79afba979525c7b3d6175d4241c6eb2 100644 --- a/tests/circulartransition_test.cpp +++ b/tests/circulartransition_test.cpp @@ -24,7 +24,7 @@ void CellulutTests::test_circulartransition() n.addNeighbor({1, 0}, 0); n.addNeighbor({-1, 0}, 1); - unsigned next = rule.getState(0, n); + int next = rule.getState(0, n); QCOMPARE(next, 0); } @@ -36,7 +36,7 @@ void CellulutTests::test_circulartransition() n.addNeighbor({1, 0}, 1); n.addNeighbor({-1, 0}, 0); - unsigned next = rule.getState(0, n); + int next = rule.getState(0, n); QCOMPARE(next, 1); } @@ -48,7 +48,7 @@ void CellulutTests::test_circulartransition() n.addNeighbor({1, 0}, 2); n.addNeighbor({-1, 0}, 0); - unsigned next = rule.getState(1, n); + int next = rule.getState(1, n); QCOMPARE(next, 2); } @@ -60,7 +60,7 @@ void CellulutTests::test_circulartransition() n.addNeighbor({1, 0}, 0); n.addNeighbor({-1, 0}, 0); - unsigned next = rule.getState(3, n); + int next = rule.getState(3, n); QCOMPARE(next, 0); } } diff --git a/tests/grid_test.cpp b/tests/grid_test.cpp index 362dc7974b1c91bcca2e5ade02c71c826fdabe54..74089c45bd451089aca5a962a80c816a2c0576e5 100644 --- a/tests/grid_test.cpp +++ b/tests/grid_test.cpp @@ -13,7 +13,7 @@ void CellulutTests::test_grid() grid.set_cell(pos2,10); Coord pos3 = {1,2}; grid.set_cell(pos3,1); - unsigned int state = grid.get_state(pos1); + int state = grid.get_state(pos1); QCOMPARE(state, 2); QVERIFY(grid.get_state(pos2) == 10); QVERIFY(grid.get_state(pos3) == 1); diff --git a/tests/history_test.cpp b/tests/history_test.cpp index 06755022bce5ca1e0787a770ff058776230deca4..e9198463e9899a15287bb890248308248bb8032a 100644 --- a/tests/history_test.cpp +++ b/tests/history_test.cpp @@ -27,12 +27,12 @@ void CellulutTests::test_history() // On pop la première grille puis la deuxième Grid popGrid = historyTest.popGrid(); - QCOMPARE(popGrid.get_state(pos2), 3); + QCOMPARE(popGrid.get_state(pos2), 3ul); Grid topGrid = historyTest.topGrid(); QVERIFY(topGrid.get_state(pos1) == 2); popGrid = historyTest.popGrid(); - QCOMPARE(popGrid.get_state(pos1), 2); + QCOMPARE(popGrid.get_state(pos1), 2ul); QVERIFY(historyTest.isEmpty() == true); // Push de trois grille (taille max de la pile de l'history = 2) @@ -41,11 +41,11 @@ void CellulutTests::test_history() historyTest.pushGrid(gridTest3); // La première grille est supprimée popGrid = historyTest.popGrid(); - QCOMPARE(popGrid.get_state(pos3), 4); + QCOMPARE(popGrid.get_state(pos3), 4ul); topGrid = historyTest.topGrid(); QVERIFY(topGrid.get_state(pos2) == 3); popGrid = historyTest.popGrid(); - QCOMPARE(popGrid.get_state(pos2), 3); + QCOMPARE(popGrid.get_state(pos2), 3ul); QVERIFY(historyTest.isEmpty() == true); } diff --git a/tests/lifegametransition_test.cpp b/tests/lifegametransition_test.cpp index af7b353054b711eaee22203a7b928678664da82a..d9fe463077ec42f98ca7c11b6738d62f11f9fcdf 100644 --- a/tests/lifegametransition_test.cpp +++ b/tests/lifegametransition_test.cpp @@ -14,7 +14,7 @@ void CellulutTests::test_lifegametransition() n.addNeighbor({1, 0}, 0); n.addNeighbor({-1, 0}, 1); - unsigned next = rule.getState(0, n); + int next = rule.getState(0, n); QCOMPARE(next, 0); } @@ -26,7 +26,7 @@ void CellulutTests::test_lifegametransition() n.addNeighbor({1, 0}, 0); n.addNeighbor({-1, 0}, 1); - unsigned next = rule.getState(0, n); + int next = rule.getState(0, n); QCOMPARE(next, 1); } @@ -38,7 +38,7 @@ void CellulutTests::test_lifegametransition() n.addNeighbor({1, 0}, 0); n.addNeighbor({-1, 0}, 0); - unsigned next = rule.getState(1, n); + int next = rule.getState(1, n); QCOMPARE(next, 1); } @@ -51,7 +51,7 @@ void CellulutTests::test_lifegametransition() n.addNeighbor({-1, 0}, 1); n.addNeighbor({-1, -1}, 1); - unsigned next = rule.getState(1, n); + int next = rule.getState(1, n); QCOMPARE(next, 0); } @@ -63,7 +63,7 @@ void CellulutTests::test_lifegametransition() n.addNeighbor({1, 0}, 1); n.addNeighbor({-1, 0}, 0); - unsigned next = rule.getState(1, n); + int next = rule.getState(1, n); QCOMPARE(next, 0); } } diff --git a/tests/mooreNeighborhoodRule_test.cpp b/tests/mooreNeighborhoodRule_test.cpp index 7e528f683d63f85021d50f96c3e3f92357e7f34c..4362c3478902d2ec0e67a3ec9e58737a091b4ae3 100644 --- a/tests/mooreNeighborhoodRule_test.cpp +++ b/tests/mooreNeighborhoodRule_test.cpp @@ -52,12 +52,12 @@ void CellulutTests::test_mooreNeighborhoodRule() { prop->accept(visit); Neighborhood v=newMoore.getNeighborhood(g,cellule); - unsigned int nb_voi=v.getNb(3); - unsigned int nb_voi2=v.getNb(5); - unsigned int nb_voi3=v.getNb(2); - unsigned int nb_voi4=v.getNb(8); - unsigned int nb_voi5=v.getNb(7); - unsigned int nb_voi6=v.getNb(4); + int nb_voi=v.getNb(3); + int nb_voi2=v.getNb(5); + int nb_voi3=v.getNb(2); + int nb_voi4=v.getNb(8); + int nb_voi5=v.getNb(7); + int nb_voi6=v.getNb(4); QCOMPARE(nb_voi,2); QCOMPARE(nb_voi2,2); diff --git a/tests/mooreVonNeumann_test.cpp b/tests/mooreVonNeumann_test.cpp index 2d95741e8a69e6573a7db1da871e24b0578389b5..7a0a633d24f1c92b7a878c2c3ba08ea2249324f7 100644 --- a/tests/mooreVonNeumann_test.cpp +++ b/tests/mooreVonNeumann_test.cpp @@ -19,10 +19,10 @@ void CellulutTests::test_VonNeumann(){ vonNeumannNeighborhoodRule voi(1); Neighborhood v=voi.getNeighborhood(g,cellule); - unsigned int nb_voi=v.getNb(3); - unsigned int nb_voi2=v.getNb(5); - unsigned int nb_voi3=v.getNb(2); - unsigned int nb_voi4=v.getNb(8); + int nb_voi=v.getNb(3); + int nb_voi2=v.getNb(5); + int nb_voi3=v.getNb(2); + int nb_voi4=v.getNb(8); QCOMPARE(nb_voi,2); QCOMPARE(nb_voi2,1); QCOMPARE(nb_voi3,1); diff --git a/tests/nonisotropictransition_test.cpp b/tests/nonisotropictransition_test.cpp index aa3a2c826d827407d072059ec2d46afa9bd2aa42..41cecb6788269cf259ed53f367e23d01101883cd 100644 --- a/tests/nonisotropictransition_test.cpp +++ b/tests/nonisotropictransition_test.cpp @@ -18,7 +18,7 @@ void CellulutTests::test_nonisotropictransition() unsigned next = 0; bool accepted = entry.accept(0, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -46,7 +46,7 @@ void CellulutTests::test_nonisotropictransition() unsigned next = 0; bool accepted = entry.accept(0, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -73,7 +73,7 @@ void CellulutTests::test_nonisotropictransition() unsigned next = 0; bool accepted = entry.accept(0, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -93,7 +93,7 @@ void CellulutTests::test_nonisotropictransition() neighborhood.addNeighbor({0, -1}, 1); // index 0 neighborhood.addNeighbor({-1, 0}, 0); // index 1 unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -103,7 +103,7 @@ void CellulutTests::test_nonisotropictransition() neighborhood.addNeighbor({0, -1}, 0); // index 0 neighborhood.addNeighbor({-1, 0}, 1); // index 1 unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { Neighborhood neighborhood; @@ -112,7 +112,7 @@ void CellulutTests::test_nonisotropictransition() neighborhood.addNeighbor({0, -1}, 0); // index 0 neighborhood.addNeighbor({-1, 0}, 0); // index 1 unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { Neighborhood neighborhood; @@ -121,7 +121,7 @@ void CellulutTests::test_nonisotropictransition() neighborhood.addNeighbor({0, -1}, 0); // index 0 neighborhood.addNeighbor({-1, 0}, 0); // index 1 unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { Neighborhood neighborhood; @@ -130,7 +130,7 @@ void CellulutTests::test_nonisotropictransition() neighborhood.addNeighbor({0, -1}, 1); // index 0 neighborhood.addNeighbor({-1, 0}, 0); // index 1 unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); } } } diff --git a/tests/property_test.cpp b/tests/property_test.cpp index bc8a338c8d6cfc22203e40a510e5e097e50d95b1..4761801a5e72bbcd967c0647c117db48278badf5 100644 --- a/tests/property_test.cpp +++ b/tests/property_test.cpp @@ -28,7 +28,7 @@ void CellulutTests::test_property() test.coords.load_from_neighborhood(n); - QCOMPARE(test.coords.size(), 3); + QCOMPARE(test.coords.size(), 3ul); for (unsigned i = 0; i < test.coords.size(); ++i) { CoordinateProperty& coord = static_cast<CoordinateProperty&>(test.coords.at(i)); diff --git a/tests/structure_test.cpp b/tests/structure_test.cpp index 3f8cf733e639d8fc8381e991ea2f1be9c47e9cca..6c95dc6ee4ce8c30faf4d60931284d3eef4fbad8 100644 --- a/tests/structure_test.cpp +++ b/tests/structure_test.cpp @@ -24,8 +24,8 @@ void CellulutTests::test_structure() QVERIFY(std::is_permutation(normalized_coords.begin(), normalized_coords.end(), s1.begin())); QVERIFY(std::is_permutation(normalized_coords.begin(), normalized_coords.end(), s2.begin())); - QCOMPARE(s1.width(), 3); - QCOMPARE(s1.height(), 2); + QCOMPARE(s1.width(), 3ul); + QCOMPARE(s1.height(), 2ul); s1.load(empty.begin(), empty.end()); QVERIFY(s1.size() == 0); @@ -40,8 +40,8 @@ void CellulutTests::test_structure() QCOMPARE(s1.size(), coords.size()); // 2 cellules non nulles, on ignore les cellules à zéro qui sont toujours implicites QVERIFY(std::is_permutation(normalized_coords.begin(), normalized_coords.end(), s1.begin())); - QCOMPARE(s1.width(), 3); - QCOMPARE(s1.height(), 2); + QCOMPARE(s1.width(), 3ul); + QCOMPARE(s1.height(), 2ul); } } diff --git a/tests/structurereader_tests.cpp b/tests/structurereader_tests.cpp index 7745062a69f6945e24191091a238e431a5d1c540..84b55c25b5936502222f6162a1a2a67652797082 100644 --- a/tests/structurereader_tests.cpp +++ b/tests/structurereader_tests.cpp @@ -39,7 +39,7 @@ void CellulutTests::test_rle_structurereader() try { Structure stru = rle.read_structure(); - QCOMPARE(stru.size(), 5); + QCOMPARE(stru.size(), 5ul); QVERIFY(std::count(stru.begin(), stru.end(), std::make_pair<Coord, unsigned>(Coord{1, 0}, 1)) == 1); } catch (const std::exception& ex) @@ -55,7 +55,7 @@ void CellulutTests::test_rle_structurereader() try { Structure stru = rle.read_structure(); - QCOMPARE(stru.size(), 36); + QCOMPARE(stru.size(), 36ul); } catch (const std::exception& ex) { @@ -70,7 +70,7 @@ void CellulutTests::test_rle_structurereader() try { Structure stru = rle.read_structure(); - QCOMPARE(stru.size(), 16); + QCOMPARE(stru.size(), 16ul); std::map<int, int> state_count; for (auto pair : stru) @@ -96,7 +96,7 @@ void CellulutTests::test_json_structurereader() try { Structure stru = rle.read_structure(); - QCOMPARE(stru.size(), 2); + QCOMPARE(stru.size(), 2ul); QVERIFY(std::count(stru.begin(), stru.end(), std::make_pair<Coord, unsigned>(Coord{0, 0}, 1)) == 1); QVERIFY(std::count(stru.begin(), stru.end(), std::make_pair<Coord, unsigned>(Coord{2, 3}, 3)) == 1); } diff --git a/tests/totalistictransition_test.cpp b/tests/totalistictransition_test.cpp index a0540f30cf63a0331d7538a384c66b364a6c0b65..98483b1f51ce715010ddb065f0e9b38e0d87acd4 100644 --- a/tests/totalistictransition_test.cpp +++ b/tests/totalistictransition_test.cpp @@ -28,7 +28,7 @@ void CellulutTests::test_totalistictransition() unsigned next = 0; bool accepted = entry.accept(0, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -42,7 +42,7 @@ void CellulutTests::test_totalistictransition() unsigned next = 0; bool accepted = entry.accept(1, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 2); + QCOMPARE(next, 2u); } { @@ -56,7 +56,7 @@ void CellulutTests::test_totalistictransition() unsigned next = 0; bool accepted = entry.accept(2, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); } { @@ -83,7 +83,7 @@ void CellulutTests::test_totalistictransition() unsigned next = 1; bool accepted = entry.accept(1, neighborhood, next); QVERIFY(accepted); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); } { @@ -104,13 +104,13 @@ void CellulutTests::test_totalistictransition() neighborhood.addNeighbor({0, -1}, 1); neighborhood.addNeighbor({-1, 0}, 2); unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); next = rule.getState(1, neighborhood); - QCOMPARE(next, 2); + QCOMPARE(next, 2u); next = rule.getState(2, neighborhood); - QCOMPARE(next, 3); + QCOMPARE(next, 3u); next = rule.getState(3, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -120,13 +120,13 @@ void CellulutTests::test_totalistictransition() neighborhood.addNeighbor({0, -1}, 1); neighborhood.addNeighbor({-1, 0}, 1); unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); next = rule.getState(1, neighborhood); - QCOMPARE(next, 2); + QCOMPARE(next, 2u); next = rule.getState(2, neighborhood); - QCOMPARE(next, 3); + QCOMPARE(next, 3u); next = rule.getState(3, neighborhood); - QCOMPARE(next, 3); + QCOMPARE(next, 3u); } } @@ -148,9 +148,9 @@ void CellulutTests::test_totalistictransition() neighborhood.addNeighbor({0, -1}, 1); neighborhood.addNeighbor({-1, 0}, 1); unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); next = rule.getState(1, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -160,9 +160,9 @@ void CellulutTests::test_totalistictransition() neighborhood.addNeighbor({0, -1}, 0); neighborhood.addNeighbor({-1, 0}, 1); unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); next = rule.getState(1, neighborhood); - QCOMPARE(next, 1); + QCOMPARE(next, 1u); } { @@ -172,9 +172,9 @@ void CellulutTests::test_totalistictransition() neighborhood.addNeighbor({0, -1}, 0); neighborhood.addNeighbor({-1, 0}, 0); unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); next = rule.getState(1, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); } { @@ -184,9 +184,9 @@ void CellulutTests::test_totalistictransition() neighborhood.addNeighbor({0, -1}, 1); neighborhood.addNeighbor({-1, 0}, 1); unsigned next = rule.getState(0, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); next = rule.getState(1, neighborhood); - QCOMPARE(next, 0); + QCOMPARE(next, 0u); } } }