summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_get_product.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_get_product.c')
-rw-r--r--src/testing/testing_api_cmd_get_product.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/src/testing/testing_api_cmd_get_product.c b/src/testing/testing_api_cmd_get_product.c
index d1f844b0..7f46a5f3 100644
--- a/src/testing/testing_api_cmd_get_product.c
+++ b/src/testing/testing_api_cmd_get_product.c
@@ -124,18 +124,17 @@ get_product_cb (void *cls,
{
case MHD_HTTP_OK:
{
- const char *expected_description;
+ const char **expected_description;
product_cmd = TALER_TESTING_interpreter_lookup_command (
gis->is,
gis->product_reference);
if (GNUNET_OK !=
- TALER_TESTING_get_trait_string (product_cmd,
- 0,
- &expected_description))
+ TALER_TESTING_get_trait_product_description (product_cmd,
+ &expected_description))
TALER_TESTING_interpreter_fail (gis->is);
if (0 != strcmp (description,
- expected_description))
+ *expected_description))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Product description does not match\n");
@@ -145,10 +144,10 @@ get_product_cb (void *cls,
}
{
const json_t *expected_description_i18n;
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_json (product_cmd,
- 0,
- &expected_description_i18n))
+ TALER_TESTING_get_trait_i18n_description (product_cmd,
+ &expected_description_i18n))
TALER_TESTING_interpreter_fail (gis->is);
if (1 != json_equal (description_i18n,
expected_description_i18n))
@@ -161,10 +160,10 @@ get_product_cb (void *cls,
}
{
const struct TALER_Amount *expected_price;
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_amount_obj (product_cmd,
- 0,
- &expected_price))
+ TALER_TESTING_get_trait_amount (product_cmd,
+ &expected_price))
TALER_TESTING_interpreter_fail (gis->is);
if ((GNUNET_OK != TALER_amount_cmp_currency (price,
expected_price)) ||
@@ -178,15 +177,14 @@ get_product_cb (void *cls,
}
}
{
- const char *expected_image;
+ const char **expected_image;
if (GNUNET_OK !=
- TALER_TESTING_get_trait_string (product_cmd,
- 3,
- &expected_image))
+ TALER_TESTING_get_trait_product_image (product_cmd,
+ &expected_image))
TALER_TESTING_interpreter_fail (gis->is);
if (0 != strcmp (image,
- expected_image))
+ *expected_image))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Product image does not match\n");
@@ -196,10 +194,10 @@ get_product_cb (void *cls,
}
{
const json_t *expected_taxes;
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_json (product_cmd,
- 2,
- &expected_taxes))
+ TALER_TESTING_get_trait_taxes (product_cmd,
+ &expected_taxes))
TALER_TESTING_interpreter_fail (gis->is);
if (1 != json_equal (taxes,
expected_taxes))
@@ -211,14 +209,14 @@ get_product_cb (void *cls,
}
}
{
- const char *expected_unit;
+ const char **expected_unit;
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_string (product_cmd,
- 1,
- &expected_unit))
+ TALER_TESTING_get_trait_product_unit (product_cmd,
+ &expected_unit))
TALER_TESTING_interpreter_fail (gis->is);
if (0 != strcmp (unit,
- expected_unit))
+ *expected_unit))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Product unit does not match\n");
@@ -228,10 +226,10 @@ get_product_cb (void *cls,
}
{
const json_t *expected_location;
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_json (product_cmd,
- 3,
- &expected_location))
+ TALER_TESTING_get_trait_address (product_cmd,
+ &expected_location))
TALER_TESTING_interpreter_fail (gis->is);
if (1 != json_equal (location,
expected_location))
@@ -244,10 +242,10 @@ get_product_cb (void *cls,
}
{
const int64_t *expected_total_stock;
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_int64 (product_cmd,
- 0,
- &expected_total_stock))
+ TALER_TESTING_get_trait_product_stock (product_cmd,
+ &expected_total_stock))
TALER_TESTING_interpreter_fail (gis->is);
if (total_stock != *expected_total_stock)
{