This commit is contained in:
Marcello Stanisci 2018-12-19 11:43:05 +01:00
parent b22b36a20b
commit 9c82290a1a
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
20 changed files with 237 additions and 175 deletions

View File

@ -793,7 +793,6 @@ TALER_TESTING_cmd_bank_history
long long num_results)
{
struct HistoryState *hs;
struct TALER_TESTING_Command cmd;
hs = GNUNET_new (struct HistoryState);
hs->bank_url = bank_url;
@ -803,11 +802,13 @@ TALER_TESTING_cmd_bank_history
hs->num_results = num_results;
hs->ascending = ascending;
cmd.label = label;
cmd.cls = hs;
cmd.run = &history_run;
cmd.cleanup = &history_cleanup;
cmd.traits = &history_traits;
struct TALER_TESTING_Command cmd = {
.label = label,
.cls = hs,
.run = &history_run,
.cleanup = &history_cleanup,
.traits = &history_traits
};
return cmd;
}

View File

@ -200,20 +200,22 @@ TALER_TESTING_cmd_bank_reject (const char *label,
const char *deposit_reference)
{
struct RejectState *rs;
struct TALER_TESTING_Command cmd;
rs = GNUNET_new (struct RejectState);
rs->bank_url = bank_url;
rs->deposit_reference = deposit_reference;
cmd.cls = rs;
cmd.run = &reject_run;
cmd.cleanup = &reject_cleanup;
cmd.label = label;
cmd.traits = &reject_traits;
struct TALER_TESTING_Command cmd = {
.cls = rs,
.run = &reject_run,
.cleanup = &reject_cleanup,
.label = label,
.traits = &reject_traits
};
return cmd;
}
/* end of testing_api_cmd_reject.c */

View File

@ -253,7 +253,6 @@ TALER_TESTING_cmd_check_bank_transfer
uint64_t credit_account)
{
struct BankCheckState *bcs;
struct TALER_TESTING_Command cmd;
bcs = GNUNET_new (struct BankCheckState);
bcs->exchange_base_url = exchange_base_url;
@ -263,11 +262,13 @@ TALER_TESTING_cmd_check_bank_transfer
bcs->deposit_reference = NULL;
cmd.label = label;
cmd.cls = bcs;
cmd.run = &check_bank_transfer_run;
cmd.cleanup = &check_bank_transfer_cleanup;
cmd.traits = &check_bank_transfer_traits;
struct TALER_TESTING_Command cmd = {
.label = label,
.cls = bcs,
.run = &check_bank_transfer_run,
.cleanup = &check_bank_transfer_cleanup,
.traits = &check_bank_transfer_traits
};
return cmd;
}

View File

@ -157,7 +157,6 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_batch (const char *label,
struct TALER_TESTING_Command *batch)
{
struct TALER_TESTING_Command cmd;
struct BatchState *bs;
unsigned int i;
@ -175,11 +174,13 @@ TALER_TESTING_cmd_batch (const char *label,
batch,
sizeof (struct TALER_TESTING_Command) * i);
cmd.cls = bs;
cmd.label = label;
cmd.run = &batch_run;
cmd.cleanup = &batch_cleanup;
cmd.traits = &batch_traits;
struct TALER_TESTING_Command cmd = {
.cls = bs,
.label = label,
.run = &batch_run,
.cleanup = &batch_cleanup,
.traits = &batch_traits
};
return cmd;
}

View File

@ -143,15 +143,18 @@ TALER_TESTING_cmd_check_keys
unsigned int num_denom_keys)
{
struct CheckKeysState *cks;
struct TALER_TESTING_Command cmd;
cks = GNUNET_new (struct CheckKeysState);
cks->generation = generation;
cks->num_denom_keys = num_denom_keys;
cmd.cls = cks;
cmd.label = label;
cmd.run = &check_keys_run;
cmd.cleanup = &check_keys_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
return cmd;
}

View File

@ -519,7 +519,6 @@ TALER_TESTING_cmd_deposit
const char *amount,
unsigned int expected_response_code)
{
struct TALER_TESTING_Command cmd = {0}; /* need explicit zeroing..*/
struct DepositState *ds;
ds = GNUNET_new (struct DepositState);
@ -543,11 +542,13 @@ TALER_TESTING_cmd_deposit
ds->amount = amount;
ds->expected_response_code = expected_response_code;
cmd.cls = ds;
cmd.label = label;
cmd.run = &deposit_run;
cmd.cleanup = &deposit_cleanup;
cmd.traits = &deposit_traits;
struct TALER_TESTING_Command cmd = {
.cls = ds,
.label = label,
.run = &deposit_run,
.cleanup = &deposit_cleanup,
.traits = &deposit_traits
};
return cmd;
}

