update changelog
[debian/iodine.git] / tests / user.c
index 5983717601378f4a612d30052c1f3973a482601e..afd61cac3a5c7dda1eaafe9f75dfc75a235214bf 100644 (file)
@@ -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);
 }