tests: Fix printerr() handler in TestCase
authorPhilip Withnall <philip@tecnocode.co.uk>
Fri, 6 Jan 2012 14:33:52 +0000 (14:33 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Fri, 6 Jan 2012 18:48:35 +0000 (18:48 +0000)
It was always getting a null message due to having an extraneous extra
parameter (in its C form), meaning that stacktraces from failed assertions
in test cases were never getting printed.

tests/lib/test-case.vala

index c59f7a1..f903370 100644 (file)
@@ -71,14 +71,13 @@ public abstract class Folks.TestCase : Object
 
       public void set_up (void* fixture)
         {
-          GLib.set_printerr_handler (
-              (PrintFunc) this._printerr_func_stack_trace);
+          GLib.set_printerr_handler (this._printerr_func_stack_trace);
           Log.set_default_handler (this._log_func_stack_trace);
 
           this._test_case.set_up ();
         }
 
-      private void _printerr_func_stack_trace (string? text)
+      private static void _printerr_func_stack_trace (string? text)
         {
           if (text == null || str_equal (text, ""))
             return;