From 886652f8385f90b538fe670516ef43fb95ccba9d Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Wed, 27 Nov 2019 13:36:51 +0100 Subject: [PATCH] fix asserts --- src/surf/xml/surfxml_parseplatf.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 8446b10643..4e2dae3aa6 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -103,7 +103,7 @@ void parse_platform_file(const std::string& file) auto profile = traces_set_list.at(elm.first); auto host = simgrid::s4u::Host::by_name_or_null(elm.second); - surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Host ")+elm.second+" undefined."); + surf_parse_assert(host, std::string(": Host ") + elm.second + " undefined."); host->set_state_profile(profile); } @@ -112,7 +112,7 @@ void parse_platform_file(const std::string& file) auto profile = traces_set_list.at(elm.first); auto host = simgrid::s4u::Host::by_name_or_null(elm.second); - surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Host ")+elm.second+" undefined."); + surf_parse_assert(host, std::string(": Host ") + elm.second + " undefined."); host->set_speed_profile(profile); } @@ -121,7 +121,7 @@ void parse_platform_file(const std::string& file) auto profile = traces_set_list.at(elm.first); auto link = simgrid::s4u::Link::by_name(elm.second); - surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Link ")+elm.second+" undefined."); + surf_parse_assert(link, std::string(": Link ") + elm.second + " undefined."); link->set_state_profile(profile); } @@ -130,7 +130,7 @@ void parse_platform_file(const std::string& file) auto profile = traces_set_list.at(elm.first); auto link = simgrid::s4u::Link::by_name(elm.second); - surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Link ")+elm.second+" undefined."); + surf_parse_assert(link, std::string(": Link ") + elm.second + " undefined."); link->set_bandwidth_profile(profile); } @@ -139,7 +139,7 @@ void parse_platform_file(const std::string& file) auto profile = traces_set_list.at(elm.first); auto link = simgrid::s4u::Link::by_name(elm.second); - surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Link ")+elm.second+" undefined."); + surf_parse_assert(link, std::string(": Link ") + elm.second + " undefined."); link->set_latency_profile(profile); } -- 2.20.1