gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix expected status code


From: gnunet
Subject: [taler-exchange] branch master updated: fix expected status code
Date: Sun, 12 Apr 2020 15:35:41 +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 d28f18f2 fix expected status code
d28f18f2 is described below

commit d28f18f2403d623d29ff4c9e69d3b99f7d4208b0
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Apr 12 15:35:38 2020 +0200

    fix expected status code
---
 src/lib/exchange_api_refreshes_reveal.c |   2 +-
 src/testing/test_exchange_api_twisted.c | 197 ++++++++++++++------------------
 2 files changed, 87 insertions(+), 112 deletions(-)

diff --git a/src/lib/exchange_api_refreshes_reveal.c 
b/src/lib/exchange_api_refreshes_reveal.c
index 8e84a6b8..e82d33a1 100644
--- a/src/lib/exchange_api_refreshes_reveal.c
+++ b/src/lib/exchange_api_refreshes_reveal.c
@@ -204,7 +204,7 @@ handle_refresh_reveal_finished (void *cls,
   const json_t *j = response;
   struct TALER_EXCHANGE_HttpResponse hr = {
     .reply = j,
-    .http_status = response_code
+    .http_status = (unsigned int) response_code
   };
 
   rrh->job = NULL;
diff --git a/src/testing/test_exchange_api_twisted.c 
b/src/testing/test_exchange_api_twisted.c
index 31b8ada7..9aac3d1e 100644
--- a/src/testing/test_exchange_api_twisted.c
+++ b/src/testing/test_exchange_api_twisted.c
@@ -109,54 +109,43 @@ run (void *cls,
    * response from a refresh-reveal operation.
    */
   struct TALER_TESTING_Command refresh_409_conflict[] = {
-    CMD_TRANSFER_TO_EXCHANGE
-      ("refresh-create-reserve",
-      "EUR:5.01"),
+    CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve",
+                              "EUR:5.01"),
     /**
      * Make previous command effective.
      */
-    CMD_EXEC_WIREWATCH
-      ("wirewatch"),
+    CMD_EXEC_WIREWATCH ("wirewatch"),
     /**
      * Withdraw EUR:5.
      */
-    TALER_TESTING_cmd_withdraw_amount
-      ("refresh-withdraw-coin",
-      "refresh-create-reserve",
-      "EUR:5",
-      MHD_HTTP_OK),
-
-    TALER_TESTING_cmd_deposit
-      ("refresh-deposit-partial",
-      "refresh-withdraw-coin",
-      0,
-      bc.user42_payto,
-      "{\"items\":[{\"name\":\"ice cream\",\
+    TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin",
+                                       "refresh-create-reserve",
+                                       "EUR:5",
+                                       MHD_HTTP_OK),
+    TALER_TESTING_cmd_deposit ("refresh-deposit-partial",
+                               "refresh-withdraw-coin",
+                               0,
+                               bc.user42_payto,
+                               "{\"items\":[{\"name\":\"ice cream\",\
                      \"value\":\"EUR:1\"}]}",
-      GNUNET_TIME_UNIT_ZERO,
-      "EUR:1",
-      MHD_HTTP_OK),
-
+                               GNUNET_TIME_UNIT_ZERO,
+                               "EUR:1",
+                               MHD_HTTP_OK),
     /**
      * Melt the rest of the coin's value
      * (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
-    TALER_TESTING_cmd_melt
-      ("refresh-melt",
-      "refresh-withdraw-coin",
-      MHD_HTTP_OK,
-      NULL),
+    TALER_TESTING_cmd_melt ("refresh-melt",
+                            "refresh-withdraw-coin",
+                            MHD_HTTP_OK,
+                            NULL),
     /* Trigger 409 Conflict.  */
-    TALER_TESTING_cmd_flip_upload
-      ("flip-upload",
-      CONFIG_FILE,
-      "transfer_privs.0"),
-    TALER_TESTING_cmd_refresh_reveal
-      ("refresh-(flipped-)reveal",
-      "refresh-melt",
-      MHD_HTTP_CONFLICT),
-
+    TALER_TESTING_cmd_flip_upload ("flip-upload",
+                                   CONFIG_FILE,
+                                   "transfer_privs.0"),
+    TALER_TESTING_cmd_refresh_reveal ("refresh-(flipped-)reveal",
+                                      "refresh-melt",
+                                      MHD_HTTP_CONFLICT),
     TALER_TESTING_cmd_end ()
-
   };
 
 
