X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2dab73b61a6ad4feb7d2d267bf5621c7b95926b3..e63c67321577f0816604fe730cd0bc856970454d:/src/mc/sosp/Snapshot_test.cpp diff --git a/src/mc/sosp/Snapshot_test.cpp b/src/mc/sosp/Snapshot_test.cpp index c961a37c27..63c114cdde 100644 --- a/src/mc/sosp/Snapshot_test.cpp +++ b/src/mc/sosp/Snapshot_test.cpp @@ -8,6 +8,7 @@ #include "src/mc/sosp/Snapshot.hpp" #include +#include #include #include @@ -45,7 +46,7 @@ std::unique_ptr snap_test_helper::process = nullp void snap_test_helper::init_memory(void* mem, size_t size) { - char* dest = (char*)mem; + auto* dest = static_cast(mem); for (size_t i = 0; i < size; ++i) { dest[i] = simgrid::xbt::random::uniform_int(0, 0xff); } @@ -56,7 +57,7 @@ void snap_test_helper::Init() REQUIRE(xbt_pagesize == getpagesize()); REQUIRE(1 << xbt_pagebits == xbt_pagesize); - process.reset(new simgrid::mc::RemoteSimulation(getpid())); + process = std::make_unique(getpid()); process->init(); mc_model_checker = new ::simgrid::mc::ModelChecker(std::move(process), -1); } @@ -71,11 +72,11 @@ snap_test_helper::prologue_return snap_test_helper::prologue(int n) // Init memory and take snapshots: init_memory(source, byte_size); - simgrid::mc::Region* region0 = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size); + auto* region0 = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size); for (int i = 0; i < n; i += 2) { init_memory((char*)source + i * xbt_pagesize, xbt_pagesize); } - simgrid::mc::Region* region = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size); + auto* region = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size); void* destination = mmap(nullptr, byte_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); INFO("Could not allocate destination memory");