]> AND Public Git Repository - simgrid.git/blobdiff - teshsuite/s4u/listen_async/listen_async.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar smells.
[simgrid.git] / teshsuite / s4u / listen_async / listen_async.cpp
index 1e64d69f18de4057fe27d3f909fa2b531146ce04..e277a3df8d111771f13ec80ddc09be2c4e0c4efe 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-2020. 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. */
@@ -21,7 +21,10 @@ static void server()
 
   xbt_assert(mailbox->listen()); // True (1)
   XBT_INFO("Task listen works on regular mailboxes");
-  std::string* res = static_cast<std::string*>(mailbox->get());
+  XBT_INFO("Mailbox::listen_from() returns %ld (should return my pid, which is %ld)", mailbox->listen_from(),
+           simgrid::s4u::this_actor::get_pid());
+
+  const std::string* res = static_cast<std::string*>(mailbox->get());
 
   xbt_assert(*res == "Some data", "Data received: %s", res->c_str());
   XBT_INFO("Data successfully received from regular mailbox");