Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix some memory leack.
[simgrid.git] / teshsuite / simdag / platforms / is_router_test.c
1 /* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "simdag/simdag.h"
10 #include "surf/surf_private.h"
11
12 extern routing_global_t global_routing;
13
14 int main(int argc, char **argv)
15 {
16   /* initialisation of SD */
17   int size;
18   SD_init(&argc, argv);
19   xbt_dict_cursor_t cursor = NULL;
20   char *key, *data;
21
22   /* creation of the environment */
23   SD_create_environment(argv[1]);
24
25   size = xbt_dict_size(global_routing->where_network_elements);
26
27   printf("Workstation number: %d, link number: %d, elmts number: %d\n",
28          SD_workstation_get_number(), SD_link_get_number(), size);
29
30   xbt_dict_foreach(global_routing->where_network_elements, cursor, key, data) {
31     printf("   - Seen: \"%s\" is type : %d\n", key,
32            (int) global_routing->get_network_element_type(key));
33   }
34   SD_exit();
35   return 0;
36 }