update TODO and fix some valgrind errors in test
authorTero Marttila <terom@fixme.fi>
Fri, 27 Mar 2009 00:48:12 +0200
changeset 81 d90edc052352
parent 80 1b989bc67760
child 82 bc767e01648d
update TODO and fix some valgrind errors in test
TODO
src/test.c
--- a/TODO	Fri Mar 27 00:08:32 2009 +0200
+++ b/TODO	Fri Mar 27 00:48:12 2009 +0200
@@ -4,8 +4,8 @@
  * sock_openssl, or improve sock_gnutls
  * tests for all of the above...
 
-irc_net:
- * tracking of channel users list
+irc_conn:
+ * support for CTCP messages, e.g. ACTION
 
 modules:
  * proper unload support, there needs to be some kind of completion notification thing that can then destroy the module
@@ -14,4 +14,3 @@
 
 irc_log:
  * logging of NICK/QUIT
- * handling of SQL errors?
--- a/src/test.c	Fri Mar 27 00:08:32 2009 +0200
+++ b/src/test.c	Fri Mar 27 00:48:12 2009 +0200
@@ -65,14 +65,15 @@
     
     // dump each char
     for (; (
+            // ...don't consume more than len bytes of str, unless len < 0
+                (len < 0 || (size_t) (str - str_ptr) < (size_t) len)
+
             // ...stop on NUL
-                *str 
+            &&  *str 
 
             // ...leave DUMP_STR_TAIL bytes room at the end of buf
             &&  (size_t) (buf - buf_ptr) < DUMP_STR_BUF - DUMP_STR_TAIL 
             
-            // ...don't consume more than len bytes of str, unless len < 0
-            &&  (len < 0 || (size_t) (str - str_ptr) < (size_t) len)
         ); str++
     ) {
         if (*str == '\'') {
@@ -888,6 +889,9 @@
     test_sock_push(sock, ":userA!someone@somewhere NICK userA2\r\n");
     check_chan_user(chan, "userA", false);
     check_chan_user(chan, "userB", true);
+
+    // cleanup
+    irc_net_destroy(net);
 }
 
 void test_irc_chan_user_quit (void)
@@ -901,6 +905,9 @@
     log_info("test irc_net_on_chanuser");
     test_sock_push(sock, ":userA!someone@somewhere QUIT foo\r\n");
     check_chan_user(chan, "userA", false);
+
+    // cleanup
+    irc_net_destroy(net);
 }
 
 /**