gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: fix valgrind error in test_merch


From: gnunet
Subject: [taler-merchant] branch master updated: fix valgrind error in test_merchant_api
Date: Fri, 17 Jul 2020 23:54:03 +0200

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

jonathan-buchanan pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 2fe7aad  fix valgrind error in test_merchant_api
2fe7aad is described below

commit 2fe7aad94305e29d2b6bd4d4870d315e348a5576
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
AuthorDate: Fri Jul 17 17:53:53 2020 -0400

    fix valgrind error in test_merchant_api
---
 ...-merchant-httpd_private-post-products-ID-lock.c |  2 +-
 src/testing/test_merchant_api.c                    | 33 ++++++++++++++++++----
 src/testing/testing_api_cmd_post_orders.c          |  6 ++--
 3 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-products-ID-lock.c 
b/src/backend/taler-merchant-httpd_private-post-products-ID-lock.c
index aac8b8c..d7f87c7 100644
--- a/src/backend/taler-merchant-httpd_private-post-products-ID-lock.c
+++ b/src/backend/taler-merchant-httpd_private-post-products-ID-lock.c
@@ -100,7 +100,7 @@ TMH_private_post_products_ID_lock (const struct 
TMH_RequestHandler *rh,
                                          "The specified product is unknown");
     else
       return TALER_MHD_reply_with_error (connection,
-                                         MHD_HTTP_CONFLICT,
+                                         MHD_HTTP_GONE,
                                          
TALER_EC_PRODUCTS_LOCK_INSUFFICIENT_STOCKS,
                                          "The specified product is out of 
stock");
   case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 1a07424..0d4bc47 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -108,6 +108,15 @@ static struct GNUNET_OS_Process *merchantd;
  */
 #define MERCHANT_ACCOUNT_NAME "3"
 
+/**
+ * Payto URIs to use for testing accounts on the merchant.
+ */
+const char *payto_uris[] = {
+  PAYTO_I1,
+  "payto://sepa/CH9300762011623852957" /* Just for testing account
+                                          inactivation. */
+};
+
 
 /**
  * Execute the taler-exchange-wirewatch command with
@@ -423,6 +432,13 @@ run (void *cls,
                                              merchant_url,
                                              "1",
                                              MHD_HTTP_NO_CONTENT),
+    TALER_TESTING_cmd_merchant_post_orders ("create-proposal-no-id",
+                                            merchant_url,
+                                            MHD_HTTP_OK,
+                                            NULL,
+                                            GNUNET_TIME_UNIT_ZERO_ABS,
+                                            GNUNET_TIME_UNIT_FOREVER_ABS,
+                                            "EUR:5.0"),
     TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-2"),
     TALER_TESTING_cmd_end ()
   };
@@ -969,11 +985,6 @@ run (void *cls,
     TALER_TESTING_cmd_end ()
   };
 
-  const char *payto_uris[] = {
-    PAYTO_I1,
-    "payto://sepa/CH9300762011623852957" /* Just for testing account
-                                            inactivation. */
-  };
   struct TALER_TESTING_Command commands[] = {
     TALER_TESTING_cmd_batch ("orders-id",
                              get_private_order_id),
@@ -1188,6 +1199,18 @@ run (void *cls,
                                              GNUNET_TIME_UNIT_MINUTES,
                                              2,
                                              MHD_HTTP_NO_CONTENT),
+    TALER_TESTING_cmd_merchant_lock_product ("lock-product-nx",
+                                             merchant_url,
+                                             "product-nx",
+                                             GNUNET_TIME_UNIT_MINUTES,
+                                             2,
+                                             MHD_HTTP_NOT_FOUND),
+    TALER_TESTING_cmd_merchant_lock_product ("lock-product-too-much",
+                                             merchant_url,
+                                             "product-2",
+                                             GNUNET_TIME_UNIT_MINUTES,
+                                             39,
+                                             MHD_HTTP_GONE),
     TALER_TESTING_cmd_merchant_delete_product ("delete-product-locked",
                                                merchant_url,
                                                "product-2",
diff --git a/src/testing/testing_api_cmd_post_orders.c 
b/src/testing/testing_api_cmd_post_orders.c
index 6195d99..86c00bb 100644
--- a/src/testing/testing_api_cmd_post_orders.c
+++ b/src/testing/testing_api_cmd_post_orders.c
@@ -546,13 +546,13 @@ make_order_json (const char *order_id,
   GNUNET_TIME_round_abs (&pay);
 
   contract_terms = json_pack (
-    "{s:s, s:s, s:s, s:s, s:o, s:o}",
+    "{s:s, s:s?, s:s, s:s, s:o, s:o}",
     "summary", "merchant-lib testcase",
     "order_id", order_id,
     "amount", amount,
     "fulfillment_url", "https://example.com";,
-    "refund_deadline", GNUNET_JSON_from_time_abs (refund_deadline),
-    "pay_deadline", GNUNET_JSON_from_time_abs (pay_deadline)
+    "refund_deadline", GNUNET_JSON_from_time_abs (refund),
+    "pay_deadline", GNUNET_JSON_from_time_abs (pay)
     );
 
   *order = json_dumps (contract_terms, 0);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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