X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/40dce35f15dc40d85f79d70ec96fbc3db6c6eb68..7ddc46fcc39e6327b6dc919a3bcf25524f735d74:/src/mc/explo/udpor/Configuration_test.cpp diff --git a/src/mc/explo/udpor/Configuration_test.cpp b/src/mc/explo/udpor/Configuration_test.cpp index 85c7664274..2972ad9e65 100644 --- a/src/mc/explo/udpor/Configuration_test.cpp +++ b/src/mc/explo/udpor/Configuration_test.cpp @@ -330,7 +330,7 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Topological Sort Order Very Compli std::for_each(ordered_events.begin(), ordered_events.end(), [&events_seen](const UnfoldingEvent* e) { History history(e); - for (auto* e_hist : history) { + for (const auto* e_hist : history) { // In this demo, we want to make sure that // we don't mark not yet seeing `e` as an error. // The history of `e` traverses `e` itself. All @@ -358,7 +358,7 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Topological Sort Order Very Compli std::for_each(ordered_events.begin(), ordered_events.end(), [&events_seen](const UnfoldingEvent* e) { History history(e); - for (auto* e_hist : history) { + for (const auto* e_hist : history) { // Unlike the test above, we DO want to ensure // that `e` itself ALSO isn't yet seen @@ -466,7 +466,8 @@ TEST_CASE("simgrid::mc::udpor::maximal_subsets_iterator: Basic Testing of Maxima { EventSet interesting_bunch{&e2, &e4, &e7, &e8}; - maximal_subsets_iterator first(C, [&](const UnfoldingEvent* e) { return interesting_bunch.contains(e); }); + maximal_subsets_iterator first( + C, [&interesting_bunch](const UnfoldingEvent* e) { return interesting_bunch.contains(e); }); maximal_subsets_iterator last; for (; first != last; ++first) { @@ -499,7 +500,8 @@ TEST_CASE("simgrid::mc::udpor::maximal_subsets_iterator: Basic Testing of Maxima { EventSet interesting_bunch{&e3, &e5, &e6}; - maximal_subsets_iterator first(C, [&](const UnfoldingEvent* e) { return interesting_bunch.contains(e); }); + maximal_subsets_iterator first( + C, [&interesting_bunch](const UnfoldingEvent* e) { return interesting_bunch.contains(e); }); maximal_subsets_iterator last; for (; first != last; ++first) { @@ -812,47 +814,47 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Computing Full Alternatives in Rea auto e0 = std::make_unique( EventSet(), std::make_shared(Transition::Type::UNKNOWN, 0)); - auto e0_handle = e0.get(); + const auto* e0_handle = e0.get(); auto e1 = std::make_unique(EventSet({e0_handle}), std::make_shared(Transition::Type::UNKNOWN, 0)); - auto e1_handle = e1.get(); + const auto* e1_handle = e1.get(); auto e2 = std::make_unique( EventSet({e1_handle}), std::make_shared(Transition::Type::UNKNOWN, 1)); - auto e2_handle = e2.get(); + const auto* e2_handle = e2.get(); auto e3 = std::make_unique( EventSet({e1_handle}), std::make_shared(Transition::Type::UNKNOWN, 2)); - auto e3_handle = e3.get(); + const auto* e3_handle = e3.get(); auto e4 = std::make_unique( EventSet({e0_handle}), std::make_shared(Transition::Type::UNKNOWN, 1)); - auto e4_handle = e4.get(); + const auto* e4_handle = e4.get(); auto e5 = std::make_unique(EventSet({e4_handle}), std::make_shared(Transition::Type::UNKNOWN, 0)); - auto e5_handle = e5.get(); + const auto* e5_handle = e5.get(); auto e6 = std::make_unique( EventSet({e5_handle}), std::make_shared(Transition::Type::UNKNOWN, 2)); - auto e6_handle = e6.get(); + const auto* e6_handle = e6.get(); auto e7 = std::make_unique( EventSet({e0_handle}), std::make_shared(Transition::Type::UNKNOWN, 2)); - auto e7_handle = e7.get(); + const auto* e7_handle = e7.get(); auto e8 = std::make_unique(EventSet({e4_handle, e7_handle}), std::make_shared(Transition::Type::UNKNOWN, 0)); - auto e8_handle = e8.get(); + const auto* e8_handle = e8.get(); auto e9 = std::make_unique(EventSet({e7_handle}), std::make_shared(Transition::Type::UNKNOWN, 0)); - auto e9_handle = e9.get(); + const auto* e9_handle = e9.get(); auto e10 = std::make_unique( EventSet({e9_handle}), std::make_shared(Transition::Type::UNKNOWN, 1)); - auto e10_handle = e10.get(); + const auto* e10_handle = e10.get(); SECTION("Alternative computation call 1") { @@ -967,7 +969,7 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Computing Full Alternatives in Rea // The first alternative that is found is the one that is chosen. Since // traversal over the elements of an unordered_set<> are not guaranteed, // both {e0, e4} and {e0, e7} are valid alternatives - REQUIRE((alternative.value().get_events() == EventSet({e0_handle, e4_handle}) or + REQUIRE((alternative.value().get_events() == EventSet({e0_handle, e4_handle}) || alternative.value().get_events() == EventSet({e0_handle, e7_handle}))); } @@ -1057,8 +1059,8 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Computing Full Alternatives in Rea const auto alternative = C.compute_alternative_to(D_plus_e, U); REQUIRE(alternative.has_value()); - REQUIRE((alternative.value().get_events() == EventSet({e0_handle, e7_handle}) or - alternative.value().get_events() == EventSet({e0_handle, e4_handle, e7_handle}) or + REQUIRE((alternative.value().get_events() == EventSet({e0_handle, e7_handle}) || + alternative.value().get_events() == EventSet({e0_handle, e4_handle, e7_handle}) || alternative.value().get_events() == EventSet({e0_handle, e4_handle, e7_handle, e8_handle}))); } @@ -1364,4 +1366,4 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Computing Full Alternatives in Rea REQUIRE(alternative.value().get_events() == EventSet({e0_handle, e7_handle, e9_handle})); } } -} \ No newline at end of file +}