summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-08-24 13:42:47 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-08-24 13:42:47 +0000
commitdf0c0a796560d71065988a961f0046f8a0377456 (patch)
treedf358fa627f34c0a598612cf681a7cc0a6f37a9f /src
parent0631fa0b614e463c585162b065f56f31eeb13dfa (diff)
new test to check transport start and shutdown
Diffstat (limited to 'src')
-rw-r--r--src/transport/Makefile.am9
-rw-r--r--src/transport/test_transport_api.c3
-rw-r--r--src/transport/transport-testing.c12
-rw-r--r--src/transport/transport-testing.h6
4 files changed, 20 insertions, 10 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 5ea280319..310b65b2f 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -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)
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 004c8e676..303709136 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -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");
}
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 18a002d02..61c392d77 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -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)
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h
index 672a435aa..3e5486eb7 100644
--- a/src/transport/transport-testing.h
+++ b/src/transport/transport-testing.h
@@ -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);