diff options
Diffstat (limited to 'src/testing/testing_api_cmd_block_until_all_peers_started.c')
-rw-r--r-- | src/testing/testing_api_cmd_block_until_all_peers_started.c | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/src/testing/testing_api_cmd_block_until_all_peers_started.c b/src/testing/testing_api_cmd_block_until_all_peers_started.c index fb51c1066..8a47a7ce0 100644 --- a/src/testing/testing_api_cmd_block_until_all_peers_started.c +++ b/src/testing/testing_api_cmd_block_until_all_peers_started.c | |||
@@ -47,20 +47,6 @@ struct BlockState | |||
47 | 47 | ||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Trait function of this cmd does nothing. | ||
51 | * | ||
52 | */ | ||
53 | static int | ||
54 | block_until_all_peers_started_traits (void *cls, | ||
55 | const void **ret, | ||
56 | const char *trait, | ||
57 | unsigned int index) | ||
58 | { | ||
59 | return GNUNET_OK; | ||
60 | } | ||
61 | |||
62 | |||
63 | /** | ||
64 | * The cleanup function of this cmd frees resources the cmd allocated. | 50 | * The cleanup function of this cmd frees resources the cmd allocated. |
65 | * | 51 | * |
66 | */ | 52 | */ |
@@ -87,27 +73,6 @@ block_until_all_peers_started_run (void *cls, | |||
87 | 73 | ||
88 | 74 | ||
89 | /** | 75 | /** |
90 | * Function to check if BlockState#all_peers_started is GNUNET_YES. In that case interpreter_next will be called. | ||
91 | * | ||
92 | */ | ||
93 | static int | ||
94 | block_until_all_peers_started_finish (void *cls, | ||
95 | GNUNET_SCHEDULER_TaskCallback cont, | ||
96 | void *cont_cls) | ||
97 | { | ||
98 | struct BlockState *bs = cls; | ||
99 | unsigned int *ret = bs->all_peers_started; | ||
100 | |||
101 | if (GNUNET_YES == *ret) | ||
102 | { | ||
103 | cont (cont_cls); | ||
104 | } | ||
105 | |||
106 | return *ret; | ||
107 | } | ||
108 | |||
109 | |||
110 | /** | ||
111 | * Create command. | 76 | * Create command. |
112 | * | 77 | * |
113 | * @param label name for command. | 78 | * @param label name for command. |
@@ -123,15 +88,14 @@ GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, | |||
123 | 88 | ||
124 | bs = GNUNET_new (struct BlockState); | 89 | bs = GNUNET_new (struct BlockState); |
125 | bs->all_peers_started = all_peers_started; | 90 | bs->all_peers_started = all_peers_started; |
126 | 91 | { | |
127 | struct GNUNET_TESTING_Command cmd = { | 92 | struct GNUNET_TESTING_Command cmd = { |
128 | .cls = bs, | 93 | .cls = bs, |
129 | .label = label, | 94 | .label = label, |
130 | .run = &block_until_all_peers_started_run, | 95 | .run = &block_until_all_peers_started_run, |
131 | .finish = &block_until_all_peers_started_finish, | 96 | .cleanup = &block_until_all_peers_started_cleanup |
132 | .cleanup = &block_until_all_peers_started_cleanup, | 97 | }; |
133 | .traits = &block_until_all_peers_started_traits | 98 | |
134 | }; | 99 | return cmd; |
135 | 100 | } | |
136 | return cmd; | ||
137 | } | 101 | } |