Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[routing] kill supurious checks, and reformulate error messages
[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_lib_cursor_t cursor = NULL;
20   char *key, *data;
21
22   /* creation of the environment */
23   SD_create_environment(argv[1]);
24
25   size = xbt_lib_length(host_lib) + xbt_lib_length(as_router_lib);
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_lib_foreach(host_lib, cursor, key, data) {
31     printf("   - Seen: \"%s\" is type : %d\n", key,
32            (int) routing_get_network_element_type(key));
33   }
34
35   xbt_lib_foreach(as_router_lib, cursor, key, data) {
36     printf("   - Seen: \"%s\" is type : %d\n", key,
37            (int) routing_get_network_element_type(key));
38   }
39
40   SD_exit();
41   return 0;
42 }