From: Navarrop Date: Wed, 27 Apr 2011 15:47:19 +0000 (+0200) Subject: Quick verif to know if elements src and dst are found when set route. X-Git-Tag: v3_6_rc3~81^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c5898c7bb61800b2ffac463d79738309dcc6170b Quick verif to know if elements src and dst are found when set route. --- diff --git a/src/surf/surf_routing_dijkstra.c b/src/surf/surf_routing_dijkstra.c index ab9e58ff2c..60e055bed0 100644 --- a/src/surf/surf_routing_dijkstra.c +++ b/src/surf/surf_routing_dijkstra.c @@ -500,6 +500,9 @@ void model_dijkstra_both_set_route (routing_component_t rc, const char *src, src_id = xbt_dict_get_or_null(rc->to_index, src); dst_id = xbt_dict_get_or_null(rc->to_index, dst); + xbt_assert(src_id, "Network elements %s not found", src); + xbt_assert(dst_id, "Network elements %s not found", dst); + /* Create the topology graph */ if(!routing->route_graph) routing->route_graph = xbt_graph_new_graph(1, NULL); diff --git a/src/surf/surf_routing_floyd.c b/src/surf/surf_routing_floyd.c index 80856c51ed..bda5d5f2f6 100644 --- a/src/surf/surf_routing_floyd.c +++ b/src/surf/surf_routing_floyd.c @@ -286,6 +286,9 @@ void model_floyd_set_route(routing_component_t rc, const char *src, src_id = xbt_dict_get_or_null(rc->to_index, src); dst_id = xbt_dict_get_or_null(rc->to_index, dst); + xbt_assert(src_id, "Network elements %s not found", src); + xbt_assert(dst_id, "Network elements %s not found", dst); + if(!routing->link_table) { /* Create Cost, Predecessor and Link tables */ diff --git a/src/surf/surf_routing_full.c b/src/surf/surf_routing_full.c index 926b6ad815..be6166c689 100644 --- a/src/surf/surf_routing_full.c +++ b/src/surf/surf_routing_full.c @@ -199,8 +199,8 @@ void model_full_set_route(routing_component_t rc, const char *src, routing_component_full_t routing = ((routing_component_full_t) rc); size_t table_size = xbt_dict_length(routing->generic_routing.to_index); - xbt_assert(src_id - && dst_id, "Network elements %s or %s not found", src, dst); + xbt_assert(src_id, "Network elements %s not found", src); + xbt_assert(dst_id, "Network elements %s not found", dst); xbt_assert(xbt_dynar_length(route->generic_route.link_list) > 0, "Invalid count of links, must be greater than zero (%s,%s)",