Index: tests/check_arc.c
===================================================================
--- tests/check_arc.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_arc.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -18,5 +18,5 @@
 };
 
-static void check_codec(int l)
+START_TEST(check_codec)
 {
 	int i;
@@ -38,4 +38,5 @@
 	}
 }
+END_TEST
 
 struct {
@@ -73,5 +74,5 @@
 };
 
-static void check_decod(int l)
+START_TEST(check_decod)
 {
 	int i;
@@ -93,4 +94,5 @@
 	}
 }
+END_TEST
 
 Suite *arc_suite(void)
Index: tests/check_help.c
===================================================================
--- tests/check_help.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_help.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -8,18 +8,22 @@
 
 START_TEST(test_help_initfree)
-help_t * h, *r;
-r = help_init(&h, "/dev/null");
-fail_if(r == NULL);
-fail_if(r != h);
+{
+    help_t * h, *r;
+    r = help_init(&h, "/dev/null");
+    fail_if(r == NULL);
+    fail_if(r != h);
 
-help_free(&h);
-fail_if(h != NULL);
+    help_free(&h);
+    fail_if(h != NULL);
+}
 END_TEST
 
 START_TEST(test_help_nonexistent)
-help_t * h, *r;
-r = help_init(&h, "/dev/null");
-fail_unless(help_get(&h, "nonexistent") == NULL);
-fail_if(r == NULL);
+{
+    help_t * h, *r;
+    r = help_init(&h, "/dev/null");
+    fail_unless(help_get(&h, "nonexistent") == NULL);
+    fail_if(r == NULL);
+}
 END_TEST
 
Index: tests/check_irc.c
===================================================================
--- tests/check_irc.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_irc.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -9,47 +9,51 @@
 
 START_TEST(test_connect)
-GIOChannel * ch1, *ch2;
-irc_t *irc;
-char *raw;
-fail_unless(g_io_channel_pair(&ch1, &ch2));
+{
+    GIOChannel * ch1, *ch2;
+    irc_t *irc;
+    char *raw;
+    fail_unless(g_io_channel_pair(&ch1, &ch2));
 
-irc = irc_new(g_io_channel_unix_get_fd(ch1));
+    irc = irc_new(g_io_channel_unix_get_fd(ch1));
 
-irc_free(irc);
+    irc_free(irc);
 
-fail_unless(g_io_channel_read_to_end(ch2, &raw, NULL, NULL) == G_IO_STATUS_NORMAL);
+    fail_unless(g_io_channel_read_to_end(ch2, &raw, NULL, NULL) == G_IO_STATUS_NORMAL);
 
-fail_if(strcmp(raw, "") != 0);
+    fail_if(strcmp(raw, "") != 0);
 
-g_free(raw);
+    g_free(raw);
+}
 END_TEST
 
 START_TEST(test_login)
-GIOChannel * ch1, *ch2;
-irc_t *irc;
-char *raw;
-fail_unless(g_io_channel_pair(&ch1, &ch2));
+{
+    GIOChannel * ch1, *ch2;
+    irc_t *irc;
+    char *raw;
+    fail_unless(g_io_channel_pair(&ch1, &ch2));
 
-g_io_channel_set_flags(ch1, G_IO_FLAG_NONBLOCK, NULL);
-g_io_channel_set_flags(ch2, G_IO_FLAG_NONBLOCK, NULL);
+    g_io_channel_set_flags(ch1, G_IO_FLAG_NONBLOCK, NULL);
+    g_io_channel_set_flags(ch2, G_IO_FLAG_NONBLOCK, NULL);
 
-irc = irc_new(g_io_channel_unix_get_fd(ch1));
+    irc = irc_new(g_io_channel_unix_get_fd(ch1));
 
-fail_unless(g_io_channel_write_chars(ch2, "NICK bla\r\r\n"
-                                     "USER a a a a\n", -1, NULL, NULL) == G_IO_STATUS_NORMAL);
-fail_unless(g_io_channel_flush(ch2, NULL) == G_IO_STATUS_NORMAL);
+    fail_unless(g_io_channel_write_chars(ch2, "NICK bla\r\r\n"
+                "USER a a a a\n", -1, NULL, NULL) == G_IO_STATUS_NORMAL);
+    fail_unless(g_io_channel_flush(ch2, NULL) == G_IO_STATUS_NORMAL);
 
-g_main_iteration(FALSE);
-irc_free(irc);
+    g_main_iteration(FALSE);
+    irc_free(irc);
 
-fail_unless(g_io_channel_read_to_end(ch2, &raw, NULL, NULL) == G_IO_STATUS_NORMAL);
+    fail_unless(g_io_channel_read_to_end(ch2, &raw, NULL, NULL) == G_IO_STATUS_NORMAL);
 
-fail_unless(strstr(raw, "001") != NULL);
-fail_unless(strstr(raw, "002") != NULL);
-fail_unless(strstr(raw, "003") != NULL);
-fail_unless(strstr(raw, "004") != NULL);
-fail_unless(strstr(raw, "005") != NULL);
+    fail_unless(strstr(raw, "001") != NULL);
+    fail_unless(strstr(raw, "002") != NULL);
+    fail_unless(strstr(raw, "003") != NULL);
+    fail_unless(strstr(raw, "004") != NULL);
+    fail_unless(strstr(raw, "005") != NULL);
 
-g_free(raw);
+    g_free(raw);
+}
 END_TEST
 
