X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d1614bd7c880c562af7dce339b0564a21f30c24d..16925d4563b0fd3a17dc7c05f91c9439e6fb2462:/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp diff --git a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp index 91d68f6589..e201a0eeed 100644 --- a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp +++ b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2019. 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. */ @@ -40,7 +40,6 @@ static void usage(const char* binaryName, const char* defaultSend, const char* d "Example 1: %s examples/platforms/cluster_backbone.xml rRiIdD rrrrrr # testing all send functions\n" "Default specs: %s %s (all possible pairs)\n", binaryName, binaryName, defaultSend, defaultRecv); - exit(1); } static void sender(std::vector args) @@ -49,7 +48,7 @@ static void sender(std::vector args) for (unsigned int test = 1; test <= args[0].size(); test++) { simgrid::s4u::this_actor::sleep_until(test * 5 - 5); std::string* mboxName = new std::string("Test #" + std::to_string(test)); - simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName->c_str()); + simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(*mboxName); switch (args[0][test - 1]) { case 'r': @@ -96,7 +95,7 @@ static void receiver(std::vector args) for (unsigned int test = 1; test <= args[0].size(); test++) { simgrid::s4u::this_actor::sleep_until(test * 5 - 5); std::string mboxName = "Test #" + std::to_string(test); - simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName.c_str()); + simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName); void* received = nullptr; switch (args[0][test - 1]) { @@ -144,7 +143,7 @@ static void receiver(std::vector args) default: xbt_die("Unknown receiver spec for test %u: '%c'", test, args[0][test - 1]); } - std::string* receivedStr = static_cast(received); + const std::string* receivedStr = static_cast(received); xbt_assert(*receivedStr == mboxName); delete receivedStr; XBT_INFO("Test %u OK", test); @@ -165,8 +164,10 @@ int main(int argc, char* argv[]) std::vector argRecv{specRecv.c_str()}; simgrid::s4u::Engine e(&argc, argv); - if (argc < 2) + if (argc < 2) { usage(argv[0], specSend.c_str(), specRecv.c_str()); + return 1; + } e.load_platform(argv[1]);