]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/explo/udpor/Configuration_test.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove unused variable
[simgrid.git] / src / mc / explo / udpor / Configuration_test.cpp
index 4e3337816e4b0ca4b68f7514e2b81f5df6f4f065..a20f38214d1c66988004643a3b749c3711e68918 100644 (file)
@@ -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
 
@@ -377,15 +377,13 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Topological Sort Order Very Compli
 
     SECTION("Forward direction")
     {
-      auto ordered_events              = C.get_topologically_sorted_events();
-      const EventSet ordered_event_set = EventSet(std::move(ordered_events));
+      const auto ordered_event_set = EventSet(C.get_topologically_sorted_events());
       REQUIRE(events_seen == ordered_event_set);
     }
 
     SECTION("Reverse direction")
     {
-      auto ordered_events              = C.get_topologically_sorted_events_of_reverse_graph();
-      const EventSet ordered_event_set = EventSet(std::move(ordered_events));
+      const auto ordered_event_set = EventSet(C.get_topologically_sorted_events_of_reverse_graph());
       REQUIRE(events_seen == ordered_event_set);
     }
   }
@@ -814,47 +812,47 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Computing Full Alternatives in Rea
 
   auto e0 = std::make_unique<UnfoldingEvent>(
       EventSet(), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e0_handle = e0.get();
+  const auto* e0_handle = e0.get();
 
   auto e1        = std::make_unique<UnfoldingEvent>(EventSet({e0_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e1_handle = e1.get();
+  const auto* e1_handle = e1.get();
 
   auto e2 = std::make_unique<UnfoldingEvent>(
       EventSet({e1_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 1));
-  auto e2_handle = e2.get();
+  const auto* e2_handle = e2.get();
 
   auto e3 = std::make_unique<UnfoldingEvent>(
       EventSet({e1_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 2));
-  auto e3_handle = e3.get();
+  const auto* e3_handle = e3.get();
 
   auto e4 = std::make_unique<UnfoldingEvent>(
       EventSet({e0_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 1));
-  auto e4_handle = e4.get();
+  const auto* e4_handle = e4.get();
 
   auto e5        = std::make_unique<UnfoldingEvent>(EventSet({e4_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e5_handle = e5.get();
+  const auto* e5_handle = e5.get();
 
   auto e6 = std::make_unique<UnfoldingEvent>(
       EventSet({e5_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 2));
-  auto e6_handle = e6.get();
+  const auto* e6_handle = e6.get();
 
   auto e7 = std::make_unique<UnfoldingEvent>(
       EventSet({e0_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 2));
-  auto e7_handle = e7.get();
+  const auto* e7_handle = e7.get();
 
   auto e8        = std::make_unique<UnfoldingEvent>(EventSet({e4_handle, e7_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e8_handle = e8.get();
+  const auto* e8_handle = e8.get();
 
   auto e9        = std::make_unique<UnfoldingEvent>(EventSet({e7_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e9_handle = e9.get();
+  const auto* e9_handle = e9.get();
 
   auto e10 = std::make_unique<UnfoldingEvent>(
       EventSet({e9_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 1));
-  auto e10_handle = e10.get();
+  const auto* e10_handle = e10.get();
 
   SECTION("Alternative computation call 1")
   {
@@ -969,7 +967,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})));
   }
 
@@ -1059,8 +1057,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})));
   }