1 /* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/3rd-party/catch.hpp"
7 #include "src/mc/explo/udpor/Unfolding.hpp"
8 #include "src/mc/explo/udpor/udpor_tests_private.hpp"
10 using namespace simgrid::mc;
11 using namespace simgrid::mc::udpor;
13 TEST_CASE("simgrid::mc::udpor::Unfolding: Creating an unfolding")
16 REQUIRE(unfolding.size() == 0);
17 REQUIRE(unfolding.empty());
20 TEST_CASE("simgrid::mc::udpor::Unfolding: Inserting and marking events with an unfolding")
23 auto e1 = std::make_unique<UnfoldingEvent>(
24 EventSet(), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 0));
26 std::make_unique<UnfoldingEvent>(EventSet(), std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 1));
27 auto* e1_handle = e1.get();
28 auto* e2_handle = e2.get();
30 unfolding.insert(std::move(e1));
31 REQUIRE(unfolding.size() == 1);
32 REQUIRE_FALSE(unfolding.empty());
34 unfolding.insert(std::move(e2));
35 REQUIRE(unfolding.size() == 2);
36 REQUIRE_FALSE(unfolding.empty());
38 unfolding.mark_finished(e1_handle);
39 REQUIRE(unfolding.size() == 2);
40 REQUIRE_FALSE(unfolding.empty());
42 unfolding.mark_finished(e2_handle);
43 REQUIRE(unfolding.size() == 2);
44 REQUIRE_FALSE(unfolding.empty());
47 TEST_CASE("simgrid::mc::udpor::Unfolding: Checking all immediate conflicts restricted to an unfolding") {}