Changeset 1724
- Timestamp:
- 03/14/07 20:18:57
- Files:
-
- trunk/README (modified) (1 diff)
- trunk/libtinymail/tny-device.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/README
r1537 r1724 28 28 You'll need it if you build with --enable-unit-tests which will compile the 29 29 unit tests. Check the sources of the unit tests for more information. 30 31 It's highly recommended to set the CFLAGS environment to include -DDEBUG and 32 -DDBC: CFLAGS="-DDBC -DDEBUG" ./autogen.sh --enable-unit-tests .... 33 34 The DBC define will enable Design By Contract assertions, the DEBUG define will 35 enable certain debugging checks, assertions, features and messages. 30 36 31 37 Run all unit tests with 'make check'. trunk/libtinymail/tny-device.c
r1007 r1724 33 33 tny_device_reset (TnyDevice *self) 34 34 { 35 #ifdef D EBUG36 if (!TNY_DEVICE_GET_IFACE (self)->reset_func)37 g_critical ("You must implement tny_device_reset\n");35 #ifdef DBC /* require */ 36 g_assert (TNY_IS_DEVICE (self)); 37 g_assert (TNY_DEVICE_GET_IFACE (self)->reset_func != NULL); 38 38 #endif 39 39 40 40 TNY_DEVICE_GET_IFACE (self)->reset_func (self); 41 42 #ifdef DBC /* ensure */ 43 #endif 44 41 45 return; 42 46 } … … 60 64 tny_device_force_online (TnyDevice *self) 61 65 { 62 #ifdef D EBUG63 if (!TNY_DEVICE_GET_IFACE (self)->force_online_func)64 g_critical ("You must implement tny_device_force_online\n");66 #ifdef DBC /* require */ 67 g_assert (TNY_IS_DEVICE (self)); 68 g_assert (TNY_DEVICE_GET_IFACE (self)->force_online_func != NULL); 65 69 #endif 66 70 67 71 TNY_DEVICE_GET_IFACE (self)->force_online_func (self); 72 73 #ifdef DBC /* ensure */ 74 g_assert (tny_device_is_online (self) == TRUE); 75 #endif 76 68 77 return; 69 78 } … … 78 87 tny_device_force_offline (TnyDevice *self) 79 88 { 80 #ifdef D EBUG81 if (!TNY_DEVICE_GET_IFACE (self)->force_offline_func)82 g_critical ("You must implement tny_device_force_offline\n");89 #ifdef DBC /* require */ 90 g_assert (TNY_IS_DEVICE (self)); 91 g_assert (TNY_DEVICE_GET_IFACE (self)->force_offline_func != NULL); 83 92 #endif 84 93 85 94 TNY_DEVICE_GET_IFACE (self)->force_offline_func (self); 95 96 #ifdef DBC /* ensure */ 97 g_assert (tny_device_is_online (self) == FALSE); 98 #endif 99 86 100 return; 87 101 } … … 109 123 tny_device_is_online (TnyDevice *self) 110 124 { 111 #ifdef DEBUG 112 if (!TNY_DEVICE_GET_IFACE (self)->is_online_func) 113 g_critical ("You must implement tny_device_is_online\n"); 125 gboolean retval; 126 127 #ifdef DBC /* require */ 128 g_assert (TNY_IS_DEVICE (self)); 129 g_assert (TNY_DEVICE_GET_IFACE (self)->is_online_func != NULL); 114 130 #endif 115 131 116 return TNY_DEVICE_GET_IFACE (self)->is_online_func (self); 132 retval = TNY_DEVICE_GET_IFACE (self)->is_online_func (self); 133 134 #ifdef DBC /* ensure */ 135 #endif 136 137 return retval; 117 138 } 118 139 … … 165 186 NULL 166 187 }; 167 188 168 189 type = g_type_register_static (G_TYPE_INTERFACE, 169 190 "TnyDevice", &info, 0);
