summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-05-24 16:28:51 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-05-24 16:28:51 +0200
commit0084d799b822df70338c9cb5e1195363d8a51d75 (patch)
treef1c22edc0f38ca134338a2b6db540620ee9beaa4 /src
parent041ad71e176ddbdd246e710d2b8ac326d439639b (diff)
downloadmerchant-0084d799b822df70338c9cb5e1195363d8a51d75.tar.gz
merchant-0084d799b822df70338c9cb5e1195363d8a51d75.tar.bz2
merchant-0084d799b822df70338c9cb5e1195363d8a51d75.zip
Commenting the "rewind" CMD.
Diffstat (limited to 'src')
-rw-r--r--src/lib/testing_api_cmd_rewind.c29
-rw-r--r--src/merchant-tools/taler-merchant-generate-payments_new.c2
2 files changed, 29 insertions, 2 deletions
diff --git a/src/lib/testing_api_cmd_rewind.c b/src/lib/testing_api_cmd_rewind.c
index 3e51f005..de8bb73f 100644
--- a/src/lib/testing_api_cmd_rewind.c
+++ b/src/lib/testing_api_cmd_rewind.c
@@ -29,17 +29,43 @@
#include "taler_merchant_service.h"
#include "taler_merchant_testing_lib.h"
+
+/**
+ * State for a "rewind" CMD.
+ */
struct RewindIpState
{
+ /**
+ * Instruction pointer to set into the interpreter.
+ */
unsigned int new_ip;
+
+ /**
+ * How many times this set should take place.
+ * However, this value lives at the calling process,
+ * and this CMD is only in charge of checking and
+ * decremeting it.
+ */
unsigned int *counter;
};
+
+/**
+ * Only defined to respect the API.
+ */
static void
rewind_ip_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd)
{}
+
+/**
+ * Run the "rewind" CMD.
+ *
+ * @param cls closure.
+ * @param cmd command being executed now.
+ * @param is the interpreter state.
+ */
static void
rewind_ip_run (void *cls,
const struct TALER_TESTING_Command *cmd,
@@ -47,6 +73,7 @@ rewind_ip_run (void *cls,
{
struct RewindIpState *ris = cls;
+ /* FIXME: do check if '1<' is good */
if (1 < *ris->counter)
{
is->ip = ris->new_ip;
@@ -63,7 +90,7 @@ rewind_ip_run (void *cls,
* @param label command label
* @param new_ip new instruction pointer's value. Note that,
* when the next instruction will be called, the interpreter
- * will increment the ip under the hood so this value must be
+ * will increment the ip _anyway_ so this value must be
* set to the index of the instruction we want to execute next
* MINUS one.
* @param counter counts how many times the rewinding has
diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c b/src/merchant-tools/taler-merchant-generate-payments_new.c
index a92c8c00..4039d859 100644
--- a/src/merchant-tools/taler-merchant-generate-payments_new.c
+++ b/src/merchant-tools/taler-merchant-generate-payments_new.c
@@ -87,7 +87,7 @@ static unsigned int payments_number = 1;
/**
* How many /tracks operation we want to perform.
*/
-static unsigned int tracks_number;
+static unsigned int tracks_number = 1;
static const char *default_config_file;