[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] 01/03: Commenting the "rewind" CMD.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] 01/03: Commenting the "rewind" CMD. |
Date: |
Thu, 24 May 2018 18:40:11 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
commit 0084d799b822df70338c9cb5e1195363d8a51d75
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu May 24 16:28:51 2018 +0200
Commenting the "rewind" CMD.
---
src/lib/testing_api_cmd_rewind.c | 29 +++++++++++++++++++++-
.../taler-merchant-generate-payments_new.c | 2 +-
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 3e51f00..de8bb73 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 a92c8c0..4039d85 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;
--
To stop receiving notification emails like this one, please contact
address@hidden