View File

@ -147,16 +147,19 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_exec_aggregator (const char *label,
const char *config_filename)
{
struct TALER_TESTING_Command cmd;
struct AggregatorState *as;
as = GNUNET_new (struct AggregatorState);
as->config_filename = config_filename;
cmd.cls = as;
cmd.label = label;
cmd.run = &aggregator_run;
cmd.cleanup = &aggregator_cleanup;
cmd.traits = &aggregator_traits;
struct TALER_TESTING_Command cmd = {
.cls = as,
.label = label,
.run = &aggregator_run,
.cleanup = &aggregator_cleanup,
.traits = &aggregator_traits
};
return cmd;
}

View File

@ -212,16 +212,20 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_exec_auditor_sign (const char *label,
const char *config_filename)
{
struct TALER_TESTING_Command cmd;
struct AuditorSignState *ass;
ass = GNUNET_new (struct AuditorSignState);
ass->config_filename = config_filename;
cmd.cls = ass;
cmd.label = label;
cmd.run = &auditor_sign_run;
cmd.cleanup = &auditor_sign_cleanup;
cmd.traits = &auditor_sign_traits;
struct TALER_TESTING_Command cmd = {
.cls = ass,
.label = label,
.run = &auditor_sign_run,
.cleanup = &auditor_sign_cleanup,
.traits = &auditor_sign_traits
};
return cmd;
}

View File

@ -150,16 +150,19 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_exec_keyup (const char *label,
const char *config_filename)
{
struct TALER_TESTING_Command cmd;
struct KeyupState *ks;
ks = GNUNET_new (struct KeyupState);
ks->config_filename = config_filename;
cmd.cls = ks;
cmd.label = label;
cmd.run = &keyup_run;
cmd.cleanup = &keyup_cleanup;
cmd.traits = &keyup_traits;
struct TALER_TESTING_Command cmd = {
.cls = ks,
.label = label,
.run = &keyup_run,
.cleanup = &keyup_cleanup,
.traits = &keyup_traits
};
return cmd;
}

View File

@ -148,16 +148,20 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_exec_wirewatch (const char *label,
const char *config_filename)
{
struct TALER_TESTING_Command cmd;
struct WirewatchState *ws;
ws = GNUNET_new (struct WirewatchState);
ws->config_filename = config_filename;
cmd.cls = ws;
cmd.label = label;
cmd.run = &wirewatch_run;
cmd.cleanup = &wirewatch_cleanup;
cmd.traits = &wirewatch_traits;
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &wirewatch_run,
.cleanup = &wirewatch_cleanup,
.traits = &wirewatch_traits
};
return cmd;
}

View File

@ -486,7 +486,6 @@ TALER_TESTING_cmd_fakebank_transfer
const char *auth_password,
const char *exchange_url)
{
struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts;
fts = GNUNET_new (struct FakebankTransferState);
@ -506,11 +505,15 @@ TALER_TESTING_cmd_fakebank_transfer
label);
GNUNET_assert (0);
}
cmd.cls = fts;
cmd.label = label;
cmd.run = &fakebank_transfer_run;
cmd.cleanup = &fakebank_transfer_cleanup;
cmd.traits = &fakebank_transfer_traits;
struct TALER_TESTING_Command cmd = {
.cls = fts,
.label = label,
.run = &fakebank_transfer_run,
.cleanup = &fakebank_transfer_cleanup,
.traits = &fakebank_transfer_traits
};
return cmd;
}
@ -549,7 +552,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_subject
const char *subject,
const char *exchange_url)
{
struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts;
fts = GNUNET_new (struct FakebankTransferState);
@ -575,11 +577,15 @@ TALER_TESTING_cmd_fakebank_transfer_with_subject
label);
GNUNET_assert (0);
}
cmd.cls = fts;
cmd.label = label;
cmd.run = &fakebank_transfer_run;
cmd.cleanup = &fakebank_transfer_cleanup;
cmd.traits = &fakebank_transfer_traits;
struct TALER_TESTING_Command cmd = {
.cls = fts,
.label = label,
.run = &fakebank_transfer_run,
.cleanup = &fakebank_transfer_cleanup,
.traits = &fakebank_transfer_traits
};
return cmd;
}
@ -619,7 +625,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
const char *ref,
const char *exchange_url)
{
struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts;
fts = GNUNET_new (struct FakebankTransferState);
@ -640,11 +645,15 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
label);
GNUNET_assert (0);
}
cmd.cls = fts;
cmd.label = label;
cmd.run = &fakebank_transfer_run;
cmd.cleanup = &fakebank_transfer_cleanup;
cmd.traits = &fakebank_transfer_traits;
struct TALER_TESTING_Command cmd = {
.cls = fts,
.label = label,
.run = &fakebank_transfer_run,
.cleanup = &fakebank_transfer_cleanup,
.traits = &fakebank_transfer_traits
};
return cmd;
}
@ -691,7 +700,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_instance
const char *exchange_url,
const char *config_filename)
{
struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts;
fts = GNUNET_new (struct FakebankTransferState);
@ -713,11 +721,15 @@ TALER_TESTING_cmd_fakebank_transfer_with_instance
label);
GNUNET_assert (0);
}
cmd.cls = fts;
cmd.label = label;
cmd.run = &fakebank_transfer_run;
cmd.cleanup = &fakebank_transfer_cleanup;
cmd.traits = &fakebank_transfer_traits;
struct TALER_TESTING_Command cmd = {
.cls = fts,
.label = label,
.run = &fakebank_transfer_run,
.cleanup = &fakebank_transfer_cleanup,
.traits = &fakebank_transfer_traits
};
return cmd;
}

