From 49f466df401259248c5d187374655492d4b4eec7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 3 Jul 2020 20:57:01 +0200 Subject: move rewind command to exchange, add proper support for rewinding in batches, modify API to rewind to label --- src/testing/testing_api_loop.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/testing/testing_api_loop.c') diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index 9b494da0c..af4a63c6a 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c @@ -69,6 +69,7 @@ TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is, #define BATCH_INDEX 1 struct TALER_TESTING_Command *batch; struct TALER_TESTING_Command *current; + struct TALER_TESTING_Command *icmd; const struct TALER_TESTING_Command *match; current = TALER_TESTING_cmd_batch_get_current (cmd); @@ -79,15 +80,15 @@ TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is, /* We must do the loop forward, but we can find the last match */ match = NULL; for (unsigned int j = 0; - NULL != (cmd = &batch[j])->label; + NULL != (icmd = &batch[j])->label; j++) { - if (current == cmd) + if (current == icmd) break; /* do not go past current command */ - if ( (NULL != cmd->label) && - (0 == strcmp (cmd->label, + if ( (NULL != icmd->label) && + (0 == strcmp (icmd->label, label)) ) - match = cmd; + match = icmd; } if (NULL != match) return match; -- cgit v1.2.3