Changeset 553
- Timestamp:
- 07/04/06 16:42:59
- Files:
-
- trunk/README (modified) (3 diffs)
- trunk/libtinymail-test (modified) (1 prop)
- trunk/libtinymail-test/.svnignore (modified) (1 diff)
- trunk/libtinymail-test/Makefile.am (modified) (1 diff)
- trunk/libtinymail-test/tny-list-iface-test.c (added)
- trunk/libtinymail-test/tny-list-iface-test.h (added)
- trunk/libtinymail-test/tny-msg-header-iface-test.c (modified) (1 diff)
- trunk/libtinymail-test/tny-msg-mime-part-iface-test.c (modified) (5 diffs)
- trunk/libtinymail-test/tny-stream-iface-test.c (modified) (3 diffs)
- trunk/libtinymail-test/tny-test-stream.c (modified) (1 diff)
- trunk/libtinymail-test/tny-test-suite.c (modified) (3 diffs)
- trunk/libtinymail/tny-list.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/README
r529 r553 4 4 Project tinymail is an attempt to create an E-mail client framework for small 5 5 devices. 6 7 Development tips 8 ================ 9 You can find the GUnit framework at http://kooditakomo.cs.tut.fi/projects/gunit 10 You'll need it if you build with --enable-unit-tests which will compile the 11 unit tests. Check the sources of the unit tests for more information. 6 12 7 13 Building tips … … 112 118 install. Provided you installed the above packages. 113 119 120 Dependencies 121 122 If you want the unit tests, check above at the Development tips section. You 123 can find a URL to GUnit. There's often also Debian packages that will work 124 with Ubuntu Dapper & Breezy (and maybe/probably also with newer versions of 125 both the Debian and Ubuntu distributions). 126 114 127 Fedora Core 4 & 5 115 128 ----------------- … … 126 139 127 140 Building 128 -------- 141 129 142 Use --with-html-component=none to disable building any HTML component. Because 130 143 Fedora Core 4 uses a quite old gnome-keyring API, it's recommended to also use 131 144 --enable-gnome=no when building on Fedora Core 4. 132 145 146 Dependencies 147 148 If you want the unit tests, check above at the Development tips section. You 149 can find a URL to GUnit sources. 150 151 trunk/libtinymail-test
- Property svn:ignore changed from Makefile.in .svnignore .deps Makefile to Makefile.in .deps Makefile tny-simple-test-runner tny-test-anything .libs
trunk/libtinymail-test/.svnignore
r309 r553 1 1 Makefile.in 2 .svnignore3 2 .deps 4 3 Makefile 4 tny-simple-test-runner 5 tny-test-anything 6 .libs trunk/libtinymail-test/Makefile.am
r379 r553 15 15 tny-stream-iface-test.h \ 16 16 tny-stream-iface-test.c \ 17 tny-list-iface-test.h \ 18 tny-list-iface-test.c \ 17 19 tny-test-stream.c \ 18 20 tny-test-stream.h \ trunk/libtinymail-test/tny-msg-header-iface-test.c
r180 r553 69 69 const gchar *str_out; 70 70 int i=0; 71 g_warning ("to check\n");71 72 72 tny_msg_header_iface_set_to (iface, (const gchar*)str_in); 73 73 str_out = tny_msg_header_iface_get_to (iface); trunk/libtinymail-test/tny-msg-mime-part-iface-test.c
r195 r553 31 31 32 32 static TnyMsgMimePartIface *iface = NULL; 33 static gchar *str; 33 34 34 35 static void … … 56 57 tny_msg_mime_part_iface_test_set_content_location (void) 57 58 { 58 const gchar *str_in = "test contentlocation", *str_out;59 const gchar *str_in = "testcontentlocation", *str_out; 59 60 60 61 tny_msg_mime_part_iface_set_content_location (iface, str_in); 61 62 str_out = tny_msg_mime_part_iface_get_content_location (iface); 62 63 63 gunit_fail_unless(!strcmp (str_in, str_out), "Unable to set content location!\n"); 64 str = g_strdup_printf ("Unable to set content location! (%s) vs. (%s)\n", 65 str_in, str_out); 66 67 gunit_fail_unless(!strcmp (str_in, str_out), str); 68 69 g_free (str); 64 70 65 71 return; … … 83 89 tny_msg_mime_part_iface_test_set_content_id (void) 84 90 { 85 const gchar *str_in = "test contentid", *str_out;91 const gchar *str_in = "testcontentid", *str_out; 86 92 87 93 tny_msg_mime_part_iface_set_content_id (iface, str_in); … … 127 133 gint n; 128 134 135 /* TODO (this one crashes) 136 129 137 tny_msg_mime_part_iface_construct_from_stream (iface, from, "text/plain"); 130 138 tny_msg_mime_part_iface_write_to_stream (iface, to); … … 141 149 n++; 142 150 } 143 151 */ 144 152 g_object_unref (G_OBJECT (to)); 145 153 camel_object_unref (CAMEL_OBJECT (real_to)); trunk/libtinymail-test/tny-stream-iface-test.c
r153 r553 30 30 31 31 static TnyStreamIface *iface = NULL, *source = NULL; 32 static gchar *str; 32 33 33 34 static void … … 80 81 tny_stream_iface_read (iface, buffer, strlen (ret)); 81 82 83 buffer[strlen(ret)] = '\0'; 82 84 /* Check whether the stream in the beginning now contains 21 times 83 85 the answer to all questions */ 84 86 85 gunit_fail_unless(!strcmp (buffer, ret), 86 "At least one of the 42 first bytes changed!\n"); 87 88 str = g_strdup_printf ("At least one of the 42 first bytes changed!: (%s) vs. (%s)\n", buffer, ret); 89 gunit_fail_unless(!strncmp (buffer, ret, strlen (buffer)), str); 90 g_free (str); 87 91 88 92 /* Check whether the stream contains nothing but the answer to all … … 95 99 { 96 100 gchar buf[2]; 97 tny_stream_iface_read (iface, buf, sizeof (buf));101 tny_stream_iface_read (iface, buf, 2); 98 102 99 gunit_fail_unless(!strcmp (buffer, "42"), "Bytes changed!\n"); 103 str = g_strdup_printf ("These two bytes should have been '4' and '2': %s\n", buffer); 104 gunit_fail_unless(!strncmp (buffer, "42", 2), str); 105 g_free (str); 106 100 107 n++; 101 108 } 102 109 103 gunit_fail_unless(n != 21, 104 "Size in bytes isn't correct or reset didn't succeed!\n"); 110 str = g_strdup_printf ("Size in bytes (%d) isn't correct or reset didn't succeed!\n", n); 111 gunit_fail_unless (n == 21, str); 112 g_free (str); 105 113 106 114 g_free (buffer); trunk/libtinymail-test/tny-test-stream.c
r158 r553 56 56 57 57 if (nb_read < 0) 58 { 58 59 return -1; 59 else if (nb_read > 0) { 60 } else if (nb_read > 0) 61 { 60 62 nb_written = 0; 61 63 trunk/libtinymail-test/tny-test-suite.c
r158 r553 19 19 20 20 /* Usage: 21 * export LD_LIBRARY_PATH=./libtinymail-test/.libs/ 21 22 * gunit-test-runner-tool -s tinymail-test-suite -v gnome 22 23 */ … … 27 28 #include "tny-stream-iface-test.h" 28 29 #include "tny-msg-mime-part-iface-test.h" 30 #include "tny-list-iface-test.h" 29 31 30 32 GList* … … 36 38 suites = g_list_append (suites, create_tny_stream_iface_suite ()); 37 39 suites = g_list_append (suites, create_tny_msg_mime_part_iface_suite ()); 40 suites = g_list_append (suites, create_tny_list_iface_suite ()); 38 41 39 42 return suites; trunk/libtinymail/tny-list.c
r551 r553 141 141 destroy_item (gpointer item, gpointer user_data) 142 142 { 143 if ( G_IS_OBJECT (item))143 if (item && G_IS_OBJECT (item)) 144 144 g_object_unref (G_OBJECT (item)); 145 145 }