View File

@ -444,17 +444,18 @@ TALER_TESTING_cmd_payback (const char *label,
const char *amount)
{
struct PaybackState *ps;
struct TALER_TESTING_Command cmd;
ps = GNUNET_new (struct PaybackState);
ps->expected_response_code = expected_response_code;
ps->coin_reference = coin_reference;
ps->amount = amount;
cmd.cls = ps;
cmd.label = label;
cmd.run = &payback_run;
cmd.cleanup = &payback_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = ps,
.label = label,
.run = &payback_run,
.cleanup = &payback_cleanup
};
return cmd;
}
@ -479,18 +480,19 @@ TALER_TESTING_cmd_revoke (const char *label,
{
struct RevokeState *rs;
struct TALER_TESTING_Command cmd;
rs = GNUNET_new (struct RevokeState);
rs->expected_response_code = expected_response_code;
rs->coin_reference = coin_reference;
rs->config_filename = config_filename;
cmd.cls = rs;
cmd.label = label;
cmd.run = &revoke_run;
cmd.cleanup = &revoke_cleanup;
cmd.traits = &revoke_traits;
struct TALER_TESTING_Command cmd = {
.cls = rs,
.label = label,
.run = &revoke_run,
.cleanup = &revoke_cleanup,
.traits = &revoke_traits
};
return cmd;
}

View File

@ -1077,7 +1077,6 @@ TALER_TESTING_cmd_refresh_melt
{
struct RefreshMeltState *rms;
struct MeltDetails md;
struct TALER_TESTING_Command cmd;
md.coin_reference = coin_reference;
md.amount = amount;
@ -1086,11 +1085,14 @@ TALER_TESTING_cmd_refresh_melt
rms->melted_coin = md;
rms->expected_response_code = expected_response_code;
cmd.label = label;
cmd.cls = rms;
cmd.run = &refresh_melt_run;
cmd.cleanup = &refresh_melt_cleanup;
cmd.traits = &refresh_melt_traits;
struct TALER_TESTING_Command cmd = {
.label = label,
.cls = rms,
.run = &refresh_melt_run,
.cleanup = &refresh_melt_cleanup,
.traits = &refresh_melt_traits
};
return cmd;
}
@ -1118,7 +1120,6 @@ TALER_TESTING_cmd_refresh_melt_double
{
struct RefreshMeltState *rms;
struct MeltDetails md;
struct TALER_TESTING_Command cmd;
md.coin_reference = coin_reference;
md.amount = amount;
@ -1128,11 +1129,14 @@ TALER_TESTING_cmd_refresh_melt_double
rms->expected_response_code = expected_response_code;
rms->double_melt = GNUNET_YES;
cmd.label = label;
cmd.cls = rms;
cmd.run = &refresh_melt_run;
cmd.cleanup = &refresh_melt_cleanup;
cmd.traits = &refresh_melt_traits;
struct TALER_TESTING_Command cmd = {
.label = label,
.cls = rms,
.run = &refresh_melt_run,
.cleanup = &refresh_melt_cleanup,
.traits = &refresh_melt_traits
};
return cmd;
}
@ -1228,17 +1232,19 @@ TALER_TESTING_cmd_refresh_reveal
unsigned int expected_response_code)
{
struct RefreshRevealState *rrs;
struct TALER_TESTING_Command cmd;
rrs = GNUNET_new (struct RefreshRevealState);
rrs->melt_reference = melt_reference;
rrs->expected_response_code = expected_response_code;
cmd.cls = rrs;
cmd.label = label;
cmd.run = &refresh_reveal_run;
cmd.cleanup = &refresh_reveal_cleanup;
cmd.traits = &refresh_reveal_traits;
struct TALER_TESTING_Command cmd = {
.cls = rrs,
.label = label,
.run = &refresh_reveal_run,
.cleanup = &refresh_reveal_cleanup,
.traits = &refresh_reveal_traits
};
return cmd;
}
@ -1277,16 +1283,18 @@ TALER_TESTING_cmd_refresh_link
unsigned int expected_response_code)
{
struct RefreshLinkState *rrs;
struct TALER_TESTING_Command cmd;
rrs = GNUNET_new (struct RefreshLinkState);
rrs->reveal_reference = reveal_reference;
rrs->expected_response_code = expected_response_code;
cmd.cls = rrs;
cmd.label = label;
cmd.run = &refresh_link_run;
cmd.cleanup = &refresh_link_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = rrs,
.label = label,
.run = &refresh_link_run,
.cleanup = &refresh_link_cleanup
};
return cmd;
}

