]> git.0d.be Git - empathy.git/commitdiff
Abort directly if a test failed
authorXavier Claessens <xclaesse@gmail.com>
Fri, 23 Jul 2010 12:40:10 +0000 (14:40 +0200)
committerXavier Claessens <xclaesse@gmail.com>
Fri, 30 Jul 2010 11:11:40 +0000 (13:11 +0200)
tests/empathy-live-search-test.c

index 377470e60d78034e185b1faea2f674756ea9dbae..2f02468d08af8c0fdec07bda60761e85df246757 100644 (file)
@@ -49,7 +49,6 @@ test_live_search (void)
       { NULL, NULL, FALSE }
     };
   guint i;
-  gboolean failed = FALSE;
 
   DEBUG ("Started");
   for (i = 0; tests[i].string != NULL; i ++)
@@ -60,13 +59,12 @@ test_live_search (void)
       match = empathy_live_search_match_string (tests[i].string, tests[i].prefix);
       ok = (match == tests[i].should_match);
 
-      DEBUG ("'%s' - '%s': %s", tests[i].string, tests[i].prefix, ok ? "OK" : "FAILED");
+      DEBUG ("'%s' - '%s' %s: %s", tests[i].string, tests[i].prefix,
+          tests[i].should_match ? "should match" : "should NOT match",
+          ok ? "OK" : "FAILED");
 
-      if (!ok)
-        failed = TRUE;
+      g_assert (ok);
     }
-
-  g_assert (!failed);
 }
 
 int