summaryrefslogtreecommitdiff
path: root/src/pq
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-18 20:18:37 +0200
committerChristian Grothoff <christian@grothoff.org>2015-05-18 20:18:37 +0200
commitc742db86c44c7da89d62b6b4ed031dd4bdf74e38 (patch)
tree86a9dd983a213dc5007a59bf0f9251653395957a /src/pq
parent7b4623706c3a87b444362ca27027d9bfb1aa25ae (diff)
downloadexchange-c742db86c44c7da89d62b6b4ed031dd4bdf74e38.tar.gz
exchange-c742db86c44c7da89d62b6b4ed031dd4bdf74e38.tar.bz2
exchange-c742db86c44c7da89d62b6b4ed031dd4bdf74e38.zip
check return values
Diffstat (limited to 'src/pq')
-rw-r--r--src/pq/test_pq.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c
index ff89e29f..c89313b6 100644
--- a/src/pq/test_pq.c
+++ b/src/pq/test_pq.c
@@ -54,10 +54,10 @@ postgres_prepare (PGconn *db_conn)
",abs_time"
",forever"
",hash"
- ",hamount_val"
+ ",hamount_val"
",hamount_frac"
",hamount_curr"
- ",namount_val"
+ ",namount_val"
",namount_frac"
",namount_curr"
",vsize"
@@ -72,10 +72,10 @@ postgres_prepare (PGconn *db_conn)
",abs_time"
",forever"
",hash"
- ",hamount_val"
+ ",hamount_val"
",hamount_frac"
",hamount_curr"
- ",namount_val"
+ ",namount_val"
",namount_frac"
",namount_curr"
",vsize"
@@ -116,18 +116,20 @@ run_queries (PGconn *conn)
char msg[] = "Hello";
void *msg2;
size_t msg2_len;
-
+
priv = GNUNET_CRYPTO_rsa_private_key_create (1024);
pub = GNUNET_CRYPTO_rsa_private_key_get_public (priv);
sig = GNUNET_CRYPTO_rsa_sign (priv,
msg,
sizeof (msg));
- TALER_string_to_amount ("EUR:5.5",
- &hamount);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount ("EUR:5.5",
+ &hamount));
TALER_amount_hton (&namount,
- &hamount);
- TALER_string_to_amount ("EUR:4.4",
- &hamount);
+ &hamount);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount ("EUR:4.4",
+ &hamount));
/* FIXME: test TALER_PQ_result_spec_variable_size */
{
struct TALER_PQ_QueryParam params_insert[] = {
@@ -155,7 +157,7 @@ run_queries (PGconn *conn)
TALER_PQ_result_spec_variable_size ("vsize", &msg2, &msg2_len),
TALER_PQ_result_spec_end
};
-
+
result = TALER_PQ_exec_prepared (conn,
"test_insert",
params_insert);
@@ -170,7 +172,7 @@ run_queries (PGconn *conn)
GNUNET_CRYPTO_rsa_public_key_free (pub);
return 1;
}
-
+
PQclear (result);
result = TALER_PQ_exec_prepared (conn,
"test_select",
@@ -198,10 +200,11 @@ run_queries (PGconn *conn)
GNUNET_break (0 ==
TALER_amount_cmp (&hamount,
&hamount2));
- TALER_string_to_amount ("EUR:5.5",
- &hamount);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount ("EUR:5.5",
+ &hamount));
TALER_amount_ntoh (&hamount2,
- &namount2);
+ &namount2);
GNUNET_break (0 ==
TALER_amount_cmp (&hamount,
&hamount2));
@@ -225,7 +228,7 @@ run_queries (PGconn *conn)
GNUNET_CRYPTO_rsa_public_key_free (pub);
if (GNUNET_OK != ret)
return 1;
-
+
return 0;
}