gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: add missing 'static


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: add missing 'static', ensure no NPE, fail nicely even on bad test input
Date: Mon, 03 Jun 2019 10:11:36 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 2cea0eb4 add missing 'static', ensure no NPE, fail nicely even on bad 
test input
2cea0eb4 is described below

commit 2cea0eb4d2ee117a48703370a4ff4be6b275df0f
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jun 3 10:11:28 2019 +0200

    add missing 'static', ensure no NPE, fail nicely even on bad test input
---
 src/lib/testing_api_cmd_track.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/lib/testing_api_cmd_track.c b/src/lib/testing_api_cmd_track.c
index 6afb0ac6..4a054144 100644
--- a/src/lib/testing_api_cmd_track.c
+++ b/src/lib/testing_api_cmd_track.c
@@ -243,6 +243,7 @@ deposit_wtid_cb
   TALER_TESTING_interpreter_next (tts->is);
 }
 
+
 /**
  * Run the command.
  *
@@ -340,6 +341,7 @@ track_transaction_run (void *cls,
   GNUNET_assert (NULL != tts->tth);
 }
 
+
 /**
  * Cleanup the state from a "track transaction" CMD, and possibly
  * cancel a operation thereof.
@@ -347,7 +349,7 @@ track_transaction_run (void *cls,
  * @param cls closure.
  * @param cmd the command which is being cleaned up.
  */
-void
+static void
 track_transaction_cleanup
   (void *cls,
    const struct TALER_TESTING_Command *cmd)
@@ -437,6 +439,7 @@ TALER_TESTING_cmd_track_transaction
   return cmd;
 }
 
+
 /**
  * Cleanup the state for a "track transfer" CMD, and possibly
  * cancel a pending operation thereof.
@@ -444,7 +447,7 @@ TALER_TESTING_cmd_track_transaction
  * @param cls closure.
  * @param cmd the command which is being cleaned up.
  */
-void
+static void
 track_transfer_cleanup (void *cls,
                         const struct TALER_TESTING_Command *cmd)
 {
@@ -461,9 +464,9 @@ track_transfer_cleanup (void *cls,
     tts->tth = NULL;
   }
   GNUNET_free (tts);
-
 }
 
+
 /**
  * Check whether the HTTP response code from a "track transfer"
  * operation is acceptable, and all other values like total amount,
@@ -505,11 +508,9 @@ track_transfer_cb
   struct TrackTransferState *tts = cls;
   struct TALER_TESTING_Interpreter *is = tts->is;
   struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
-
   struct TALER_Amount expected_amount;
 
   tts->tth = NULL;
-
   if (tts->expected_response_code != http_status)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -522,13 +523,18 @@ track_transfer_cb
     TALER_TESTING_interpreter_fail (is);
     return;
   }
-
-  if ( (NULL == tts->expected_total_amount) ||
-       (NULL == tts->expected_wire_fee) )
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Expected amount and fee not specified, "
-                "likely to segfault...\n");
-
+  if (NULL == tts->expected_total_amount)
+  {
+    GNUNET_break (0);
+    TALER_TESTING_interpreter_fail (is);
+    return;
+  }
+  if (NULL == tts->expected_wire_fee)
+  {
+    GNUNET_break (0);
+    TALER_TESTING_interpreter_fail (is);
+    return;
+  }
   switch (http_status)
   {
   case MHD_HTTP_OK:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]