Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
finish the cleanup of the netcard list container
[simgrid.git] / teshsuite / simdag / is-router / is-router.cpp
index 40ed77b..4e873ef 100644 (file)
@@ -20,6 +20,10 @@ int main(int argc, char **argv)
 
   std::vector<simgrid::kernel::routing::NetCard*> netcardList;
   simgrid::s4u::Engine::instance()->netcardList(&netcardList);
+  std::sort(netcardList.begin(), netcardList.end(),
+      [](simgrid::kernel::routing::NetCard* a, simgrid::kernel::routing::NetCard* b) {
+      return a->name() < b->name();
+  });
 
   int it;
   sg_host_t host;
@@ -30,7 +34,7 @@ int main(int argc, char **argv)
   }
   xbt_dynar_free(&hosts);
 
-  std::printf("NetCards count: %d\n", xbt_dict_length(netcards_dict));
+  std::printf("NetCards count: %zu\n", netcardList.size());
   for (auto nc : netcardList)
     std::printf("   - Seen: \"%s\". Type: %s\n", nc->cname(),
                 nc->isRouter() ? "router" : (nc->isNetZone() ? "netzone" : (nc->isHost() ? "host" : "buggy")));