View Issue Details

IDProjectCategoryView StatusLast Update
0006000Talermechant backendpublic2021-08-24 16:23
ReporterChristian Grothoff Assigned Tojonathanbuchanan  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.8Fixed in Version0.8 
Summary0006000: test case logic is messy
DescriptionFlorian wrote:
I've quoted a *partial* example below,of some multi-screen macro in a
test case. This raises so many questions:

* why does the macro have varargs when they are not used?
* why are there local variables in the macro?
* WTF is this a macro and not a function? it's used only once ...
* why is *everything* defined in a big string? Why don't we have helper
function that take a literal struct that describes the data and then
generates the contract terms? This is such an unreadable,
unmaintainable mess right now.

The old currency format used to look like this, in many places:

  \"pay_deadline\":\"\\/Date(99999999999)\\/\",\

Again raising the questions of:
 * did nobody think that maybe the quoting required here is a bit
excessive and should be somehow factored out? There are dozens of lines
like this.
 * why is there this magic constant, should't "/never/" or { t_ms:
"never" } work instead of some arbitary constant?

Marcello, since I'm super busy with updating some other stuff that's
critical for the congress demo, please update the test cases.

For now, just make sure that it works. But long term, we need to
untangle this mess.

- Florian


#define ALLOCATE_ORDERS(...) \
  char *order_worth_5; \
  char *order_worth_5_track; \
  char *order_worth_5_unaggregated; \
  char *order_worth_10_2coins; \
  \
  GNUNET_asprintf \
    (&order_worth_5, \
    "{\"max_fee\":\
       {\"currency\":\"%s\",\
        \"value\":0,\
        \"fraction\":50000000},\
       \"refund_deadline\": { \"t_ms\": 0 },\
       \"pay_deadline\": { \"t_ms\": 99999999999 },\
       \"amount\":\
         {\"currency\":\"%s\",\
          \"value\":5,\
          \"fraction\":0},\
        \"summary\": \"merchant-lib testcase\",\
        \"fulfillment_url\": \"https://example.com/\",\
        \"products\": [ {\"description\":\"ice cream\",\
                         \"value\":\"{%s:5}\"} ] }", \
    currency, \
    currency, \
    currency); \

[ goes on like this for many more lines ]
TagsNo tags attached.

Activities

jonathanbuchanan

2020-07-11 22:52

reporter   ~0016445

The macro seems to have been removed, but we're still passing a json string to TALER_TESTING_cmd_merchant_post_orders, which isn't ideal. I'll change the function to generate this string internally.

jonathanbuchanan

2020-07-12 02:05

reporter   ~0016446

fixed in 89f4530..d545306

Issue History

Date Modified Username Field Change
2019-12-20 10:27 Christian Grothoff New Issue
2019-12-20 10:27 Christian Grothoff Status new => assigned
2019-12-20 10:27 Christian Grothoff Assigned To => Marcello Stanisci
2020-03-29 22:08 Christian Grothoff Target Version 0.7.1 => 0.8.1
2020-05-01 19:57 Christian Grothoff Target Version 0.8.1 => 0.8
2020-07-10 23:28 Christian Grothoff Assigned To Marcello Stanisci => jonathanbuchanan
2020-07-11 22:52 jonathanbuchanan Note Added: 0016445
2020-07-12 02:05 jonathanbuchanan Note Added: 0016446
2020-07-12 07:09 jonathanbuchanan Status assigned => resolved
2020-07-12 07:09 jonathanbuchanan Resolution open => fixed
2020-07-24 11:56 Christian Grothoff Fixed in Version => 0.8
2021-08-24 16:23 Christian Grothoff Status resolved => closed