View File

@ -268,7 +268,6 @@ TALER_TESTING_cmd_refund (const char *label,
const char *coin_reference)
{
struct RefundState *rs;
struct TALER_TESTING_Command cmd;
rs = GNUNET_new (struct RefundState);
@ -277,10 +276,12 @@ TALER_TESTING_cmd_refund (const char *label,
rs->refund_fee = refund_fee;
rs->coin_reference = coin_reference;
cmd.cls = rs;
cmd.label = label;
cmd.run = &refund_run;
cmd.cleanup = &refund_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = rs,
.label = label,
.run = &refund_run,
.cleanup = &refund_cleanup
};
return cmd;
}
@ -310,7 +311,6 @@ TALER_TESTING_cmd_refund_with_id
uint64_t refund_transaction_id)
{
struct RefundState *rs;
struct TALER_TESTING_Command cmd;
rs = GNUNET_new (struct RefundState);
@ -320,10 +320,12 @@ TALER_TESTING_cmd_refund_with_id
rs->coin_reference = coin_reference;
rs->refund_transaction_id = refund_transaction_id;
cmd.cls = rs;
cmd.label = label;
cmd.run = &refund_run;
cmd.cleanup = &refund_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = rs,
.label = label,
.run = &refund_run,
.cleanup = &refund_cleanup
};
return cmd;
}

View File

@ -99,15 +99,18 @@ TALER_TESTING_cmd_signal (const char *label,
int signal)
{
struct SignalState *ss;
struct TALER_TESTING_Command cmd;
ss = GNUNET_new (struct SignalState);
ss->process = process;
ss->signal = signal;
cmd.cls = ss;
cmd.label = label;
cmd.run = &signal_run;
cmd.cleanup = &signal_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = ss,
.label = label,
.run = &signal_run,
.cleanup = &signal_cleanup
};
return cmd;
}

View File

@ -88,14 +88,17 @@ TALER_TESTING_cmd_sleep (const char *label,
unsigned int duration_s)
{
struct SleepState *ss;
struct TALER_TESTING_Command cmd;
ss = GNUNET_new (struct SleepState);
ss->duration = duration_s;
cmd.cls = ss;
cmd.label = label;
cmd.run = &sleep_run;
cmd.cleanup = &sleep_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = ss,
.label = label,
.run = &sleep_run,
.cleanup = &sleep_cleanup
};
return cmd;
}

View File

@ -246,7 +246,6 @@ TALER_TESTING_cmd_status (const char *label,
const char *expected_balance,
unsigned int expected_response_code)
{
struct TALER_TESTING_Command cmd;
struct StatusState *ss;
ss = GNUNET_new (struct StatusState);
@ -254,10 +253,12 @@ TALER_TESTING_cmd_status (const char *label,
ss->expected_balance = expected_balance;
ss->expected_response_code = expected_response_code;
cmd.cls = ss;
cmd.label = label;
cmd.run = &status_run;
cmd.cleanup = &status_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = ss,
.label = label,
.run = &status_run,
.cleanup = &status_cleanup
};
return cmd;
}

