diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-05 20:43:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-05 20:43:28 +0200 |
commit | 6de49ea2c02e311e5f5366005bd3497a9bb25187 (patch) | |
tree | a221b9c784b4e004eb5972e18516653d1aea6a5c /src/testing/testing_api_cmd_batch.c | |
parent | e428783e2e0295186dc4eae273df8a3f8b75df60 (diff) | |
parent | ed5b98a2c2308fbd44b906a30286d2689fd304dd (diff) |
Merge branch 'protocolv8'
Diffstat (limited to 'src/testing/testing_api_cmd_batch.c')
-rw-r--r-- | src/testing/testing_api_cmd_batch.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testing/testing_api_cmd_batch.c b/src/testing/testing_api_cmd_batch.c index 2d50f8ef..ca23d7fd 100644 --- a/src/testing/testing_api_cmd_batch.c +++ b/src/testing/testing_api_cmd_batch.c @@ -228,5 +228,27 @@ TALER_TESTING_cmd_batch_get_current (const struct TALER_TESTING_Command *cmd) { struct BatchState *bs = cmd->cls; + GNUNET_assert (cmd->run == &batch_run); return &bs->batch[bs->batch_ip]; } + + +/** + * Set what command the batch should be at. + * + * @param cmd current batch command + * @param new_ip where to move the IP + */ +void +TALER_TESTING_cmd_batch_set_current (const struct TALER_TESTING_Command *cmd, + unsigned int new_ip) +{ + struct BatchState *bs = cmd->cls; + + /* sanity checks */ + GNUNET_assert (cmd->run == &batch_run); + for (unsigned int i = 0; i < new_ip; i++) + GNUNET_assert (NULL != bs->batch[i].label); + /* actual logic */ + bs->batch_ip = new_ip; +} |