Index: tests/check_jabber_sasl.c
===================================================================
--- tests/check_jabber_sasl.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_jabber_sasl.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -78,5 +78,5 @@
 };
 
-static void check_get_part(int l)
+START_TEST(check_get_part)
 {
 	int i;
@@ -104,4 +104,5 @@
 	}
 }
+END_TEST
 
 Suite *jabber_sasl_suite(void)
Index: tests/check_jabber_util.c
===================================================================
--- tests/check_jabber_util.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_jabber_util.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -9,5 +9,5 @@
 static struct im_connection *ic;
 
-static void check_buddy_add(int l)
+START_TEST(check_buddy_add)
 {
 	struct jabber_buddy *budw1, *budw2, *budw3, *budn, *bud;
@@ -94,6 +94,7 @@
 	fail_unless(jabber_buddy_remove(ic, "bugtest@google.com/C"));
 }
+END_TEST
 
-static void check_compareJID(int l)
+START_TEST(check_compareJID)
 {
 	fail_unless(jabber_compare_jid("bugtest@google.com/B", "bugtest@google.com/A"));
@@ -106,6 +107,7 @@
 	fail_if(jabber_compare_jid("", NULL));
 }
+END_TEST
 
-static void check_hipchat_slug(int l)
+START_TEST(check_hipchat_slug)
 {
 	int i;
@@ -125,4 +127,5 @@
 	}
 }
+END_TEST
 
 Suite *jabber_util_suite(void)
Index: tests/check_md5.c
===================================================================
--- tests/check_md5.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_md5.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -30,5 +30,5 @@
 };
 
-static void check_sums(int l)
+START_TEST(check_sums)
 {
 	int i;
@@ -46,4 +46,5 @@
 	}
 }
+END_TEST
 
 Suite *md5_suite(void)
Index: tests/check_set.c
===================================================================
--- tests/check_set.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_set.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -8,95 +8,121 @@
 
 START_TEST(test_set_add)
-void *data = "data";
-set_t *s = NULL, *t;
-t = set_add(&s, "name", "default", NULL, data);
-fail_unless(s == t);
-fail_unless(t->data == data);
-fail_unless(strcmp(t->def, "default") == 0);
+{
+    void *data = "data";
+    set_t *s = NULL, *t;
+    t = set_add(&s, "name", "default", NULL, data);
+    fail_unless(s == t);
+    fail_unless(t->data == data);
+    fail_unless(strcmp(t->def, "default") == 0);
+}
 END_TEST
 
 START_TEST(test_set_add_existing)
-void *data = "data";
-set_t *s = NULL, *t;
-t = set_add(&s, "name", "default", NULL, data);
-t = set_add(&s, "name", "newdefault", NULL, data);
-fail_unless(s == t);
-fail_unless(strcmp(t->def, "newdefault") == 0);
+{
+    void *data = "data";
+    set_t *s = NULL, *t;
+    t = set_add(&s, "name", "default", NULL, data);
+    t = set_add(&s, "name", "newdefault", NULL, data);
+    fail_unless(s == t);
+    fail_unless(strcmp(t->def, "newdefault") == 0);
+}
 END_TEST
 
 START_TEST(test_set_find_unknown)
-set_t * s = NULL;
-fail_unless(set_find(&s, "foo") == NULL);
+{
+    set_t * s = NULL;
+    fail_unless(set_find(&s, "foo") == NULL);
+}
 END_TEST
 
 START_TEST(test_set_find)
