Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Explicit cast when loosing precision (teshsuite/).
[simgrid.git] / teshsuite / xbt / parmap_test / parmap_test.cpp
index fa3e9a7..3da1c4a 100644 (file)
@@ -6,7 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/internal_config.h" // HAVE_FUTEX_H
-#include <simgrid/msg.h>
+#include <simgrid/s4u/Engine.hpp>
 #include <xbt.h>
 #include <xbt/parmap.hpp>
 
@@ -75,7 +75,7 @@ static int test_parmap_extended(e_xbt_parmap_mode_t mode)
     parmap.apply(fun_get_id, data);
 
     std::sort(begin(a), end(a));
-    unsigned count = std::distance(begin(a), std::unique(begin(a), end(a)));
+    unsigned count = static_cast<unsigned>(std::distance(begin(a), std::unique(begin(a), end(a))));
     if (count != num_workers) {
       XBT_CRITICAL("only %u/%u threads did some work", count, num_workers);
       ret = 1;
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
 {
   int status = 0;
   xbt_log_control_set("parmap_test.fmt:[%c/%p]%e%m%n");
-  MSG_init(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   SIMIX_context_set_nthreads(16); // dummy value > 1
 
   XBT_INFO("Basic testing posix");