Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Explicit cast when loosing precision (teshsuite/).
[simgrid.git] / teshsuite / surf / lmm_usage / lmm_usage.cpp
index 72f2c89..9ecc8e5 100644 (file)
@@ -1,11 +1,11 @@
 /* A few tests for the maxmin library                                       */
 
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-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. */
 
-#include "simgrid/msg.h"
+#include "simgrid/s4u/Engine.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "xbt/log.h"
@@ -18,8 +18,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
 namespace lmm = simgrid::kernel::lmm;
 
-#define PRINT_VAR(var) XBT_DEBUG(#var " = %g", (var)->get_value())
-#define SHOW_EXPR(expr) XBT_DEBUG(#expr " = %g",expr)
+#define PRINT_VAR(var) XBT_DEBUG(_XBT_STRINGIFY(var) " = %g", (var)->get_value())
+#define SHOW_EXPR(expr) XBT_DEBUG(_XBT_STRINGIFY(expr) " = %g", (expr))
 
 /*        ______                 */
 /*  ==l1==  L2  ==L3==           */
@@ -147,7 +147,7 @@ static void test3()
   /* Link constraints and variables */
   for (int i = 0; i < 15; i++)
     for (int j = 0; j < 16; j++)
-      if (A[i][j])
+      if (A[i][j] != 0.0)
         Sys->expand(tmp_cnst[i], tmp_var[j], 1.0);
 
   Sys->solve();
@@ -167,7 +167,7 @@ static void test3()
 
 int main(int argc, char** argv)
 {
-  MSG_init(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   XBT_INFO("***** Test 1");
   test1();