diff options
-rw-r--r-- | src/include/taler_testing_lib.h | 10 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_serialize_keys.c | 22 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_stat.c | 6 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_status.c | 9 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_transfer_get.c | 65 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_twister_exec_client.c | 270 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_withdraw.c | 31 | ||||
-rw-r--r-- | src/testing/testing_api_loop.c | 5 |
8 files changed, 135 insertions, 283 deletions
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 0a02fdb8b..9b82508ce 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -1555,7 +1555,6 @@ TALER_TESTING_cmd_refresh_link_with_retry (struct TALER_TESTING_Command cmd); * @param bank_transfer_reference reference to a command that * can offer a WTID so as to check that against what WTID * the tracked operation has. Set as NULL if not needed. - * * @return the command. */ struct TALER_TESTING_Command @@ -1576,15 +1575,12 @@ TALER_TESTING_cmd_track_transaction (const char *label, * a wtid. If NULL is given, then a all zeroed WTID is * used that will at 99.9999% probability NOT match any * existing WTID known to the exchange. - * @param index index number of the WTID to track, in case there - * are multiple on offer. * @param expected_response_code expected HTTP response code. * @return the command. */ struct TALER_TESTING_Command TALER_TESTING_cmd_track_transfer_empty (const char *label, const char *wtid_reference, - unsigned int index, unsigned int expected_response_code); @@ -1595,8 +1591,6 @@ TALER_TESTING_cmd_track_transfer_empty (const char *label, * @param label the command label. * @param wtid_reference reference to any command which can provide * a wtid. Will be the one tracked. - * @param index in case there are multiple WTID offered, this - * parameter selects a particular one. * @param expected_response_code expected HTTP response code. * @param expected_total_amount how much money we expect being moved * with this wire-transfer. @@ -1606,11 +1600,11 @@ TALER_TESTING_cmd_track_transfer_empty (const char *label, struct TALER_TESTING_Command TALER_TESTING_cmd_track_transfer (const char *label, const char *wtid_reference, - unsigned int index, unsigned int expected_response_code, const char *expected_total_amount, const char *expected_wire_fee); + /** * Make a "bank check" CMD. It checks whether a particular wire transfer from * the exchange (debit) has been made or not. @@ -2283,7 +2277,7 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits, } \ struct TALER_TESTING_Trait \ TALER_TESTING_make_trait_ ## name ( \ - const type * value) \ + type * value) \ { \ struct TALER_TESTING_Trait ret = { \ .trait_name = TALER_S (name), \ diff --git a/src/testing/testing_api_cmd_serialize_keys.c b/src/testing/testing_api_cmd_serialize_keys.c index 82df0f064..d3b34a934 100644 --- a/src/testing/testing_api_cmd_serialize_keys.c +++ b/src/testing/testing_api_cmd_serialize_keys.c @@ -131,7 +131,7 @@ serialize_keys_cleanup (void *cls, * @param index index number of the object to offer. * @return #GNUNET_OK on success. */ -static int +static enum GNUNET_GenericReturnValue serialize_keys_traits (void *cls, const void **ret, const char *trait, @@ -139,9 +139,9 @@ serialize_keys_traits (void *cls, { struct SerializeKeysState *sks = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_exchange_keys (0, sks->keys), - TALER_TESTING_make_trait_url (TALER_TESTING_UT_EXCHANGE_BASE_URL, - sks->exchange_url), + TALER_TESTING_make_trait_exchange_keys (sks->keys), + TALER_TESTING_make_trait_exchange_url ( + (const char **) &sks->exchange_url), TALER_TESTING_trait_end () }; @@ -167,7 +167,7 @@ connect_with_state_run (void *cls, struct ConnectWithStateState *cwss = cls; const struct TALER_TESTING_Command *state_cmd; const json_t *serialized_keys; - const char *exchange_url; + const char **exchange_url; /* This command usually gets rescheduled after serialized * reconnection. */ @@ -178,8 +178,8 @@ connect_with_state_run (void *cls, } cwss->is = is; - state_cmd = TALER_TESTING_interpreter_lookup_command - (is, cwss->state_reference); + state_cmd = TALER_TESTING_interpreter_lookup_command (is, + cwss->state_reference); /* Command providing serialized keys not found. */ if (NULL == state_cmd) @@ -191,7 +191,6 @@ connect_with_state_run (void *cls, GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_exchange_keys (state_cmd, - 0, &serialized_keys)); { char *dump; @@ -204,11 +203,10 @@ connect_with_state_run (void *cls, } GNUNET_assert (GNUNET_OK == - TALER_TESTING_get_trait_url (state_cmd, - TALER_TESTING_UT_EXCHANGE_BASE_URL, - &exchange_url)); + TALER_TESTING_get_trait_exchange_url (state_cmd, + &exchange_url)); is->exchange = TALER_EXCHANGE_connect (is->ctx, - exchange_url, + *exchange_url, &TALER_TESTING_cert_cb, cwss, TALER_EXCHANGE_OPTION_DATA, diff --git a/src/testing/testing_api_cmd_stat.c b/src/testing/testing_api_cmd_stat.c index d74e9bb2c..5d41c05c9 100644 --- a/src/testing/testing_api_cmd_stat.c +++ b/src/testing/testing_api_cmd_stat.c @@ -83,7 +83,7 @@ do_stat (struct TALER_TESTING_Timer *timings, { if (TALER_TESTING_cmd_is_batch (cmd)) { - struct TALER_TESTING_Command *bcmd; + struct TALER_TESTING_Command **bcmd; if (GNUNET_OK != TALER_TESTING_get_trait_batch_cmds (cmd, @@ -94,10 +94,10 @@ do_stat (struct TALER_TESTING_Timer *timings, } for (unsigned int j = 0; - NULL != bcmd[j].label; + NULL != (*bcmd)[j].label; j++) do_stat (timings, - &bcmd[j]); + &(*bcmd)[j]); } else { diff --git a/src/testing/testing_api_cmd_status.c b/src/testing/testing_api_cmd_status.c index 1dba675b3..8fdfa461c 100644 --- a/src/testing/testing_api_cmd_status.c +++ b/src/testing/testing_api_cmd_status.c @@ -156,7 +156,7 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, if (TALER_TESTING_cmd_is_batch (cmd)) { struct TALER_TESTING_Command *cur; - struct TALER_TESTING_Command *bcmd; + struct TALER_TESTING_Command **bcmd; cur = TALER_TESTING_cmd_batch_get_current (cmd); if (GNUNET_OK != @@ -166,9 +166,9 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, GNUNET_break (0); return GNUNET_SYSERR; } - for (unsigned int i = 0; NULL != bcmd[i].label; i++) + for (unsigned int i = 0; NULL != (*bcmd)[i].label; i++) { - struct TALER_TESTING_Command *step = &bcmd[i]; + struct TALER_TESTING_Command *step = &(*bcmd)[i]; if (step == cur) break; /* if *we* are in a batch, make sure not to analyze commands past 'now' */ @@ -189,7 +189,6 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, if (GNUNET_OK != TALER_TESTING_get_trait_reserve_pub (cmd, - 0, &rp)) return GNUNET_OK; /* command does nothing for reserves */ if (0 != @@ -198,7 +197,6 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, return GNUNET_OK; /* command affects some _other_ reserve */ if (GNUNET_OK != TALER_TESTING_get_trait_reserve_history (cmd, - 0, &he)) { /* NOTE: only for debugging... */ @@ -344,7 +342,6 @@ status_run (void *cls, } if (GNUNET_OK != TALER_TESTING_get_trait_reserve_pub (create_reserve, - 0, &ss->reserve_pubp)) { GNUNET_break (0); diff --git a/src/testing/testing_api_cmd_transfer_get.c b/src/testing/testing_api_cmd_transfer_get.c index 3ca319cb5..10a9d8261 100644 --- a/src/testing/testing_api_cmd_transfer_get.c +++ b/src/testing/testing_api_cmd_transfer_get.c @@ -79,11 +79,6 @@ struct TrackTransferState */ unsigned int expected_response_code; - /** - * Index to the WTID to pick, in case @a wtid_reference has - * many on offer. - */ - unsigned int index; }; @@ -219,11 +214,12 @@ track_transfer_cb (void *cls, * or any operation that could provide wire-details. (2) * Total amount for this transfer matches the one from any * referenced command that could provide one. - */if (NULL != tts->wire_details_reference) + */ + if (NULL != tts->wire_details_reference) { const struct TALER_TESTING_Command *wire_details_cmd; const json_t *wire_details; - struct GNUNET_HashCode h_wire_details; + struct TALER_MerchantWireHash h_wire_details; wire_details_cmd = TALER_TESTING_interpreter_lookup_command (is, @@ -236,7 +232,6 @@ track_transfer_cb (void *cls, } if (GNUNET_OK != TALER_TESTING_get_trait_wire_details (wire_details_cmd, - 0, &wire_details)) { GNUNET_break (0); @@ -274,9 +269,8 @@ track_transfer_cb (void *cls, return; } if (GNUNET_OK != - TALER_TESTING_get_trait_amount_obj (total_amount_cmd, - 0, - &total_amount_from_reference)) + TALER_TESTING_get_trait_amount (total_amount_cmd, + &total_amount_from_reference)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (is); @@ -319,7 +313,9 @@ track_transfer_run (void *cls, /* If no reference is given, we'll use a all-zeros * WTID */ - memset (&wtid, 0, sizeof (wtid)); + memset (&wtid, + 0, + sizeof (wtid)); wtid_ptr = &wtid; tts->is = is; @@ -327,9 +323,8 @@ track_transfer_run (void *cls, { const struct TALER_TESTING_Command *wtid_cmd; - wtid_cmd = TALER_TESTING_interpreter_lookup_command - (tts->is, tts->wtid_reference); - + wtid_cmd = TALER_TESTING_interpreter_lookup_command (tts->is, + tts->wtid_reference); if (NULL == wtid_cmd) { GNUNET_break (0); @@ -337,8 +332,9 @@ track_transfer_run (void *cls, return; } - if (GNUNET_OK != TALER_TESTING_get_trait_wtid - (wtid_cmd, tts->index, &wtid_ptr)) + if (GNUNET_OK != + TALER_TESTING_get_trait_wtid (wtid_cmd, + &wtid_ptr)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (tts->is); @@ -354,33 +350,15 @@ track_transfer_run (void *cls, } -/** - * Make a "track transfer" CMD where no "expected"-arguments, - * except the HTTP response code, are given. The best use case - * is when what matters to check is the HTTP response code, e.g. - * when a bogus WTID was passed. - * - * @param label the command label - * @param wtid_reference reference to any command which can provide - * a wtid. If NULL is given, then a all zeroed WTID is - * used that will at 99.9999% probability NOT match any - * existing WTID known to the exchange. - * @param index index number of the WTID to track, in case there - * are multiple on offer. - * @param expected_response_code expected HTTP response code. - * @return the command. - */ struct TALER_TESTING_Command TALER_TESTING_cmd_track_transfer_empty (const char *label, const char *wtid_reference, - unsigned int index, unsigned int expected_response_code) { struct TrackTransferState *tts; tts = GNUNET_new (struct TrackTransferState); tts->wtid_reference = wtid_reference; - tts->index = index; tts->expected_response_code = expected_response_code; { struct TALER_TESTING_Command cmd = { @@ -395,25 +373,9 @@ TALER_TESTING_cmd_track_transfer_empty (const char *label, } -/** - * Make a "track transfer" command, specifying which amount and - * wire fee are expected. - * - * @param label the command label. - * @param wtid_reference reference to any command which can provide - * a wtid. Will be the one tracked. - * @param index in case there are multiple WTID offered, this - * parameter selects a particular one. - * @param expected_response_code expected HTTP response code. - * @param expected_total_amount how much money we expect being moved - * with this wire-transfer. - * @param expected_wire_fee expected wire fee. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_track_transfer (const char *label, const char *wtid_reference, - unsigned int index, unsigned int expected_response_code, const char *expected_total_amount, const char *expected_wire_fee) @@ -422,7 +384,6 @@ TALER_TESTING_cmd_track_transfer (const char *label, tts = GNUNET_new (struct TrackTransferState); tts->wtid_reference = wtid_reference; - tts->index = index; tts->expected_response_code = expected_response_code; tts->expected_total_amount = expected_total_amount; tts->expected_wire_fee = expected_wire_fee; diff --git a/src/testing/testing_api_cmd_twister_exec_client.c b/src/testing/testing_api_cmd_twister_exec_client.c index b3903f29a..d1d781f5a 100644 --- a/src/testing/testing_api_cmd_twister_exec_client.c +++ b/src/testing/testing_api_cmd_twister_exec_client.c @@ -194,7 +194,7 @@ hack_response_code_cleanup * @param index index number of the object to offer. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue hack_response_code_traits (void *cls, const void **ret, const char *trait, @@ -203,7 +203,7 @@ hack_response_code_traits (void *cls, struct HackResponseCodeState *hrcs = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, &hrcs->proc), + TALER_TESTING_make_trait_process (&hrcs->proc), TALER_TESTING_trait_end () }; @@ -251,16 +251,6 @@ hack_response_code_run (void *cls, } -/** - * Define a "hack response code" CMD. This causes the next - * response code (from the service proxied by the twister) to - * be substituted with @a http_status. - * - * @param label command label - * @param config_filename configuration filename. - * @param http_status new response code to use - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_hack_response_code (const char *label, const char *config_filename, @@ -271,16 +261,17 @@ TALER_TESTING_cmd_hack_response_code (const char *label, hrcs = GNUNET_new (struct HackResponseCodeState); hrcs->http_status = http_status; hrcs->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &hack_response_code_run, - .cleanup = &hack_response_code_cleanup, - .traits = &hack_response_code_traits, - .cls = hrcs - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &hack_response_code_run, + .cleanup = &hack_response_code_cleanup, + .traits = &hack_response_code_traits, + .cls = hrcs + }; + + return cmd; + } } @@ -320,7 +311,7 @@ delete_object_cleanup * @param index index number of the object to offer. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue delete_object_traits (void *cls, const void **ret, const char *trait, @@ -329,7 +320,7 @@ delete_object_traits (void *cls, struct DeleteObjectState *dos = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, &dos->proc), + TALER_TESTING_make_trait_process (&dos->proc), TALER_TESTING_trait_end () }; @@ -379,9 +370,8 @@ delete_object_run (void *cls, * @param cmd the command being cleaned up. */ static void -modify_object_cleanup - (void *cls, - const struct TALER_TESTING_Command *cmd) +modify_object_cleanup (void *cls, + const struct TALER_TESTING_Command *cmd) { struct ModifyObjectState *mos = cls; @@ -407,7 +397,7 @@ modify_object_cleanup * @param index index number of the object to offer. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue modify_object_traits (void *cls, const void **ret, const char *trait, @@ -416,7 +406,7 @@ modify_object_traits (void *cls, struct ModifyObjectState *mos = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, &mos->proc), + TALER_TESTING_make_trait_process (&mos->proc), TALER_TESTING_trait_end () }; @@ -523,16 +513,6 @@ modify_header_dl_run (void *cls, } -/** - * Create a "delete object" CMD. This command deletes - * the JSON object pointed by @a path. - * - * @param label command label - * @param config_filename configuration filename. - * @param path object-like path notation to point the object - * to delete. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_delete_object (const char *label, const char *config_filename, @@ -598,10 +578,9 @@ flip_object_traits (void *cls, const char *trait, unsigned int index) { - struct FlipObjectState *fos = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, &fos->proc), + TALER_TESTING_make_trait_process (&fos->proc), TALER_TESTING_trait_end () }; @@ -674,15 +653,6 @@ flip_download_run (void *cls, } -/** - * Define a "flip object" command, for objects to upload. - * - * @param label command label - * @param config_filename configuration filename. - * @param path object-like path notation to point the object - * to flip. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_flip_upload (const char *label, const char *config_filename, @@ -693,28 +663,20 @@ TALER_TESTING_cmd_flip_upload (const char *label, dos = GNUNET_new (struct FlipObjectState); dos->path = path; dos->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &flip_upload_run, - .cleanup = &flip_object_cleanup, - .traits = &flip_object_traits, - .cls = dos - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &flip_upload_run, + .cleanup = &flip_object_cleanup, + .traits = &flip_object_traits, + .cls = dos + }; + + return cmd; + } } -/** - * Define a "flip object" command, for objects to download. - * - * @param label command label - * @param config_filename configuration filename. - * @param path object-like path notation to point the object - * to flip. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_flip_download (const char *label, const char *config_filename, @@ -725,16 +687,17 @@ TALER_TESTING_cmd_flip_download (const char *label, dos = GNUNET_new (struct FlipObjectState); dos->path = path; dos->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &flip_download_run, - .cleanup = &flip_object_cleanup, - .traits = &flip_object_traits, - .cls = dos - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &flip_download_run, + .cleanup = &flip_object_cleanup, + .traits = &flip_object_traits, + .cls = dos + }; + + return cmd; + } } @@ -773,7 +736,7 @@ malform_request_cleanup (void *cls, * @param index index number of the object to offer. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue malform_request_traits (void *cls, const void **ret, const char *trait, @@ -781,7 +744,7 @@ malform_request_traits (void *cls, { struct MalformRequestState *mrs = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, &mrs->proc), + TALER_TESTING_make_trait_process (&mrs->proc), TALER_TESTING_trait_end () }; @@ -831,9 +794,8 @@ malform_request_run (void *cls, * @param cmd the command being cleaned up. */ static void -malform_response_cleanup - (void *cls, - const struct TALER_TESTING_Command *cmd) +malform_response_cleanup (void *cls, + const struct TALER_TESTING_Command *cmd) { struct MalformResponseState *mrs = cls; @@ -859,7 +821,7 @@ malform_response_cleanup * @param index index number of the object to offer. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue malform_response_traits (void *cls, const void **ret, const char *trait, @@ -867,7 +829,7 @@ malform_response_traits (void *cls, { struct MalformResponseState *mrs = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, &mrs->proc), + TALER_TESTING_make_trait_process (&mrs->proc), TALER_TESTING_trait_end () }; @@ -909,14 +871,6 @@ malform_response_run (void *cls, } -/** - * Create a "malform request" CMD. This command makes the - * next request randomly malformed (by truncating it). - * - * @param label command label - * @param config_filename configuration filename. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_malform_request (const char *label, const char *config_filename) @@ -925,28 +879,20 @@ TALER_TESTING_cmd_malform_request (const char *label, mrs = GNUNET_new (struct MalformRequestState); mrs->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &malform_request_run, - .cleanup = &malform_request_cleanup, - .traits = &malform_request_traits, - .cls = mrs - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &malform_request_run, + .cleanup = &malform_request_cleanup, + .traits = &malform_request_traits, + .cls = mrs + }; + + return cmd; + } } -/** - * Create a "malform response" CMD. This command makes - * the next response randomly malformed (by truncating it). - * - * @param label command label - * @param config_filename configuration filename. - * - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_malform_response (const char *label, const char *config_filename) @@ -969,19 +915,6 @@ TALER_TESTING_cmd_malform_response (const char *label, } -/** - * Create a "modify object" CMD. This command instructs - * the twister to modify the next object that is downloaded - * from the proxied service. - * - * @param label command label - * @param config_filename configuration filename. - * @param path object-like path notation to point the object - * to modify. - * @param value value to put as the object's. - * - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_modify_object_dl (const char *label, const char *config_filename, @@ -994,31 +927,20 @@ TALER_TESTING_cmd_modify_object_dl (const char *label, mos->path = path; mos->value = value; mos->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &modify_object_dl_run, - .cleanup = &modify_object_cleanup, - .traits = &modify_object_traits, - .cls = mos - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &modify_object_dl_run, + .cleanup = &modify_object_cleanup, + .traits = &modify_object_traits, + .cls = mos + }; + + return cmd; + } } -/** - * Create a "modify object" CMD. This command instructs - * the twister to modify the next object that will be uploaded - * to the proxied service. - * - * @param label command label - * @param config_filename configuration filename. - * @param path object-like path notation pointing the object - * to modify. - * @param value value to put as the object's. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_modify_object_ul (const char *label, const char *config_filename, @@ -1031,29 +953,20 @@ TALER_TESTING_cmd_modify_object_ul (const char *label, mos->path = path; mos->value = value; mos->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &modify_object_ul_run, - .cleanup = &modify_object_cleanup, - .traits = &modify_object_traits, - .cls = mos - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &modify_object_ul_run, + .cleanup = &modify_object_cleanup, + .traits = &modify_object_traits, + .cls = mos + }; + + return cmd; + } } -/** - * Create a "modify header" CMD. This command instructs - * the twister to modify a header in the next HTTP response. - * - * @param label command label - * @param config_filename configuration filename. - * @param path identifies the location to modify - * @param value value to set the header to. - * @return the command - */ struct TALER_TESTING_Command TALER_TESTING_cmd_modify_header_dl (const char *label, const char *config_filename, @@ -1066,16 +979,17 @@ TALER_TESTING_cmd_modify_header_dl (const char *label, mos->path = path; mos->value = value; mos->config_filename = config_filename; - - struct TALER_TESTING_Command cmd = { - .label = label, - .run = &modify_header_dl_run, - .cleanup = &modify_object_cleanup, - .traits = &modify_object_traits, - .cls = mos - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .label = label, + .run = &modify_header_dl_run, + .cleanup = &modify_object_cleanup, + .traits = &modify_object_traits, + .cls = mos + }; + + return cmd; + } } diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c index 23beb6065..aa77cb1e1 100644 --- a/src/testing/testing_api_cmd_withdraw.c +++ b/src/testing/testing_api_cmd_withdraw.c @@ -240,8 +240,8 @@ reserve_withdraw_cb (void *cls, switch (wr->hr.http_status) { case MHD_HTTP_OK: - ws->sig.rsa_signature = GNUNET_CRYPTO_rsa_signature_dup ( - wr->details.success.sig.rsa_signature); + TALER_denom_sig_deep_copy (&ws->sig, + &wr->details.success.sig); if (0 != ws->total_backoff.rel_value_us) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -349,7 +349,6 @@ withdraw_run (void *cls, } if (GNUNET_OK != TALER_TESTING_get_trait_reserve_priv (create_reserve, - 0, &rp)) { GNUNET_break (0); @@ -451,11 +450,7 @@ withdraw_cleanup (void *cls, GNUNET_SCHEDULER_cancel (ws->retry_task); ws->retry_task = NULL; } - if (NULL != ws->sig.rsa_signature) - { - GNUNET_CRYPTO_rsa_signature_free (ws->sig.rsa_signature); - ws->sig.rsa_signature = NULL; - } + TALER_denom_sig_free (&ws->sig); if (NULL != ws->pk) { TALER_EXCHANGE_destroy_denomination_key (ws->pk); @@ -476,7 +471,7 @@ withdraw_cleanup (void *cls, * @param index index number of the object to offer. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue withdraw_traits (void *cls, const void **ret, const char *trait, @@ -501,7 +496,6 @@ withdraw_traits (void *cls, if (GNUNET_OK != TALER_TESTING_get_trait_reserve_priv (reserve_cmd, - 0, &reserve_priv)) { GNUNET_break (0); @@ -510,7 +504,6 @@ withdraw_traits (void *cls, } if (GNUNET_OK != TALER_TESTING_get_trait_reserve_pub (reserve_cmd, - 0, &reserve_pub)) { GNUNET_break (0); @@ -523,8 +516,7 @@ withdraw_traits (void *cls, { struct TALER_TESTING_Trait traits[] = { /* history entry MUST be first due to response code logic below! */ - TALER_TESTING_make_trait_reserve_history (0, - &ws->reserve_history), + TALER_TESTING_make_trait_reserve_history (&ws->reserve_history), TALER_TESTING_make_trait_coin_priv (0 /* only one coin */, &ws->ps.coin_priv), TALER_TESTING_make_trait_blinding_key (0 /* only one coin */, @@ -533,14 +525,11 @@ withdraw_traits (void *cls, ws->pk), TALER_TESTING_make_trait_denom_sig (0 /* only one coin */, &ws->sig), - TALER_TESTING_make_trait_reserve_priv (0, - reserve_priv), - TALER_TESTING_make_trait_reserve_pub (0, - reserve_pub), - TALER_TESTING_make_trait_amount_obj (0, - &ws->amount), - TALER_TESTING_make_trait_url (TALER_TESTING_UT_EXCHANGE_BASE_URL, - ws->exchange_url), + TALER_TESTING_make_trait_reserve_priv (reserve_priv), + TALER_TESTING_make_trait_reserve_pub (reserve_pub), + TALER_TESTING_make_trait_amount (&ws->amount), + TALER_TESTING_make_trait_exchange_url ( + (const char **) &ws->exchange_url), TALER_TESTING_trait_end () }; diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index 0de4230ea..f86c7765b 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c @@ -66,7 +66,7 @@ TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is, if (TALER_TESTING_cmd_is_batch (cmd)) { - struct TALER_TESTING_Command *batch; + struct TALER_TESTING_Command **batch; struct TALER_TESTING_Command *current; struct TALER_TESTING_Command *icmd; const struct TALER_TESTING_Command *match; @@ -78,7 +78,7 @@ TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is, /* We must do the loop forward, but we can find the last match */ match = NULL; for (unsigned int j = 0; - NULL != (icmd = &batch[j])->label; + NULL != (icmd = &(*batch)[j])->label; j++) { if (current == icmd) @@ -381,7 +381,6 @@ maint_child_death (void *cls) sizeof (c))); if (GNUNET_OK != TALER_TESTING_get_trait_process (cmd, - 0, &processp)) { GNUNET_break (0); |