trap_assert_passed


Description:

[ Version ( since = "2.16" ) ]
public void trap_assert_passed ()

Example: Assert that the last test subprocess passed:

public static int main (string[] args) {
Test.init (ref args);

Test.add_func ("/valadoc/driver-0.14.x", () => {
Test.trap_subprocess ("/valadoc/driver-0.14.x/subprocess", 0, 0);

// Assert that our subprocess passed:
// See also: Test.trap_assert_passed ()
Test.trap_assert_passed ();
});

Test.add_func ("/valadoc/driver-0.14.x/subprocess", () => {
int x = 3 + 2;
assert (x == 1000);
});

Test.run ();
return 0;
}

valac --pkg glib-2.0 GLib.Test.trap_assert_passed.vala

./GLib.Test.trap_assert_passed --verbose


Namespace: GLib.Test
Package: glib-2.0