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

Public GIT Repository
Merge pull request #374 from adegomme/master
[simgrid.git] / teshsuite / s4u / ns3-simultaneous-send-rcv / ns3-simultaneous-send-rcv.cpp
index fac647598b101d6dc66bd8ae4e0b0bb97655a3ce..e98286011160c4507a7a9ca96048937f58ff3aaf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2019-2021. 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. */
@@ -33,10 +33,9 @@ static void test_send(){
 static void test_receive(){
   for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) {
     XBT_VERB("waiting for messages");
-    int* ptr = (int*)(box->get());
+    auto ptr = box->get_unique<int>();
     int id   = *ptr;
     XBT_VERB("received messages #%i", id);
-    delete ptr;
   }
   XBT_INFO("Done receiving from %d senders, each of them sending %d messages", nb_sender, nb_message_to_send);
 }