gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16124 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r16124 - gnunet/src/testing
Date: Tue, 19 Jul 2011 15:01:38 +0200

Author: nevans
Date: 2011-07-19 15:01:38 +0200 (Tue, 19 Jul 2011)
New Revision: 16124

Modified:
   gnunet/src/testing/testing_peergroup.c
Log:
changes

Modified: gnunet/src/testing/testing_peergroup.c
===================================================================
--- gnunet/src/testing/testing_peergroup.c      2011-07-19 13:00:29 UTC (rev 
16123)
+++ gnunet/src/testing/testing_peergroup.c      2011-07-19 13:01:38 UTC (rev 
16124)
@@ -377,7 +377,7 @@
       if (pg_start_ctx->topology_output_file != NULL)
         {
           second_str = GNUNET_strdup(GNUNET_i2s(second));
-          temp = GNUNET_asprintf(&temp_str, "\t\"%s\" -> \"%s\"\n", 
GNUNET_i2s(first), second_str);
+          temp = GNUNET_asprintf(&temp_str, "\t\"%s\" -- \"%s\"\n", 
GNUNET_i2s(first), second_str);
           GNUNET_free(second_str);
           if (temp > 0)
             GNUNET_DISK_file_write(pg_start_ctx->topology_output_file, 
temp_str, temp);
@@ -607,16 +607,16 @@
 
   topo_ctx = (struct TopologyOutputContext *)cls;
   GNUNET_assert(topo_ctx->file != NULL);
-  if (emsg == NULL)
+  if ((emsg == NULL) && (first != NULL) && (second != NULL))
     {
       GNUNET_assert(first != NULL);
       GNUNET_assert(second != NULL);
       temp_pid2 = GNUNET_strdup(GNUNET_i2s(second));
-      temp = GNUNET_asprintf(&temp_str, "\t%s -> %s\n", GNUNET_i2s(first), 
temp_pid2);
+      temp = GNUNET_asprintf(&temp_str, "\t\"%s\" -- \"%s\"\n", 
GNUNET_i2s(first), temp_pid2);
       GNUNET_free(temp_pid2);
       GNUNET_DISK_file_write(topo_ctx->file, temp_str, temp);
     }
-  else
+  else if ((emsg == NULL) && (first == NULL) && (second == NULL))
     {
       temp = GNUNET_asprintf(&temp_str, "}\n");
       GNUNET_DISK_file_write(topo_ctx->file, temp_str, temp);
@@ -624,6 +624,14 @@
       topo_ctx->notify_cb(topo_ctx->notify_cb_cls, NULL);
       GNUNET_free(topo_ctx);
     }
+  else
+    {
+      temp = GNUNET_asprintf(&temp_str, "}\n");
+      GNUNET_DISK_file_write(topo_ctx->file, temp_str, temp);
+      GNUNET_DISK_file_close(topo_ctx->file);
+      topo_ctx->notify_cb(topo_ctx->notify_cb_cls, emsg);
+      GNUNET_free(topo_ctx);
+    }
 }
 
 /**
@@ -657,7 +665,7 @@
       return;
     }
 
-  temp = GNUNET_asprintf(&temp_str, "digraph G {\n");
+  temp = GNUNET_asprintf(&temp_str, "strict graph G {\n");
   if (temp > 0)
     GNUNET_DISK_file_write(topo_ctx->file, temp_str, temp);
   GNUNET_free_non_null(temp_str);
@@ -776,7 +784,7 @@
       if (pg_start_ctx->topology_output_file != NULL)
         {
           GNUNET_free(temp_str);
-          temp = GNUNET_asprintf(&temp_str, "digraph G {\n");
+          temp = GNUNET_asprintf(&temp_str, "strict graph G {\n");
           if (temp > 0)
             GNUNET_DISK_file_write(pg_start_ctx->topology_output_file, 
temp_str, temp);
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]