diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-11-29 17:37:50 +0900 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-11-29 17:38:12 +0900 |
commit | 0df5ce8d4215b83c908de5631b12a3939ce1ca9e (patch) | |
tree | 84a4ead15336f5fabb86052e19c245f29ba632cb /src/service/testing/testing_api_cmd_batch.c | |
parent | c117e2f4e8a5ebd3fb9b7369d0b49161b835ab34 (diff) | |
download | gnunet-0df5ce8d4215b83c908de5631b12a3939ce1ca9e.tar.gz gnunet-0df5ce8d4215b83c908de5631b12a3939ce1ca9e.zip |
NEWS: libgnunettesting first major testing NG refactor towards getting dependency structure streamlined
Diffstat (limited to 'src/service/testing/testing_api_cmd_batch.c')
-rw-r--r-- | src/service/testing/testing_api_cmd_batch.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/service/testing/testing_api_cmd_batch.c b/src/service/testing/testing_api_cmd_batch.c index 7dc990855..2f1faf288 100644 --- a/src/service/testing/testing_api_cmd_batch.c +++ b/src/service/testing/testing_api_cmd_batch.c | |||
@@ -41,7 +41,7 @@ struct BatchState | |||
41 | /** | 41 | /** |
42 | * Our label. | 42 | * Our label. |
43 | */ | 43 | */ |
44 | const char *label; | 44 | struct GNUNET_TESTING_CommandLabel label; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Internal command pointer. | 47 | * Internal command pointer. |
@@ -65,14 +65,14 @@ batch_run (void *cls, | |||
65 | if (NULL != bs->batch[bs->batch_ip].run) | 65 | if (NULL != bs->batch[bs->batch_ip].run) |
66 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 66 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
67 | "Running batched command: %s\n", | 67 | "Running batched command: %s\n", |
68 | bs->batch[bs->batch_ip].label); | 68 | bs->batch[bs->batch_ip].label.value); |
69 | 69 | ||
70 | /* hit end command, leap to next top-level command. */ | 70 | /* hit end command, leap to next top-level command. */ |
71 | if (NULL == bs->batch[bs->batch_ip].run) | 71 | if (NULL == bs->batch[bs->batch_ip].run) |
72 | { | 72 | { |
73 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 73 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
74 | "Exiting from batch: %s\n", | 74 | "Exiting from batch: %s\n", |
75 | bs->label); | 75 | bs->label.value); |
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | bs->batch[bs->batch_ip].start_time | 78 | bs->batch[bs->batch_ip].start_time |
@@ -159,7 +159,8 @@ GNUNET_TESTING_cmd_batch (const char *label, | |||
159 | unsigned int i; | 159 | unsigned int i; |
160 | 160 | ||
161 | bs = GNUNET_new (struct BatchState); | 161 | bs = GNUNET_new (struct BatchState); |
162 | bs->label = label; | 162 | GNUNET_TESTING_set_label (&bs->label, |
163 | label); | ||
163 | /* Get number of commands. */ | 164 | /* Get number of commands. */ |
164 | for (i = 0; NULL != batch[i].run; i++) | 165 | for (i = 0; NULL != batch[i].run; i++) |
165 | /* noop */ | 166 | /* noop */ |
@@ -170,7 +171,8 @@ GNUNET_TESTING_cmd_batch (const char *label, | |||
170 | memcpy (bs->batch, | 171 | memcpy (bs->batch, |
171 | batch, | 172 | batch, |
172 | sizeof (struct GNUNET_TESTING_Command) * i); | 173 | sizeof (struct GNUNET_TESTING_Command) * i); |
173 | return GNUNET_TESTING_command_new (bs, label, | 174 | return GNUNET_TESTING_command_new (bs, |
175 | label, | ||
174 | &batch_run, | 176 | &batch_run, |
175 | &batch_cleanup, | 177 | &batch_cleanup, |
176 | &batch_traits, NULL); | 178 | &batch_traits, NULL); |
@@ -216,8 +218,6 @@ GNUNET_TESTING_cmd_batch_set_current_ (const struct GNUNET_TESTING_Command *cmd, | |||
216 | 218 | ||
217 | /* sanity checks */ | 219 | /* sanity checks */ |
218 | GNUNET_assert (GNUNET_TESTING_cmd_is_batch_ (cmd)); | 220 | GNUNET_assert (GNUNET_TESTING_cmd_is_batch_ (cmd)); |
219 | for (unsigned int i = 0; i < new_ip; i++) | ||
220 | GNUNET_assert (NULL != bs->batch[i].label); | ||
221 | /* actual logic */ | 221 | /* actual logic */ |
222 | bs->batch_ip = new_ip; | 222 | bs->batch_ip = new_ip; |
223 | } | 223 | } |