test: Silence warnings in ItemCreator test
authorJens Georg <jensg@openismus.com>
Wed, 3 Oct 2012 11:48:33 +0000 (13:48 +0200)
committerJens Georg <jensg@openismus.com>
Fri, 5 Oct 2012 15:33:28 +0000 (17:33 +0200)
tests/rygel-item-creator-test.vala

index 53971c0..b11ac01 100644 (file)
@@ -267,9 +267,29 @@ public class Rygel.EngineLoader {
     }
 }
 
+public static void log_func (string? domain,
+                             LogLevelFlags flags,
+                             string message) {
+
+    // Ignore critical of gee 0.6 and recent glib
+    if (message.has_prefix ("Read-only property 'read-only-view' on class")) {
+        Log.default_handler (domain, flags, message);
+
+        return;
+    }
+
+    if (LogLevelFlags.LEVEL_CRITICAL in flags ||
+        LogLevelFlags.LEVEL_ERROR in flags ||
+        LogLevelFlags.FLAG_FATAL in flags) {
+        print ("======> FAILED: %s: %s\n", domain ?? "", message);
+        assert_not_reached ();
+    }
+}
+
 public class Rygel.HTTPItemCreatorTest : GLib.Object {
 
     public static int main (string[] args) {
+        Log.set_default_handler (log_func);
         var test = new HTTPItemCreatorTest ();
         test.test_parse_args ();
         test.test_didl_parsing ();