gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r14617 - gnunet/src/testing
Date: Wed, 9 Mar 2011 11:50:05 +0100

Author: nevans
Date: 2011-03-09 11:50:05 +0100 (Wed, 09 Mar 2011)
New Revision: 14617

Modified:
   gnunet/src/testing/test_testing.c
   gnunet/src/testing/testing_group.c
Log:
cleanup testing_group.c, fix bad shutdown in test_testing testcase

Modified: gnunet/src/testing/test_testing.c
===================================================================
--- gnunet/src/testing/test_testing.c   2011-03-09 09:08:35 UTC (rev 14616)
+++ gnunet/src/testing/test_testing.c   2011-03-09 10:50:05 UTC (rev 14617)
@@ -48,6 +48,17 @@
     }
 }
 
+
+
+void do_shutdown (void *cls,
+                  const struct GNUNET_SCHEDULER_TaskContext * tc)
+{
+  struct GNUNET_TESTING_Daemon *d = cls;
+  GNUNET_TESTING_daemon_stop (d, TIMEOUT, &end_cb, NULL, GNUNET_YES,
+                              GNUNET_NO);
+}
+
+
 static void
 my_cb (void *cls,
        const struct GNUNET_PeerIdentity *id,
@@ -59,8 +70,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Daemon `%s' started, will now stop it.\n", GNUNET_i2s (id));
 #endif
-  GNUNET_TESTING_daemon_stop (d, TIMEOUT, &end_cb, NULL, GNUNET_YES,
-                              GNUNET_NO);
+  GNUNET_SCHEDULER_add_now(&do_shutdown, d);
 }
 
 

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2011-03-09 09:08:35 UTC (rev 14616)
+++ gnunet/src/testing/testing_group.c  2011-03-09 10:50:05 UTC (rev 14617)
@@ -42,7 +42,6 @@
 
 #define TOPOLOGY_HACK GNUNET_YES
 
-#define AVOID_CONN_MALLOC GNUNET_NO
 
 /**
  * Lowest port used for GNUnet testing.  Should be high enough to not
@@ -784,12 +783,6 @@
    * Connection context for peer group.
    */
   struct ConnectTopologyContext ct_ctx;
-
-#if AVOID_CONN_MALLOC
-  struct PeerConnection working_peer_connections[200000];
-
-  unsigned int current_peer_connection;
-#endif
 };
 
 struct UpdateContext
@@ -1649,12 +1642,7 @@
   added = 0;
   if (add_first)
     {
-#if AVOID_CONN_MALLOC
-      new_first = &pg->working_peer_connections[pg->current_peer_connection];
-      pg->current_peer_connection++;
-#else
       new_first = GNUNET_malloc (sizeof (struct PeerConnection));
-#endif
       new_first->index = second;
       GNUNET_CONTAINER_DLL_insert(*first_list, *first_tail, new_first);
       pg->peers[first].num_connections++;
@@ -1663,12 +1651,7 @@
 
   if (add_second)
     {
-#if AVOID_CONN_MALLOC
-      new_second = &pg->working_peer_connections[pg->current_peer_connection];
-      pg->current_peer_connection++;
-#else
       new_second = GNUNET_malloc (sizeof (struct PeerConnection));
-#endif
       new_second->index = first;
       GNUNET_CONTAINER_DLL_insert(*second_list, *second_tail, new_second);
       pg->peers[second].num_connections++;




reply via email to

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