aboutsummaryrefslogtreecommitdiff
path: root/src/rps/test_rps.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-10-11 14:48:02 +0200
committerJulius Bünger <buenger@mytum.de>2018-10-11 14:48:02 +0200
commit2408ee6b254b5f67a6b50280dec6c66536abd1c1 (patch)
tree9af518049544dd4825f3490b0c29fff8e45248dc /src/rps/test_rps.c
parent261dd70aa12d986e6f7b38c38f843621bcc47763 (diff)
downloadgnunet-2408ee6b254b5f67a6b50280dec6c66536abd1c1.tar.gz
gnunet-2408ee6b254b5f67a6b50280dec6c66536abd1c1.zip
RPS Tests: Test Subs
Diffstat (limited to 'src/rps/test_rps.c')
-rw-r--r--src/rps/test_rps.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index ba0371f38..cbd3ba845 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -1544,6 +1544,31 @@ churn_test_cb (struct RPSPeer *rps_peer)
1544} 1544}
1545 1545
1546/*********************************** 1546/***********************************
1547 * SUB
1548***********************************/
1549
1550void sub_post (struct RPSPeer *rps_peer)
1551{
1552 GNUNET_RPS_sub_stop (rps_peer->rps_handle, "test");
1553}
1554
1555static void
1556sub_stop_op (void *cls)
1557{
1558 struct GNUNET_RPS_Handle *h = cls;
1559
1560 GNUNET_RPS_sub_stop (h, "test");
1561}
1562
1563static void
1564sub_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
1565{
1566 (void) rps_peer;
1567
1568 GNUNET_RPS_sub_start (h, "test");
1569}
1570
1571/***********************************
1547 * PROFILER 1572 * PROFILER
1548***********************************/ 1573***********************************/
1549 1574
@@ -2873,7 +2898,22 @@ main (int argc, char *argv[])
2873 cur_test_run.eval_cb = default_eval_cb; 2898 cur_test_run.eval_cb = default_eval_cb;
2874 cur_test_run.have_churn = HAVE_NO_CHURN; 2899 cur_test_run.have_churn = HAVE_NO_CHURN;
2875 cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT; 2900 cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT;
2876 timeout_s = 10; 2901 timeout_s = 40;
2902 }
2903
2904 else if (strstr (argv[0], "_sub") != NULL)
2905 {
2906 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test subs\n");
2907 cur_test_run.name = "test-rps-sub";
2908 num_peers = 5;
2909 //cur_test_run.init_peer = &default_init_peer;
2910 cur_test_run.pre_test = &sub_pre;
2911 cur_test_run.main_test = &single_req_cb;
2912 //cur_test_run.reply_handle = default_reply_handle;
2913 cur_test_run.post_test = &sub_post;
2914 //cur_test_run.eval_cb = default_eval_cb;
2915 cur_test_run.have_churn = HAVE_NO_CHURN;
2916 cur_test_run.have_quick_quit = HAVE_QUICK_QUIT;
2877 } 2917 }
2878 2918
2879 else if (strstr (argv[0], "profiler") != NULL) 2919 else if (strstr (argv[0], "profiler") != NULL)