View File

@ -418,7 +418,6 @@ TALER_TESTING_cmd_track_transaction
unsigned int expected_response_code,
const char *bank_transfer_reference)
{
struct TALER_TESTING_Command cmd;
struct TrackTransactionState *tts;
tts = GNUNET_new (struct TrackTransactionState);
@ -427,11 +426,13 @@ TALER_TESTING_cmd_track_transaction
tts->bank_transfer_reference = bank_transfer_reference;
tts->coin_index = coin_index;
cmd.cls = tts;
cmd.label = label;
cmd.run = &track_transaction_run;
cmd.cleanup = &track_transaction_cleanup;
cmd.traits = &track_transaction_traits;
struct TALER_TESTING_Command cmd = {
.cls = tts,
.label = label,
.run = &track_transaction_run,
.cleanup = &track_transaction_cleanup,
.traits = &track_transaction_traits
};
return cmd;
}
@ -744,7 +745,6 @@ TALER_TESTING_cmd_track_transfer_empty
unsigned int expected_response_code)
{
struct TrackTransferState *tts;
struct TALER_TESTING_Command cmd;
tts = GNUNET_new (struct TrackTransferState);
@ -752,10 +752,12 @@ TALER_TESTING_cmd_track_transfer_empty
tts->index = index;
tts->expected_response_code = expected_response_code;
cmd.cls = tts;
cmd.label = label;
cmd.run = &track_transfer_run;
cmd.cleanup = &track_transfer_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = tts,
.label = label,
.run = &track_transfer_run,
.cleanup = &track_transfer_cleanup
};
return cmd;
}
@ -786,7 +788,6 @@ TALER_TESTING_cmd_track_transfer
const char *expected_wire_fee)
{
struct TrackTransferState *tts;
struct TALER_TESTING_Command cmd;
tts = GNUNET_new (struct TrackTransferState);
@ -796,10 +797,12 @@ TALER_TESTING_cmd_track_transfer
tts->expected_total_amount = expected_total_amount;
tts->expected_wire_fee = expected_wire_fee;
cmd.cls = tts;
cmd.label = label;
cmd.run = &track_transfer_run;
cmd.cleanup = &track_transfer_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = tts,
.label = label,
.run = &track_transfer_run,
.cleanup = &track_transfer_cleanup
};
return cmd;
}

View File

@ -216,7 +216,6 @@ TALER_TESTING_cmd_wire (const char *label,
const char *expected_fee,
unsigned int expected_response_code)
{
struct TALER_TESTING_Command cmd;
struct WireState *ws;
ws = GNUNET_new (struct WireState);
@ -224,10 +223,12 @@ TALER_TESTING_cmd_wire (const char *label,
ws->expected_fee = expected_fee;
ws->expected_response_code = expected_response_code;
cmd.cls = ws;
cmd.label = label;
cmd.run = &wire_run;
cmd.cleanup = &wire_cleanup;
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &wire_run,
.cleanup = &wire_cleanup
};
return cmd;
}

View File

@ -412,7 +412,6 @@ TALER_TESTING_cmd_withdraw_amount
const char *amount,
unsigned int expected_response_code)
{
struct TALER_TESTING_Command cmd;
struct WithdrawState *ws;
ws = GNUNET_new (struct WithdrawState);
@ -431,11 +430,14 @@ TALER_TESTING_cmd_withdraw_amount
ws->expected_response_code = expected_response_code;
cmd.cls = ws;
cmd.label = label;
cmd.run = &withdraw_run;
cmd.cleanup = &withdraw_cleanup;
cmd.traits = &withdraw_traits;
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &withdraw_run,
.cleanup = &withdraw_cleanup,
.traits = &withdraw_traits
};
return cmd;
}
@ -460,7 +462,6 @@ TALER_TESTING_cmd_withdraw_denomination
const struct TALER_EXCHANGE_DenomPublicKey *dk,
unsigned int expected_response_code)
{
struct TALER_TESTING_Command cmd;
struct WithdrawState *ws;
if (NULL == dk)
@ -475,11 +476,14 @@ TALER_TESTING_cmd_withdraw_denomination
ws->pk = dk;
ws->expected_response_code = expected_response_code;
cmd.cls = ws;
cmd.label = label;
cmd.run = &withdraw_run;
cmd.cleanup = &withdraw_cleanup;
cmd.traits = &withdraw_traits;
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &withdraw_run,
.cleanup = &withdraw_cleanup,
.traits = &withdraw_traits
};
return cmd;
}