summaryrefslogtreecommitdiff
path: root/src/pq
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-15 14:46:03 +0200
committerChristian Grothoff <christian@grothoff.org>2015-05-15 14:46:03 +0200
commit85f198ef32012b02d72a7e4af2924f69b6625f73 (patch)
tree6cd703901b84a51dbf293a98e61331ca426c2597 /src/pq
parent955054bf25222be9c3942f695e74c8195627405c (diff)
downloadexchange-85f198ef32012b02d72a7e4af2924f69b6625f73.tar.gz
exchange-85f198ef32012b02d72a7e4af2924f69b6625f73.tar.bz2
exchange-85f198ef32012b02d72a7e4af2924f69b6625f73.zip
getting test to pass
Diffstat (limited to 'src/pq')
-rw-r--r--src/pq/db_pq.c4
-rw-r--r--src/pq/pq_helper.c4
-rw-r--r--src/pq/test_pq.c11
3 files changed, 4 insertions, 15 deletions
diff --git a/src/pq/db_pq.c b/src/pq/db_pq.c
index 3b39645a..bb18c56a 100644
--- a/src/pq/db_pq.c
+++ b/src/pq/db_pq.c
@@ -178,8 +178,6 @@ TALER_PQ_exec_prepared (PGconn *db_conn,
at_nbo = GNUNET_new (struct GNUNET_TIME_AbsoluteNBO);
scratch[soff++] = at_nbo;
- /* FIXME: this does not work for 'forever' as PQ uses 63-bit integers;
- should check and handle! (Need testcase!) */
*at_nbo = GNUNET_TIME_absolute_hton (*at_hbo);
param_values[off] = (void *) at_nbo;
param_lengths[off] = sizeof (struct GNUNET_TIME_AbsoluteNBO);
@@ -537,8 +535,6 @@ TALER_PQ_extract_result (PGresult *result,
PQgetvalue (result,
row,
fnum);
- /* FIXME: this does not work for 'forever' as PQ uses 63-bit integers;
- should check and handle! (Need testcase!) */
*dst = GNUNET_TIME_absolute_ntoh (*res);
break;
}
diff --git a/src/pq/pq_helper.c b/src/pq/pq_helper.c
index 9cbdc54b..98c02de7 100644
--- a/src/pq/pq_helper.c
+++ b/src/pq/pq_helper.c
@@ -99,10 +99,10 @@ TALER_PQ_QUERY_PARAM_RSA_SIGNATURE (const struct GNUNET_CRYPTO_rsa_Signature *x)
* @return array entry for the query parameters to use
*/
struct TALER_PQ_QueryParam
-TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (struct GNUNET_TIME_Absolute x)
+TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (const struct GNUNET_TIME_Absolute *x)
{
struct TALER_PQ_QueryParam res =
- { TALER_PQ_QF_TIME_ABSOLUTE, &(x), sizeof (x) };
+ { TALER_PQ_QF_TIME_ABSOLUTE, x, sizeof (*x) };
return res;
}
diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c
index 7146281e..d3417111 100644
--- a/src/pq/test_pq.c
+++ b/src/pq/test_pq.c
@@ -129,8 +129,8 @@ run_queries (PGconn *conn)
struct TALER_PQ_QueryParam params_insert[] = {
TALER_PQ_QUERY_PARAM_RSA_PUBLIC_KEY (pub),
TALER_PQ_QUERY_PARAM_RSA_SIGNATURE (sig),
- TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (abs_time),
- TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (forever),
+ TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (&abs_time),
+ TALER_PQ_QUERY_PARAM_ABSOLUTE_TIME (&forever),
TALER_PQ_QUERY_PARAM_PTR (&hc),
TALER_PQ_QUERY_PARAM_AMOUNT (&hamount),
TALER_PQ_QUERY_PARAM_AMOUNT_NBO (&namount),
@@ -150,8 +150,6 @@ run_queries (PGconn *conn)
TALER_PQ_RESULT_SPEC_END
};
- fprintf (stderr,
- "Inserting\n");
result = TALER_PQ_exec_prepared (conn,
"test_insert",
params_insert);
@@ -168,8 +166,6 @@ run_queries (PGconn *conn)
}
PQclear (result);
- fprintf (stderr,
- "Selecting\n");
result = TALER_PQ_exec_prepared (conn,
"test_select",
params_select);
@@ -187,8 +183,6 @@ run_queries (PGconn *conn)
results_select,
0);
GNUNET_break (GNUNET_YES == ret);
- fprintf (stderr,
- "Verifying\n");
GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us);
GNUNET_break (forever.abs_value_us == forever2.abs_value_us);
GNUNET_break (0 ==
@@ -233,7 +227,6 @@ main(int argc,
PGresult *result;
int ret;
- // FIXME: pass valid connect string for tests...
GNUNET_log_setup ("test-pq",
"WARNING",
NULL);