diff options
author | Yorhel <git@yorhel.nl> | 2012-03-25 05:01:31 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2012-03-25 05:04:26 +0200 |
commit | ba6257b91d3d75d836ce0a59d2a0a3afc3773ec2 (patch) | |
tree | bfbcc19da64454103d8e7868f541e8b09383e4a7 | |
parent | 854f714e4f08e04c2461503b634fbe3a8a0058c6 (diff) |
test/tuple: Make sure to pass integers as uint64_t to va-arg function
Things really go wrong otherwise... perhaps I should add a feature to
have it accept normal "int" as well, because I can imagine that this
casting requirement is going to be a source of bugs.
-rw-r--r-- | test/pthread.c | 8 | ||||
-rw-r--r-- | test/tuple.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/test/pthread.c b/test/pthread.c index 0e75dc3..8c1d87f 100644 --- a/test/pthread.c +++ b/test/pthread.c @@ -73,14 +73,14 @@ static void recv_alpha_sb(tn_session *s, tn_tuple *tup, tn_returnpath *p, void * tn_tuple_unref(tup); // Reply - tn_reply(p, tn_tuple_new("i", 1)); - tn_reply(p, tn_tuple_new("i", 2)); + tn_reply(p, tn_tuple_new("i", (uint64_t)1)); + tn_reply(p, tn_tuple_new("i", (uint64_t)2)); tn_reply_close(p); // Send some more alphas int i; for(i=1; i<10; i++) - tn_session_send(sa, tn_tuple_new("si", strdup("alpha"), i), NULL, NULL); + tn_session_send(sa, tn_tuple_new("si", strdup("alpha"), (uint64_t)i), NULL, NULL); tn_session_close(sb); r_alpha_sb++; @@ -139,7 +139,7 @@ int main() { tn_session_register(sb, tn_tuple_new("s", strdup("alpha")), 1, recv_alpha_sb, (void *)2); // Send start message (which wants a reply) - tn_session_send(sa, tn_tuple_new("si", strdup("alpha"), 0), recv_reply, (void *)3); + tn_session_send(sa, tn_tuple_new("si", strdup("alpha"), (uint64_t)0), recv_reply, (void *)3); pthread_join(th, NULL); pthread_join(thb, NULL); diff --git a/test/tuple.c b/test/tuple.c index 9df30b3..240942f 100644 --- a/test/tuple.c +++ b/test/tuple.c @@ -105,7 +105,7 @@ int main() { t_assert(tn_el_num(e) == 1021.2); tn_el_free(e); - e = tn_map_new(0, "si", strdup("str"), strdup("strval"), strdup("int"), 42); + e = tn_map_new(0, "si", strdup("str"), strdup("strval"), strdup("int"), (uint64_t)42); t_assert(e.type == TN_VT_MAP); t_assert(e.count == 2); v = tn_map_get(e, "str"); |