Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / examples / cpp / platform-properties / s4u-platform-properties.cpp
index 1eb7ff4..777f61a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-2022. 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. */
@@ -35,7 +35,8 @@ static void test_host(const std::string& hostname)
   XBT_INFO("== Try to get a host property that does exist");
   value = thehost->get_property(exist);
   xbt_assert(value, "\tProperty %s is undefined (where it should)", exist);
-  xbt_assert(!strcmp(value, "180"), "\tValue of property %s is defined to %s (where it should be 180)", exist, value);
+  xbt_assert(strcmp(value, "180") == 0, "\tValue of property %s is defined to %s (where it should be 180)", exist,
+             value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   XBT_INFO("== Trying to modify a host property");
@@ -44,13 +45,13 @@ static void test_host(const std::string& hostname)
   /* Test if we have changed the value */
   value = thehost->get_property(exist);
   xbt_assert(value, "Property %s is undefined (where it should)", exist);
-  xbt_assert(!strcmp(value, "250"), "Value of property %s is defined to %s (where it should be 250)", exist, value);
+  xbt_assert(strcmp(value, "250") == 0, "Value of property %s is defined to %s (where it should be 250)", exist, value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   /* Restore the value for the next test */
   thehost->set_property(exist, "180");
 
-  auto thezone = thehost->get_englobing_zone();
+  const auto* thezone = thehost->get_englobing_zone();
   XBT_INFO("== Print the properties of the zone '%s' that contains '%s'", thezone->get_cname(), hostname.c_str());
   const std::unordered_map<std::string, std::string>* zoneprops = thezone->get_properties();
   keys.clear();