new test to check transport start and shutdown
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 24 Aug 2011 13:42:47 +0000 (13:42 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 24 Aug 2011 13:42:47 +0000 (13:42 +0000)
src/transport/Makefile.am
src/transport/test_transport_api.c
src/transport/transport-testing.c
src/transport/transport-testing.h

index 5ea2803194f21dc51b20e9d12e004d10bd8617aa..310b65b2fc63adff451de4c9795f3d09be19d363 100644 (file)
@@ -356,6 +356,15 @@ test_transport_api_disconnect_LDADD = \
  $(top_builddir)/src/testing/libgnunettesting.la \
  $(top_builddir)/src/util/libgnunetutil.la 
 
+test_transport_startonly_SOURCES = \
+ test_transport_startonly.c
+test_transport_startonly_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/testing/libgnunettesting.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
 
 test_transport_ats_SOURCES = \
  test_transport_ats.c $(TRANSPORT_ATS_SRC)
index 004c8e67665f1e0f7fe2f5d2f8c734ccdb12fb7f..3037091365e14b6a2ae423cc0b8decec5070c828 100644 (file)
@@ -104,7 +104,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   die_task = GNUNET_SCHEDULER_NO_TASK;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Stopping peers\n");
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
 
   if (send_task != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (send_task);
@@ -122,7 +122,6 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     GNUNET_TRANSPORT_TESTING_stop_peer (p2);
 
   ok = GNUNET_SYSERR;
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Stopping peers END\n");
 }
 
 
index 18a002d027ac8041fce05496cacd2bae0434eaa0..61c392d77c851cb1bbcd9173d1a172b3c9cfd2d2 100644 (file)
@@ -266,8 +266,8 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *p)
 
   if (p->cfg != NULL)
     GNUNET_CONFIGURATION_destroy (p->cfg);
-
   GNUNET_free (p);
+  p = NULL;
 }
 
 /**
@@ -317,13 +317,9 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1,
 }
 
 /**
- * Cancels a peer connect request
- * before.
- * @param p1 peer 1
- * @param p2 peer 2
- * @param cb the callback to call
- * @param cb_cls callback cls
- * @return connect context
+ * Cancel the request to connect two peers
+ * Tou MUST cancel the request if you stop the peers before the peers connected succesfully
+ * @param cc a connect request handle
  */
 void
 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (GNUNET_TRANSPORT_TESTING_ConnectRequest ccr)
index 672a435aaf882118641a4e312f9265a7da4fe834..3e5486eb72729a359a2a38d4cddc319a3248c390 100644 (file)
@@ -102,6 +102,7 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc);
  * @param p2 peer 2
  * @param cb the callback to call
  * @param cb_cls callback cls
+ * @return a connect request handle
  */
 GNUNET_TRANSPORT_TESTING_ConnectRequest
 GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1,
@@ -109,6 +110,11 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1,
                                         GNUNET_TRANSPORT_TESTING_connect_cb cb,
                                         void *cls);
 
+/**
+ * Cancel the request to connect two peers
+ * Tou MUST cancel the request if you stop the peers before the peers connected succesfully
+ * @param cc a connect request handle
+ */
 void
 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (void *cc);