minor fixes
This commit is contained in:
parent
f3d80b58f6
commit
75ac6b8063
@ -419,7 +419,7 @@ TALER_BANK_history_range (struct GNUNET_CURL_Context *ctx,
|
|||||||
GNUNET_TIME_round_abs (&end_date);
|
GNUNET_TIME_round_abs (&end_date);
|
||||||
|
|
||||||
GNUNET_asprintf (&url,
|
GNUNET_asprintf (&url,
|
||||||
"/history?auth=basic&account_number=%llu&start=%llu&end=%llu&direction=%s&cancelled=%s&ordering=%s",
|
"/history-range?auth=basic&account_number=%llu&start=%llu&end=%llu&direction=%s&cancelled=%s&ordering=%s",
|
||||||
(unsigned long long) account_number,
|
(unsigned long long) account_number,
|
||||||
start_date.abs_value_us / 1000LL / 1000LL,
|
start_date.abs_value_us / 1000LL / 1000LL,
|
||||||
end_date.abs_value_us / 1000LL / 1000LL,
|
end_date.abs_value_us / 1000LL / 1000LL,
|
||||||
|
@ -76,7 +76,7 @@ run (void *cls,
|
|||||||
NULL, /* start */
|
NULL, /* start */
|
||||||
5),
|
5),
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
/**
|
/**
|
||||||
* Just a dummy call to check if the logic doesn't crash.
|
* Just a dummy call to check if the logic doesn't crash.
|
||||||
*/
|
*/
|
||||||
|
@ -354,7 +354,10 @@ build_history (struct TALER_TESTING_Interpreter *is,
|
|||||||
(add_incoming_cmd, 0, &row_id_start));
|
(add_incoming_cmd, 0, &row_id_start));
|
||||||
}
|
}
|
||||||
|
|
||||||
GNUNET_assert (0 != hs->num_results);
|
GNUNET_assert ((0 != hs->num_results) ||
|
||||||
|
(GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us !=
|
||||||
|
hs->start_date.abs_value_us));
|
||||||
|
|
||||||
if (0 == is->ip)
|
if (0 == is->ip)
|
||||||
{
|
{
|
||||||
*rh = NULL;
|
*rh = NULL;
|
||||||
@ -784,9 +787,8 @@ history_cb (void *cls,
|
|||||||
struct TALER_TESTING_Interpreter *is = cls;
|
struct TALER_TESTING_Interpreter *is = cls;
|
||||||
struct HistoryState *hs = is->commands[is->ip].cls;
|
struct HistoryState *hs = is->commands[is->ip].cls;
|
||||||
|
|
||||||
/* Possibly we got the 204 status code
|
/*NOTE: "204 No Content" is used to signal the end of results.*/
|
||||||
* as a "end of list" marker. */
|
if (MHD_HTTP_NO_CONTENT == http_status)
|
||||||
if (MHD_HTTP_OK != http_status)
|
|
||||||
{
|
{
|
||||||
hs->hh = NULL;
|
hs->hh = NULL;
|
||||||
if ( (hs->results_obtained != compute_result_count (is)) ||
|
if ( (hs->results_obtained != compute_result_count (is)) ||
|
||||||
@ -813,6 +815,19 @@ history_cb (void *cls,
|
|||||||
TALER_TESTING_interpreter_next (is);
|
TALER_TESTING_interpreter_next (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MHD_HTTP_OK != http_status)
|
||||||
|
{
|
||||||
|
hs->hh = NULL;
|
||||||
|
GNUNET_log
|
||||||
|
(GNUNET_ERROR_TYPE_ERROR,
|
||||||
|
"Unwanted response code from /history[-range]: %u\n",
|
||||||
|
http_status);
|
||||||
|
TALER_TESTING_interpreter_fail (is);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check current element */
|
||||||
if (GNUNET_OK != check_result (is,
|
if (GNUNET_OK != check_result (is,
|
||||||
hs->results_obtained,
|
hs->results_obtained,
|
||||||
dir,
|
dir,
|
||||||
@ -1065,11 +1080,6 @@ TALER_TESTING_cmd_bank_history
|
|||||||
* @param end_row_reference reference to a command that can
|
* @param end_row_reference reference to a command that can
|
||||||
* offer a absolute time to use as the 'end' argument
|
* offer a absolute time to use as the 'end' argument
|
||||||
* for "/history-range".
|
* for "/history-range".
|
||||||
* @param num_results how many results we want from the bank; NOTE,
|
|
||||||
* this value is NOT used to issue any "delta" parameter in
|
|
||||||
* the HTTP request. Rather, it is only checked against
|
|
||||||
* the results returned by the bank.
|
|
||||||
*
|
|
||||||
* @return the command.
|
* @return the command.
|
||||||
*/
|
*/
|
||||||
struct TALER_TESTING_Command
|
struct TALER_TESTING_Command
|
||||||
@ -1080,8 +1090,7 @@ TALER_TESTING_cmd_bank_history_range
|
|||||||
enum TALER_BANK_Direction direction,
|
enum TALER_BANK_Direction direction,
|
||||||
unsigned int ascending,
|
unsigned int ascending,
|
||||||
const char *start_row_reference,
|
const char *start_row_reference,
|
||||||
const char *end_row_reference,
|
const char *end_row_reference)
|
||||||
long long num_results)
|
|
||||||
{
|
{
|
||||||
struct HistoryState *hs;
|
struct HistoryState *hs;
|
||||||
|
|
||||||
@ -1091,7 +1100,6 @@ TALER_TESTING_cmd_bank_history_range
|
|||||||
hs->direction = direction;
|
hs->direction = direction;
|
||||||
hs->start_row_reference = start_row_reference;
|
hs->start_row_reference = start_row_reference;
|
||||||
hs->end_row_reference = end_row_reference;
|
hs->end_row_reference = end_row_reference;
|
||||||
hs->num_results = num_results;
|
|
||||||
hs->ascending = ascending;
|
hs->ascending = ascending;
|
||||||
hs->start_date = GNUNET_TIME_UNIT_FOREVER_ABS;
|
hs->start_date = GNUNET_TIME_UNIT_FOREVER_ABS;
|
||||||
hs->end_date = GNUNET_TIME_UNIT_FOREVER_ABS;
|
hs->end_date = GNUNET_TIME_UNIT_FOREVER_ABS;
|
||||||
@ -1122,11 +1130,6 @@ TALER_TESTING_cmd_bank_history_range
|
|||||||
* of "/history-range".
|
* of "/history-range".
|
||||||
* @param end_date value for the 'end' argument
|
* @param end_date value for the 'end' argument
|
||||||
* of "/history-range".
|
* of "/history-range".
|
||||||
* @param num_results how many results we want from the bank; NOTE,
|
|
||||||
* this value is NOT used to issue any "delta" parameter in
|
|
||||||
* the HTTP request. Rather, it is only checked against
|
|
||||||
* the results returned by the bank.
|
|
||||||
*
|
|
||||||
* @return the command.
|
* @return the command.
|
||||||
*/
|
*/
|
||||||
struct TALER_TESTING_Command
|
struct TALER_TESTING_Command
|
||||||
@ -1137,8 +1140,7 @@ TALER_TESTING_cmd_bank_history_range_with_dates
|
|||||||
enum TALER_BANK_Direction direction,
|
enum TALER_BANK_Direction direction,
|
||||||
unsigned int ascending,
|
unsigned int ascending,
|
||||||
struct GNUNET_TIME_Absolute start_date,
|
struct GNUNET_TIME_Absolute start_date,
|
||||||
struct GNUNET_TIME_Absolute end_date,
|
struct GNUNET_TIME_Absolute end_date)
|
||||||
long long num_results)
|
|
||||||
{
|
{
|
||||||
struct HistoryState *hs;
|
struct HistoryState *hs;
|
||||||
|
|
||||||
@ -1146,7 +1148,6 @@ TALER_TESTING_cmd_bank_history_range_with_dates
|
|||||||
hs->bank_url = bank_url;
|
hs->bank_url = bank_url;
|
||||||
hs->account_no = account_no;
|
hs->account_no = account_no;
|
||||||
hs->direction = direction;
|
hs->direction = direction;
|
||||||
hs->num_results = num_results;
|
|
||||||
hs->ascending = ascending;
|
hs->ascending = ascending;
|
||||||
hs->start_date = start_date;
|
hs->start_date = start_date;
|
||||||
hs->end_date = start_date;
|
hs->end_date = start_date;
|
||||||
|
@ -124,10 +124,6 @@ TALER_TESTING_cmd_bank_history
|
|||||||
* of "/history-range".
|
* of "/history-range".
|
||||||
* @param end_date value for the 'end' argument
|
* @param end_date value for the 'end' argument
|
||||||
* of "/history-range".
|
* of "/history-range".
|
||||||
* @param num_results how many results we want from the bank; NOTE,
|
|
||||||
* this value is NOT used to issue any "delta" parameter in
|
|
||||||
* the HTTP request. Rather, it is only checked against
|
|
||||||
* the results returned by the bank.
|
|
||||||
* @return the command.
|
* @return the command.
|
||||||
*/
|
*/
|
||||||
struct TALER_TESTING_Command
|
struct TALER_TESTING_Command
|
||||||
@ -138,8 +134,7 @@ TALER_TESTING_cmd_bank_history_range_with_dates
|
|||||||
enum TALER_BANK_Direction direction,
|
enum TALER_BANK_Direction direction,
|
||||||
unsigned int ascending,
|
unsigned int ascending,
|
||||||
struct GNUNET_TIME_Absolute start_date,
|
struct GNUNET_TIME_Absolute start_date,
|
||||||
struct GNUNET_TIME_Absolute end_date,
|
struct GNUNET_TIME_Absolute end_date);
|
||||||
long long num_results);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -158,11 +153,6 @@ TALER_TESTING_cmd_bank_history_range_with_dates
|
|||||||
* @param end_row_reference reference to a command that can
|
* @param end_row_reference reference to a command that can
|
||||||
* offer a absolute time to use as the 'end' argument
|
* offer a absolute time to use as the 'end' argument
|
||||||
* for "/history-range".
|
* for "/history-range".
|
||||||
* @param num_results how many results we want from the bank; NOTE,
|
|
||||||
* this value is NOT used to issue any "delta" parameter in
|
|
||||||
* the HTTP request. Rather, it is only checked against
|
|
||||||
* the results returned by the bank.
|
|
||||||
*
|
|
||||||
* @return the command.
|
* @return the command.
|
||||||
*/
|
*/
|
||||||
struct TALER_TESTING_Command
|
struct TALER_TESTING_Command
|
||||||
@ -173,8 +163,7 @@ TALER_TESTING_cmd_bank_history_range
|
|||||||
enum TALER_BANK_Direction direction,
|
enum TALER_BANK_Direction direction,
|
||||||
unsigned int ascending,
|
unsigned int ascending,
|
||||||
const char *start_row_reference,
|
const char *start_row_reference,
|
||||||
const char *end_row_reference,
|
const char *end_row_reference);
|
||||||
long long num_results);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user