From 8692c7f7593aceaef91c9d528c38689db829a18a Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sun, 20 Sep 2009 21:10:45 +0000 Subject: [PATCH] Fix test cases --- tests/user.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/user.c b/tests/user.c index 5983717..afd61ca 100644 --- a/tests/user.c +++ b/tests/user.c @@ -63,6 +63,7 @@ START_TEST(test_users_waiting) fail_unless(users_waiting_on_reply() == 0); + users[3].conn = CONN_DNS_NULL; users[3].q.id = 1; fail_unless(users_waiting_on_reply() == 1); @@ -76,6 +77,7 @@ START_TEST(test_find_user_by_ip) ip = inet_addr("127.0.0.1"); init_users(ip, 27); + users[0].conn = CONN_DNS_NULL; testip = (unsigned int) inet_addr("10.0.0.1"); fail_unless(find_user_by_ip(testip) == -1); @@ -104,15 +106,21 @@ START_TEST(test_all_users_waiting_to_send) fail_unless(all_users_waiting_to_send() == 1); + users[0].conn = CONN_DNS_NULL; users[0].active = 1; fail_unless(all_users_waiting_to_send() == 1); users[0].last_pkt = time(NULL); + users[0].outpacket.len = 0; fail_unless(all_users_waiting_to_send() == 0); +#ifdef OUTPACKETQ_LEN + users[0].outpacketq_filled = 1; +#else users[0].outpacket.len = 44; +#endif fail_unless(all_users_waiting_to_send() == 1); }