X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/153b16c65aabb7e3e103a83e072460cdba64fad1..d329aa1e53719e607fe180edfc7d6ecf49593fad:/teshsuite/simdag/platforms/is_router_test.c diff --git a/teshsuite/simdag/platforms/is_router_test.c b/teshsuite/simdag/platforms/is_router_test.c index 0c8fadaeee..18751cbe09 100644 --- a/teshsuite/simdag/platforms/is_router_test.c +++ b/teshsuite/simdag/platforms/is_router_test.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2008-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,33 +6,36 @@ #include #include -#include "simdag/simdag.h" -#include "surf/surf_private.h" - -extern routing_global_t global_routing; +#include "simgrid/simdag.h" +#include "surf/surf.h" int main(int argc, char **argv) { - /* initialisation of SD */ + /* SD initialization */ int size; - xbt_dict_t eltms = xbt_dict_new(); - SD_init(&argc, argv); - xbt_dict_cursor_t cursor = NULL; + xbt_lib_cursor_t cursor = NULL; char *key, *data; + SD_init(&argc, argv); + /* creation of the environment */ SD_create_environment(argv[1]); - eltms = global_routing->where_network_elements; - size = xbt_dict_size(eltms); + size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib); - printf("Workstation number: %d, link number: %d, elmts number: %d\n", - SD_workstation_get_number(), SD_link_get_number(), size); + printf("Workstation number: %zu, link number: %d, elmts number: %d\n", + sg_host_count(), sg_link_count(), size); - xbt_dict_foreach(eltms, cursor, key, data) { + xbt_dict_foreach(host_list, cursor, key, data) { printf(" - Seen: \"%s\" is type : %d\n", key, - (int) global_routing->get_network_element_type(key)); + (int) routing_get_network_element_type(key)); } + + xbt_lib_foreach(as_router_lib, cursor, key, data) { + printf(" - Seen: \"%s\" is type : %d\n", key, + (int) routing_get_network_element_type(key)); + } + SD_exit(); return 0; }