aboutsummaryrefslogtreecommitdiffstats
path: root/test/rspamd_dns_test.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-01 21:57:09 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-01 21:57:09 +0400
commit4f28edb3f55048024301068417be00106ebdd09a (patch)
tree7622d57398f3132b0f3552bb17c58b2a11daa66d /test/rspamd_dns_test.c
parent9d703560099beea2b2b53c533e7f71dc926293b2 (diff)
downloadrspamd-4f28edb3f55048024301068417be00106ebdd09a.tar.gz
rspamd-4f28edb3f55048024301068417be00106ebdd09a.zip
Fix asynchronous IO API.
Write test case for aio.
Diffstat (limited to 'test/rspamd_dns_test.c')
-rw-r--r--test/rspamd_dns_test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/rspamd_dns_test.c b/test/rspamd_dns_test.c
index 839c00a79..9fa1d4901 100644
--- a/test/rspamd_dns_test.c
+++ b/test/rspamd_dns_test.c
@@ -69,6 +69,7 @@ rspamd_dns_test_func ()
struct config_file *cfg;
memory_pool_t *pool;
struct rspamd_async_session *s;
+ struct in_addr ina;
cfg = (struct config_file *)g_malloc (sizeof (struct config_file));
bzero (cfg, sizeof (struct config_file));
@@ -78,15 +79,16 @@ rspamd_dns_test_func ()
pool = memory_pool_new (memory_pool_get_size ());
- event_init ();
s = new_async_session (pool, session_fin, NULL, NULL, NULL);
resolver = dns_resolver_init (base, cfg);
+ ina.s_addr = inet_addr ("81.19.70.3");
+
requests ++;
g_assert (make_dns_request (resolver, s, pool, test_dns_cb, NULL, DNS_REQUEST_A, "google.com"));
requests ++;
- g_assert (make_dns_request (resolver, s, pool, test_dns_cb, NULL, DNS_REQUEST_PTR, inet_addr ("81.19.70.3")));
+ g_assert (make_dns_request (resolver, s, pool, test_dns_cb, NULL, DNS_REQUEST_PTR, &ina));
requests ++;
g_assert (make_dns_request (resolver, s, pool, test_dns_cb, NULL, DNS_REQUEST_MX, "rambler.ru"));
requests ++;