A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unnecessary calls to c_str().
[simgrid.git]
/
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
f160b23
..
bc625c9
100644
(file)
--- a/
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
+++ b/
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-201
9
. 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. */
/* 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. */
@@
-16,11
+16,9
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
-using namespace simgrid::s4u;
-
static void usage(const char* binaryName, const char* defaultSend, const char* defaultRecv)
{
static void usage(const char* binaryName, const char* defaultSend, const char* defaultRecv)
{
- std::fprintf(stderr, "Usage: %s examples/platforms/cluster.xml <send_spec> <recv_spec>\n"
+ std::fprintf(stderr, "Usage: %s examples/platforms/cluster
_backbone
.xml <send_spec> <recv_spec>\n"
"where spec is a list of letters giving the kind of tests you want to see.\n"
"Existing sender spec:\n"
" r regular send\n"
"where spec is a list of letters giving the kind of tests you want to see.\n"
"Existing sender spec:\n"
" r regular send\n"
@@
-39,7
+37,7
@@
static void usage(const char* binaryName, const char* defaultSend, const char* d
" j irecv on permanent mailbox (after a little delay)\n"
" J irecv on permanent mailbox (after a little delay)\n"
"\n"
" j irecv on permanent mailbox (after a little delay)\n"
" J irecv on permanent mailbox (after a little delay)\n"
"\n"
- "Example 1: %s examples/platforms/cluster.xml rRiIdD rrrrrr # testing all send functions\n"
+ "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);
"Default specs: %s %s (all possible pairs)\n",
binaryName, binaryName, defaultSend, defaultRecv);
exit(1);
@@
-49,9
+47,9
@@
static void sender(std::vector<std::string> args)
{
XBT_INFO("Sender spec: %s", args[0].c_str());
for (unsigned int test = 1; test <= args[0].size(); test++) {
{
XBT_INFO("Sender spec: %s", args[0].c_str());
for (unsigned int test = 1; test <= args[0].size(); test++) {
- this_actor::sleep_until(test * 5 - 5);
+
simgrid::s4u::
this_actor::sleep_until(test * 5 - 5);
std::string* mboxName = new std::string("Test #" + std::to_string(test));
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::MailboxPtr mbox = simgrid::s4u::Mailbox::by
_name(*mboxName
);
switch (args[0][test - 1]) {
case 'r':
switch (args[0][test - 1]) {
case 'r':
@@
-96,9
+94,9
@@
static void receiver(std::vector<std::string> args)
{
XBT_INFO("Receiver spec: %s", args[0].c_str());
for (unsigned int test = 1; test <= args[0].size(); test++) {
{
XBT_INFO("Receiver spec: %s", args[0].c_str());
for (unsigned int test = 1; test <= args[0].size(); test++) {
- this_actor::sleep_until(test * 5 - 5);
+
simgrid::s4u::
this_actor::sleep_until(test * 5 - 5);
std::string mboxName = "Test #" + std::to_string(test);
std::string mboxName = "Test #" + std::to_string(test);
- simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by
Name(mboxName.c_str()
);
+ simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by
_name(mboxName
);
void* received = nullptr;
switch (args[0][test - 1]) {
void* received = nullptr;
switch (args[0][test - 1]) {
@@
-123,24
+121,24
@@
static void receiver(std::vector<std::string> args)
break;
case 'p':
XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
break;
case 'p':
XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
- mbox->set
Receiver(
Actor::self());
+ mbox->set
_receiver(simgrid::s4u::
Actor::self());
received = mbox->get();
break;
case 'P':
XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
received = mbox->get();
break;
case 'P':
XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- mbox->set
Receiver(
Actor::self());
+ mbox->set
_receiver(simgrid::s4u::
Actor::self());
received = mbox->get();
break;
case 'j':
XBT_INFO("Test %u: j (irecv on permanent mailbox)", test);
received = mbox->get();
break;
case 'j':
XBT_INFO("Test %u: j (irecv on permanent mailbox)", test);
- mbox->set
Receiver(
Actor::self());
+ mbox->set
_receiver(simgrid::s4u::
Actor::self());
mbox->get_async(&received)->wait();
break;
case 'J':
XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->get_async(&received)->wait();
break;
case 'J':
XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- mbox->set
Receiver(
Actor::self());
+ mbox->set
_receiver(simgrid::s4u::
Actor::self());
mbox->get_async(&received)->wait();
break;
default:
mbox->get_async(&received)->wait();
break;
default: