diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-09-19 09:52:36 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-09-19 09:52:36 +0000 |
commit | f375989f4a693dcc433a05f553c2efb4dad2a04e (patch) | |
tree | 192ba7d8a94f4ae4934f54dffa8be99a1294fe6e | |
parent | d5c14fc6a5a8bdfe7af7dfe457f57c1e6f182607 (diff) | |
download | gnunet-f375989f4a693dcc433a05f553c2efb4dad2a04e.tar.gz gnunet-f375989f4a693dcc433a05f553c2efb4dad2a04e.zip |
- add min and nobuf options to tests
-rw-r--r-- | src/mesh/Makefile.am | 20 | ||||
-rw-r--r-- | src/mesh/test_mesh_small.c | 19 |
2 files changed, 38 insertions, 1 deletions
diff --git a/src/mesh/Makefile.am b/src/mesh/Makefile.am index 2c9fd8db4..c6a90ca6d 100644 --- a/src/mesh/Makefile.am +++ b/src/mesh/Makefile.am | |||
@@ -99,6 +99,8 @@ check_PROGRAMS = \ | |||
99 | test_mesh_small_unicast \ | 99 | test_mesh_small_unicast \ |
100 | test_mesh_small_multicast \ | 100 | test_mesh_small_multicast \ |
101 | test_mesh_small_speed \ | 101 | test_mesh_small_speed \ |
102 | test_mesh_small_speed_nobuf \ | ||
103 | test_mesh_small_speed_min \ | ||
102 | test_mesh_small_speed_ack | 104 | test_mesh_small_speed_ack |
103 | 105 | ||
104 | test_mesh_api_SOURCES = \ | 106 | test_mesh_api_SOURCES = \ |
@@ -209,6 +211,24 @@ test_mesh_small_speed_LDADD = \ | |||
209 | test_mesh_small_speed_DEPENDENCIES = \ | 211 | test_mesh_small_speed_DEPENDENCIES = \ |
210 | libgnunetmesh.la | 212 | libgnunetmesh.la |
211 | 213 | ||
214 | test_mesh_small_speed_min_SOURCES = \ | ||
215 | test_mesh_small.c | ||
216 | test_mesh_small_speed_min_LDADD = \ | ||
217 | $(top_builddir)/src/mesh/libgnunetmesh.la \ | ||
218 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
219 | $(top_builddir)/src/testing_old/libgnunettesting_old.la | ||
220 | test_mesh_small_speed_min_DEPENDENCIES = \ | ||
221 | libgnunetmesh.la | ||
222 | |||
223 | test_mesh_small_speed_nobuf_SOURCES = \ | ||
224 | test_mesh_small.c | ||
225 | test_mesh_small_speed_nobuf_LDADD = \ | ||
226 | $(top_builddir)/src/mesh/libgnunetmesh.la \ | ||
227 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
228 | $(top_builddir)/src/testing_old/libgnunettesting_old.la | ||
229 | test_mesh_small_speed_nobuf_DEPENDENCIES = \ | ||
230 | libgnunetmesh.la | ||
231 | |||
212 | test_mesh_small_speed_ack_SOURCES = \ | 232 | test_mesh_small_speed_ack_SOURCES = \ |
213 | test_mesh_small.c | 233 | test_mesh_small.c |
214 | test_mesh_small_speed_ack_LDADD = \ | 234 | test_mesh_small_speed_ack_LDADD = \ |
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index 90ac7bceb..ec08b53c4 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c | |||
@@ -62,6 +62,8 @@ struct MeshPeer | |||
62 | #define MULTICAST 2 | 62 | #define MULTICAST 2 |
63 | #define SPEED 3 | 63 | #define SPEED 3 |
64 | #define SPEED_ACK 4 | 64 | #define SPEED_ACK 4 |
65 | #define SPEED_MIN 5 | ||
66 | #define SPEED_NOBUF 6 | ||
65 | 67 | ||
66 | /** | 68 | /** |
67 | * Which test are we running? | 69 | * Which test are we running? |
@@ -688,6 +690,16 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
688 | &tunnel_cleaner, handlers, &app); | 690 | &tunnel_cleaner, handlers, &app); |
689 | } | 691 | } |
690 | t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L); | 692 | t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L); |
693 | if (SPEED_MIN == test) | ||
694 | { | ||
695 | GNUNET_MESH_tunnel_speed_min(t); | ||
696 | test = SPEED; | ||
697 | } | ||
698 | if (SPEED_NOBUF == test) | ||
699 | { | ||
700 | GNUNET_MESH_tunnel_buffer(t, GNUNET_NO); | ||
701 | test = SPEED; | ||
702 | } | ||
691 | peers_in_tunnel = 0; | 703 | peers_in_tunnel = 0; |
692 | test_task = | 704 | test_task = |
693 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 705 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
@@ -990,8 +1002,13 @@ main (int argc, char *argv[]) | |||
990 | * _________________________________ | 1002 | * _________________________________ |
991 | */ | 1003 | */ |
992 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n"); | 1004 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n"); |
993 | test = SPEED; | ||
994 | ok_goal = 1004; | 1005 | ok_goal = 1004; |
1006 | if (strstr (argv[0], "_min") != NULL) | ||
1007 | test = SPEED_MIN; | ||
1008 | else if (strstr (argv[0], "_nobuf") != NULL) | ||
1009 | test = SPEED_NOBUF; | ||
1010 | else | ||
1011 | test = SPEED; | ||
995 | } | 1012 | } |
996 | else | 1013 | else |
997 | { | 1014 | { |