-void *data = "data";
-set_t *s = NULL, *t;
-t = set_add(&s, "name", "default", NULL, data);
-fail_unless(s == t);
-fail_unless(set_find(&s, "name") == t);
+{
+    void *data = "data";
+    set_t *s = NULL, *t;
+    t = set_add(&s, "name", "default", NULL, data);
+    fail_unless(s == t);
+    fail_unless(set_find(&s, "name") == t);
+}
 END_TEST
 
 START_TEST(test_set_get_str_default)
-void *data = "data";
-set_t *s = NULL, *t;
-t = set_add(&s, "name", "default", NULL, data);
-fail_unless(s == t);
-fail_unless(strcmp(set_getstr(&s, "name"), "default") == 0);
+{
+    void *data = "data";
+    set_t *s = NULL, *t;
+    t = set_add(&s, "name", "default", NULL, data);
+    fail_unless(s == t);
+    fail_unless(strcmp(set_getstr(&s, "name"), "default") == 0);
+}
 END_TEST
 
 START_TEST(test_set_get_bool_default)
-void *data = "data";
-set_t *s = NULL, *t;
-t = set_add(&s, "name", "true", NULL, data);
-fail_unless(s == t);
-fail_unless(set_getbool(&s, "name"));
+{
+    void *data = "data";
+    set_t *s = NULL, *t;
+    t = set_add(&s, "name", "true", NULL, data);
+    fail_unless(s == t);
+    fail_unless(set_getbool(&s, "name"));
+}
 END_TEST
 
 START_TEST(test_set_get_bool_integer)
-void *data = "data";
-set_t *s = NULL, *t;
-t = set_add(&s, "name", "3", NULL, data);
-fail_unless(s == t);
-fail_unless(set_getbool(&s, "name") == 3);
+{
+    void *data = "data";
+    set_t *s = NULL, *t;
+    t = set_add(&s, "name", "3", NULL, data);
+    fail_unless(s == t);
+    fail_unless(set_getbool(&s, "name") == 3);
+}
 END_TEST
 
 START_TEST(test_set_get_bool_unknown)
-set_t * s = NULL;
-fail_unless(set_getbool(&s, "name") == 0);
+{
+    set_t * s = NULL;
+    fail_unless(set_getbool(&s, "name") == 0);
+}
 END_TEST
 
 START_TEST(test_set_get_str_value)
-void *data = "data";
-set_t *s = NULL;
-set_add(&s, "name", "default", NULL, data);
-set_setstr(&s, "name", "foo");
-fail_unless(strcmp(set_getstr(&s, "name"), "foo") == 0);
+{
+    void *data = "data";
+    set_t *s = NULL;
+    set_add(&s, "name", "default", NULL, data);
+    set_setstr(&s, "name", "foo");
+    fail_unless(strcmp(set_getstr(&s, "name"), "foo") == 0);
+}
 END_TEST
 
 START_TEST(test_set_get_str_unknown)
-set_t * s = NULL;
-fail_unless(set_getstr(&s, "name") == NULL);
+{
+    set_t * s = NULL;
+    fail_unless(set_getstr(&s, "name") == NULL);
+}
 END_TEST
 
 START_TEST(test_setint)
-void *data = "data";
-set_t *s = NULL;
-set_add(&s, "name", "10", NULL, data);
-set_setint(&s, "name", 3);
-fail_unless(set_getint(&s, "name") == 3);
+{
+    void *data = "data";
+    set_t *s = NULL;
+    set_add(&s, "name", "10", NULL, data);
+    set_setint(&s, "name", 3);
+    fail_unless(set_getint(&s, "name") == 3);
+}
 END_TEST
 
 START_TEST(test_setstr)
-void *data = "data";
-set_t *s = NULL;
-set_add(&s, "name", "foo", NULL, data);
-set_setstr(&s, "name", "bloe");
-fail_unless(strcmp(set_getstr(&s, "name"), "bloe") == 0);
+{
+    void *data = "data";
+    set_t *s = NULL;
+    set_add(&s, "name", "foo", NULL, data);
+    set_setstr(&s, "name", "bloe");
+    fail_unless(strcmp(set_getstr(&s, "name"), "bloe") == 0);
+}
 END_TEST
 
 START_TEST(test_set_get_int_unknown)
