Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tests of xbt_graph_export_graphviz
authordimitrov <dimitrov@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 29 Mar 2006 13:16:35 +0000 (13:16 +0000)
committerdimitrov <dimitrov@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 29 Mar 2006 13:16:35 +0000 (13:16 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2009 48e7efb5-ca39-0410-a469-dd3cf9ba447f

testsuite/xbt/graphxml_usage.c

index 833ae0e..e392d23 100644 (file)
@@ -20,6 +20,11 @@ void* node_label_and_data(xbt_node_t node,const char*label ,const char* data)
   char* lbl=xbt_strdup(label);
   return lbl;
 }
   char* lbl=xbt_strdup(label);
   return lbl;
 }
+
+static const char *node_name(xbt_node_t n) {
+  return n->data;
+}
+
 void test(char *graph_file);
 void test(char *graph_file)
 {
 void test(char *graph_file);
 void test(char *graph_file)
 {
@@ -35,6 +40,7 @@ void test(char *graph_file)
 
   double *adj=xbt_graph_get_length_matrix(graph);
  
 
   double *adj=xbt_graph_get_length_matrix(graph);
  
+  xbt_graph_export_graphviz(graph, "graph.dot", node_name, NULL);
  
  for(i=0;i<n;i++)
     {
  
  for(i=0;i<n;i++)
     {