Making tests with closures
@mpiechotka
Submitted by Maciej Marcin Piechotka Link to original bug (#596505)
Description
As closures are implemented in Vala I'd propose to add trap function:
public delegate void TrapFunc ();
public static void trap (uint64 usec_timeout, TestTrapFlags test_trap_flags, TrapFunc func) {
if (trap_fork (usec_timeout, test_trap_flags)) {
func ();
exit (0);
}
}
To make the tests less error-prone (for example someone may forget the exit function etc.)