-set_t * s = NULL;
-fail_unless(set_getint(&s, "foo") == 0);
+{
+    set_t * s = NULL;
+    fail_unless(set_getint(&s, "foo") == 0);
+}
 END_TEST
 
Index: tests/check_util.c
===================================================================
--- tests/check_util.c	(revision 671b1efd6e58761f2167b9d5ee6d1f9e6496a146)
+++ tests/check_util.c	(revision 3a547ee9dcf5c790f68ee2118389dd27ed471b23)
@@ -9,5 +9,6 @@
 #include "url.h"
 
-START_TEST(test_strip_linefeed){
+START_TEST(test_strip_linefeed)
+{
 	int i;
 	const char *get[] = { "Test", "Test\r", "Test\rX\r", NULL };
@@ -44,61 +45,71 @@
 
 START_TEST(test_set_url_http)
-url_t url;
-
-fail_if(0 == url_set(&url, "http://host/"));
-fail_unless(!strcmp(url.host, "host"));
-fail_unless(!strcmp(url.file, "/"));
-fail_unless(!strcmp(url.user, ""));
-fail_unless(!strcmp(url.pass, ""));
-fail_unless(url.proto == PROTO_HTTP);
-fail_unless(url.port == 80);
+{
+    url_t url;
+
+    fail_if(0 == url_set(&url, "http://host/"));
+    fail_unless(!strcmp(url.host, "host"));
+    fail_unless(!strcmp(url.file, "/"));
+    fail_unless(!strcmp(url.user, ""));
+    fail_unless(!strcmp(url.pass, ""));
+    fail_unless(url.proto == PROTO_HTTP);
+    fail_unless(url.port == 80);
+}
 END_TEST
 
 START_TEST(test_set_url_https)
-url_t url;
-
-fail_if(0 == url_set(&url, "https://ahost/AimeeMann"));
-fail_unless(!strcmp(url.host, "ahost"));
-fail_unless(!strcmp(url.file, "/AimeeMann"));
-fail_unless(!strcmp(url.user, ""));
-fail_unless(!strcmp(url.pass, ""));
-fail_unless(url.proto == PROTO_HTTPS);
-fail_unless(url.port == 443);
+{
+    url_t url;
+
+    fail_if(0 == url_set(&url, "https://ahost/AimeeMann"));
+    fail_unless(!strcmp(url.host, "ahost"));
+    fail_unless(!strcmp(url.file, "/AimeeMann"));
+    fail_unless(!strcmp(url.user, ""));
+    fail_unless(!strcmp(url.pass, ""));
+    fail_unless(url.proto == PROTO_HTTPS);
+    fail_unless(url.port == 443);
+}
 END_TEST
 
 START_TEST(test_set_url_port)
-url_t url;
-
-fail_if(0 == url_set(&url, "https://ahost:200/Lost/In/Space"));
-fail_unless(!strcmp(url.host, "ahost"));
-fail_unless(!strcmp(url.file, "/Lost/In/Space"));
-fail_unless(!strcmp(url.user, ""));
-fail_unless(!strcmp(url.pass, ""));
-fail_unless(url.proto == PROTO_HTTPS);
-fail_unless(url.port == 200);
+{
+    url_t url;
+
+    fail_if(0 == url_set(&url, "https://ahost:200/Lost/In/Space"));
+    fail_unless(!strcmp(url.host, "ahost"));
+    fail_unless(!strcmp(url.file, "/Lost/In/Space"));
+    fail_unless(!strcmp(url.user, ""));
+    fail_unless(!strcmp(url.pass, ""));
+    fail_unless(url.proto == PROTO_HTTPS);
+    fail_unless(url.port == 200);
+}
 END_TEST
 
 START_TEST(test_set_url_username)
-url_t url;
-
-fail_if(0 == url_set(&url, "socks4://user@ahost/Space"));
-fail_unless(!strcmp(url.host, "ahost"));
-fail_unless(!strcmp(url.file, "/Space"));
-fail_unless(!strcmp(url.user, "user"));
-fail_unless(!strcmp(url.pass, ""));
-fail_unless(url.proto == PROTO_SOCKS4);
-fail_unless(url.port == 1080);
+{
+    url_t url;
+
+    fail_if(0 == url_set(&url, "socks4://user@ahost/Space"));
+    fail_unless(!strcmp(url.host, "ahost"));
+    fail_unless(!strcmp(url.file, "/Space"));
+    fail_unless(!strcmp(url.user, "user"));
+    fail_unless(!strcmp(url.pass, ""));
+    fail_unless(url.proto == PROTO_SOCKS4);
+    fail_unless(url.port == 1080);
+}
 END_TEST
 
 START_TEST(test_set_url_username_pwd)
-url_t url;
-
-fail_if(0 == url_set(&url, "socks5://user:pass@ahost/"));
-fail_unless(!strcmp(url.host, "ahost"));
-fail_unless(!strcmp(url.file, "/"));
-fail_unless(!strcmp(url.user, "user"));
-fail_unless(!strcmp(url.pass, "pass"));
-fail_unless(url.proto == PROTO_SOCKS5);
-fail_unless(url.port == 1080);
+{
+    url_t url;
+
+    fail_if(0 == url_set(&url, "socks5://user:pass@ahost/"));
+    fail_unless(!strcmp(url.host, "ahost"));
+    fail_unless(!strcmp(url.file, "/"));
+    fail_unless(!strcmp(url.user, "user"));
+    fail_unless(!strcmp(url.pass, "pass"));
+    fail_unless(url.proto == PROTO_SOCKS5);
+    fail_unless(url.port == 1080);
+}
 END_TEST
 
@@ -149,24 +160,28 @@
 
 START_TEST(test_word_wrap)
-int i;
-
-for (i = 0; word_wrap_tests[i].orig && *word_wrap_tests[i].orig; i++) {
-	char *wrapped = word_wrap(word_wrap_tests[i].orig, word_wrap_tests[i].line_len);
-
-	fail_unless(strcmp(word_wrap_tests[i].wrapped, wrapped) == 0,
-	            "%s (line_len = %d) should wrap to `%s', not to `%s'",
-	            word_wrap_tests[i].orig, word_wrap_tests[i].line_len,
-	            word_wrap_tests[i].wrapped, wrapped);
-
-	g_free(wrapped);
+{
+    int i;
+
+    for (i = 0; word_wrap_tests[i].orig && *word_wrap_tests[i].orig; i++) {
+        char *wrapped = word_wrap(word_wrap_tests[i].orig, word_wrap_tests[i].line_len);
+
+        fail_unless(strcmp(word_wrap_tests[i].wrapped, wrapped) == 0,
+                "%s (line_len = %d) should wrap to `%s', not to `%s'",
+                word_wrap_tests[i].orig, word_wrap_tests[i].line_len,
+                word_wrap_tests[i].wrapped, wrapped);
+
+        g_free(wrapped);
+    }
 }
 END_TEST
 
 START_TEST(test_http_encode)
-char s[80];
-
-strcpy(s, "ee\xc3" "\xab" "ee!!...");
-http_encode(s);
-fail_unless(strcmp(s, "ee%C3%ABee%21%21...") == 0);
+{
+    char s[80];
+
+    strcpy(s, "ee\xc3" "\xab" "ee!!...");
+    http_encode(s);
+    fail_unless(strcmp(s, "ee%C3%ABee%21%21...") == 0);
+}
 END_TEST
 
@@ -199,17 +214,19 @@
 
 START_TEST(test_split_command_parts)
-int i;
-for (i = 0; split_tests[i].command; i++) {
-	char *cmd = g_strdup(split_tests[i].command);
-	char **split = split_command_parts(cmd, split_tests[i].limit);
-	char **expected = split_tests[i].expected;
-
-	int j;
-	for (j = 0; split[j] && expected[j]; j++) {
-		fail_unless(strcmp(split[j], expected[j]) == 0,
-		            "(%d) split_command_parts broken: split(\"%s\")[%d] -> %s (expected: %s)",
-		            i, split_tests[i].command, j, split[j], expected[j]);
-	}
-	g_free(cmd);
+{
+    int i;
+    for (i = 0; split_tests[i].command; i++) {
+        char *cmd = g_strdup(split_tests[i].command);
+        char **split = split_command_parts(cmd, split_tests[i].limit);
+        char **expected = split_tests[i].expected;
+
+        int j;
+        for (j = 0; split[j] && expected[j]; j++) {
+            fail_unless(strcmp(split[j], expected[j]) == 0,
+                    "(%d) split_command_parts broken: split(\"%s\")[%d] -> %s (expected: %s)",
+                    i, split_tests[i].command, j, split[j], expected[j]);
+        }
+        g_free(cmd);
+    }
 }
 END_TEST
