Re: Design by contract toys



Philip Van Hoof wrote:
> I added design by contract assertions in all the libtinymail interfaces.
> For more information about this, check this page and read about Eiffel a
> little bit ;-)
> 
> http://tinymail.org/trac/tinymail/wiki/DesignByContract

Wow, this stuff is really cool for MUA developers, thx Philip.

Br

PD: first patch ;-)
Index: libtinymail/tny-folder.c
===================================================================
--- libtinymail/tny-folder.c	(revision 1733)
+++ libtinymail/tny-folder.c	(working copy)
@@ -709,7 +709,8 @@
 
 
 #ifdef DBC /* ensure */
-	g_assert (TNY_IS_ACCOUNT (self));
+	if (retval)
+		g_assert (TNY_IS_ACCOUNT (retval));
 #endif
 
 	return retval;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]