@@ -165,85 +154,71 @@ run (void *cls,
    * so it may be better to move those into the "main"
    * lib test suite.
    */struct TALER_TESTING_Command refund[] = {
-
-    CMD_TRANSFER_TO_EXCHANGE
-      ("create-reserve-r1",
-      "EUR:5.01"),
-    CMD_EXEC_WIREWATCH
-      ("wirewatch-r1"),
-    TALER_TESTING_cmd_withdraw_amount
-      ("withdraw-coin-r1",
-      "create-reserve-r1",
-      "EUR:5",
-      MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit
-      ("deposit-refund-1",
-      "withdraw-coin-r1",
-      0,
-      bc.user42_payto,
-      "{\"items\":[{\"name\":\"ice cream\","
-      "\"value\":\"EUR:5\"}]}",
-      GNUNET_TIME_UNIT_MINUTES,
-      "EUR:5",
-      MHD_HTTP_OK),
-    TALER_TESTING_cmd_refund
-      ("refund-currency-mismatch",
-      MHD_HTTP_PRECONDITION_FAILED,
-      "USD:5",
-      "USD:0.01",
-      "deposit-refund-1"),
-    TALER_TESTING_cmd_refund
-      ("refund-fee-above-amount",
-      MHD_HTTP_BAD_REQUEST,
-      "EUR:5",
-      "EUR:10",
-      "deposit-refund-1"),
-    TALER_TESTING_cmd_flip_upload
-      ("flip-upload",
-      CONFIG_FILE,
-      "merchant_sig"),
-    TALER_TESTING_cmd_refund
-      ("refund-bad-sig",
-      MHD_HTTP_FORBIDDEN,
-      "EUR:5",
-      "EUR:0.01",
-      "deposit-refund-1"),
+    CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r1",
+                              "EUR:5.01"),
+    CMD_EXEC_WIREWATCH ("wirewatch-r1"),
+    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r1",
+                                       "create-reserve-r1",
+                                       "EUR:5",
+                                       MHD_HTTP_OK),
+    TALER_TESTING_cmd_deposit ("deposit-refund-1",
+                               "withdraw-coin-r1",
+                               0,
+                               bc.user42_payto,
+                               "{\"items\":[{\"name\":\"ice cream\","
+                               "\"value\":\"EUR:5\"}]}",
+                               GNUNET_TIME_UNIT_MINUTES,
+                               "EUR:5",
+                               MHD_HTTP_OK),
+    TALER_TESTING_cmd_refund ("refund-currency-mismatch",
+                              MHD_HTTP_BAD_REQUEST,
+                              "USD:5",
+                              "USD:0.01",
+                              "deposit-refund-1"),
+    TALER_TESTING_cmd_refund ("refund-fee-above-amount",
+                              MHD_HTTP_BAD_REQUEST,
+                              "EUR:5",
+                              "EUR:10",
+                              "deposit-refund-1"),
+    TALER_TESTING_cmd_flip_upload ("flip-upload",
+                                   CONFIG_FILE,
+                                   "merchant_sig"),
+    TALER_TESTING_cmd_refund ("refund-bad-sig",
+                              MHD_HTTP_FORBIDDEN,
+                              "EUR:5",
+                              "EUR:0.01",
+                              "deposit-refund-1"),
 
     /* This next deposit CMD is only used to provide a
      * good merchant signature to the next (failing) refund
      * operations.  */
-
-    TALER_TESTING_cmd_deposit
-      ("deposit-refund-to-fail",
-      "withdraw-coin-r1",
-      0,  /* coin index.  */
-      bc.user42_payto,
-      /* This parameter will make any comparison about
-         h_contract_terms fail, when /refund will be handled.
-         So in other words, this is h_contract mismatch.  */
-      "{\"items\":[{\"name\":\"ice skate\","
-      "\"value\":\"EUR:5\"}]}",
-      GNUNET_TIME_UNIT_MINUTES,
-      "EUR:5",
-      MHD_HTTP_CONFLICT),
-    TALER_TESTING_cmd_refund
-      ("refund-deposit-not-found",
-      MHD_HTTP_NOT_FOUND,
-      "EUR:5",
-      "EUR:0.01",
-      "deposit-refund-to-fail"),
-    TALER_TESTING_cmd_refund
-      ("refund-insufficient-funds",
-      MHD_HTTP_PRECONDITION_FAILED,
-      "EUR:50",
-      "EUR:0.01",
-      "deposit-refund-1"),
-    TALER_TESTING_cmd_refund
-      ("refund-fee-too-low",
-      MHD_HTTP_BAD_REQUEST,
-      "EUR:5",
-      "EUR:0.000001",
-      "deposit-refund-1"),
+    TALER_TESTING_cmd_deposit ("deposit-refund-to-fail",
+                               "withdraw-coin-r1",
+                               0, /* coin index.  */
+                               bc.user42_payto,
+                               /* This parameter will make any comparison about
+                                  h_contract_terms fail, when /refund will be 
handled.
+                                  So in other words, this is h_contract 
mismatch.  */
+                               "{\"items\":[{\"name\":\"ice skate\","
+                               "\"value\":\"EUR:5\"}]}",
+                               GNUNET_TIME_UNIT_MINUTES,
+                               "EUR:5",
+                               MHD_HTTP_CONFLICT),
+    TALER_TESTING_cmd_refund ("refund-deposit-not-found",
+                              MHD_HTTP_NOT_FOUND,
+                              "EUR:5",
+                              "EUR:0.01",
+                              "deposit-refund-to-fail"),
+    TALER_TESTING_cmd_refund ("refund-insufficient-funds",
+                              MHD_HTTP_PRECONDITION_FAILED,
+                              "EUR:50",
+                              "EUR:0.01",
+                              "deposit-refund-1"),
+    TALER_TESTING_cmd_refund ("refund-fee-too-low",
+                              MHD_HTTP_BAD_REQUEST,
+                              "EUR:5",
+                              "EUR:0.000001",
+                              "deposit-refund-1"),
     TALER_TESTING_cmd_end ()
   };
 

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



reply via email to

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