From: thiery Date: Fri, 12 Nov 2010 19:07:29 +0000 (+0000) Subject: Fix detection of asymetric routes errors in platform files. X-Git-Tag: v3_5~284 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8a63264af07173eaba26c404f4e647cc9a9c584e?ds=sidebyside Fix detection of asymetric routes errors in platform files. The error is now detected, which breaks the tests relying on examples/msg/msg_platform.xml since this platform contains asymetric routes. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8543 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index b89839538d..69949a6352 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -2509,7 +2509,7 @@ static void generic_set_route(routing_component_t rc, const char *src, route_t route_to_test = xbt_dict_get_or_null(_parse_routes, route_name); if(route_to_test) - xbt_assert2(xbt_dynar_compare( + xbt_assert2(!xbt_dynar_compare( (void*)route->link_list, (void*)route_to_test->link_list, (int_f_cpvoid_cpvoid_t) strcmp), @@ -2532,7 +2532,7 @@ static void generic_set_route(routing_component_t rc, const char *src, DEBUG2("Load Route from \"%s\" to \"%s\"", dst, src); route_to_test = xbt_dict_get_or_null(_parse_routes, bprintf("%d#%d",*dst_id, *src_id)); if(route_to_test) - xbt_assert2(xbt_dynar_compare( + xbt_assert2(!xbt_dynar_compare( (void*)route_sym->link_list, (void*)route_to_test->link_list, (int_f_cpvoid_cpvoid_t) strcmp), @@ -2568,7 +2568,7 @@ static void generic_set_ASroute(routing_component_t rc, const char *src, route_t route_to_test = xbt_dict_get_or_null(_parse_routes, route_name); if(route_to_test) - xbt_assert4(xbt_dynar_compare( + xbt_assert4(!xbt_dynar_compare( (void*) (&e_route->generic_route)->link_list, (void*) route_to_test->link_list, (int_f_cpvoid_cpvoid_t) strcmp), @@ -2598,7 +2598,7 @@ static void generic_set_ASroute(routing_component_t rc, const char *src, route_to_test = xbt_dict_get_or_null(_parse_routes, bprintf("%d#%d", *dst_id, *src_id)); if(route_to_test) - xbt_assert4(xbt_dynar_compare( + xbt_assert4(!xbt_dynar_compare( (void*) (&route_sym->generic_route)->link_list, (void*) route_to_test->link_list, (int_f_cpvoid_cpvoid_t) strcmp), diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 1d58b67a86..f2422268d5 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -743,7 +743,7 @@ XBT_INLINE int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2, { void *data1 = xbt_dynar_get_as(d1, i, void *); void *data2 = xbt_dynar_get_as(d2, i, void *); - if(!compar(data1,data2)) return 1; + if(compar(data1,data2)) return 1; } return 0; }