X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1a64ca4c11a1eb7ba2ecd102f877ac571486a034..5ed37babb2fa9097abe82df299c0aa259ed84d5a:/teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp diff --git a/teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp b/teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp index c9411d3e0f..32c6e7ab5d 100644 --- a/teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp +++ b/teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp @@ -1,22 +1,22 @@ -/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "activity-lifecycle.hpp" +#include "catch_simgrid.hpp" -TEST_CASE("Activity lifecycle: direct communication activities") +TEST_CASE("Activity lifecycle: direct communication (sendto) activities") { XBT_INFO("#####[ launch next \"direct-comm\" test ]#####"); - BEGIN_SECTION("dcomm") + BEGIN_SECTION("sendto") { - XBT_INFO("Launch a dcomm(5s), and let it proceed"); + XBT_INFO("Launch a sendto(5s), and let it proceed"); bool global = false; - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5", all_hosts[1], [&global]() { + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5", all_hosts[1], [&global]() { assert_exit(true, 5.); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); global = true; }); @@ -27,76 +27,76 @@ TEST_CASE("Activity lifecycle: direct communication activities") END_SECTION; } - BEGIN_SECTION("dcomm actor killed at start") + BEGIN_SECTION("sendto actor killed at start") { - XBT_INFO("Launch a dcomm(5s), and kill it right after start"); - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5_killed", all_hosts[1], []() { + XBT_INFO("Launch a sendto(5s), and kill it right after start"); + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5_killed", all_hosts[1], []() { assert_exit(false, 0); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); FAIL("I should be dead now"); }); simgrid::s4u::this_actor::yield(); - dcomm5->kill(); + sendto5->kill(); END_SECTION; } - BEGIN_SECTION("dcomm actor killed in middle") + BEGIN_SECTION("sendto actor killed in middle") { - XBT_INFO("Launch a dcomm(5s), and kill it after 2 secs"); - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5_killed", all_hosts[1], []() { + XBT_INFO("Launch a sendto(5s), and kill it after 2 secs"); + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5_killed", all_hosts[1], []() { assert_exit(false, 2); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); FAIL("I should be dead now"); }); simgrid::s4u::this_actor::sleep_for(2); - dcomm5->kill(); + sendto5->kill(); END_SECTION; } - BEGIN_SECTION("dcomm host restarted at start") + BEGIN_SECTION("sendto host restarted at start") { - XBT_INFO("Launch a dcomm(5s), and restart its host right after start"); - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5_restarted", all_hosts[1], []() { + XBT_INFO("Launch a sendto(5s), and restart its host right after start"); + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5_restarted", all_hosts[1], []() { assert_exit(false, 0); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); FAIL("I should be dead now"); }); simgrid::s4u::this_actor::yield(); - dcomm5->get_host()->turn_off(); - dcomm5->get_host()->turn_on(); + sendto5->get_host()->turn_off(); + sendto5->get_host()->turn_on(); END_SECTION; } - BEGIN_SECTION("dcomm host restarted in middle") + BEGIN_SECTION("sendto host restarted in middle") { - XBT_INFO("Launch a dcomm(5s), and restart its host after 2 secs"); - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5_restarted", all_hosts[1], []() { + XBT_INFO("Launch a sendto(5s), and restart its host after 2 secs"); + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5_restarted", all_hosts[1], []() { assert_exit(false, 2); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); FAIL("I should be dead now"); }); simgrid::s4u::this_actor::sleep_for(2); - dcomm5->get_host()->turn_off(); - dcomm5->get_host()->turn_on(); + sendto5->get_host()->turn_off(); + sendto5->get_host()->turn_on(); END_SECTION; } - BEGIN_SECTION("dcomm host restarted at end") + BEGIN_SECTION("sendto host restarted at end") { - XBT_INFO("Launch a dcomm(5s), and restart its host right when it stops"); + XBT_INFO("Launch a sendto(5s), and restart its host right when it stops"); bool execution_done = false; - simgrid::s4u::Actor::create("dcomm5_restarted", all_hosts[1], [&execution_done]() { + simgrid::s4u::Actor::create("sendto5_restarted", all_hosts[1], [&execution_done]() { assert_exit(true, 5); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); execution_done = true; }); @@ -114,12 +114,12 @@ TEST_CASE("Activity lifecycle: direct communication activities") END_SECTION; } - BEGIN_SECTION("dcomm link restarted at start") + BEGIN_SECTION("sendto link restarted at start") { - XBT_INFO("Launch a dcomm(5s), and restart the used link right after start"); - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5_restarted", all_hosts[1], []() { + XBT_INFO("Launch a sendto(5s), and restart the used link right after start"); + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5_restarted", all_hosts[1], []() { assert_exit(true, 0); - REQUIRE_NETWORK_FAILURE(all_hosts[1]->sendto(all_hosts[2], 5000)); + REQUIRE_NETWORK_FAILURE(simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000)); }); simgrid::s4u::this_actor::yield(); @@ -130,12 +130,12 @@ TEST_CASE("Activity lifecycle: direct communication activities") END_SECTION; } - BEGIN_SECTION("dcomm link restarted in middle") + BEGIN_SECTION("sendto link restarted in middle") { - XBT_INFO("Launch a dcomm(5s), and restart the used link after 2 secs"); - simgrid::s4u::ActorPtr dcomm5 = simgrid::s4u::Actor::create("dcomm5_restarted", all_hosts[1], []() { + XBT_INFO("Launch a sendto(5s), and restart the used link after 2 secs"); + simgrid::s4u::ActorPtr sendto5 = simgrid::s4u::Actor::create("sendto5_restarted", all_hosts[1], []() { assert_exit(true, 2); - REQUIRE_NETWORK_FAILURE(all_hosts[1]->sendto(all_hosts[2], 5000)); + REQUIRE_NETWORK_FAILURE(simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000)); }); simgrid::s4u::this_actor::sleep_for(2); @@ -146,14 +146,14 @@ TEST_CASE("Activity lifecycle: direct communication activities") END_SECTION; } - BEGIN_SECTION("dcomm link restarted at end") + BEGIN_SECTION("sendto link restarted at end") { - XBT_INFO("Launch a dcomm(5s), and restart the used link right when it stops"); + XBT_INFO("Launch a sendto(5s), and restart the used link right when it stops"); bool execution_done = false; - simgrid::s4u::Actor::create("dcomm5_restarted", all_hosts[1], [&execution_done]() { + simgrid::s4u::Actor::create("sendto5_restarted", all_hosts[1], [&execution_done]() { assert_exit(true, 5); - all_hosts[1]->sendto(all_hosts[2], 5000); + simgrid::s4u::Comm::sendto(all_hosts[1], all_hosts[2], 5000); execution_done = true; });