[empathy] Abort directly if a test failed



commit 6f3136b0a2168dee114dae4381f9e5c0b9d0ba0d
Author: Xavier Claessens <xclaesse gmail com>
Date:   Fri Jul 23 14:40:10 2010 +0200

    Abort directly if a test failed

 tests/empathy-live-search-test.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/tests/empathy-live-search-test.c b/tests/empathy-live-search-test.c
index 377470e..2f02468 100644
--- a/tests/empathy-live-search-test.c
+++ b/tests/empathy-live-search-test.c
@@ -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



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