public static int test_0_throw_and_raise_exception() { Caller.Setup(); Caller2.Setup(); VoidVoidDelegate f = new VoidVoidDelegate(Caller.M2); VoidHandleHandleOutDelegate del2 = new VoidHandleHandleOutDelegate(Caller2.Del2); bool outer_managed_callback = false; try { mono_test_setup_ftnptr_eh_callback(f, del2); } catch (Exception e) { outer_managed_callback = true; } if (!outer_managed_callback) { Console.Error.WriteLine("outer managed callback did not throw exception"); return(1); } if (!Caller2.rethrow_called) { Console.Error.WriteLine("exception was not rethrown by eh callback"); return(2); } if (!Caller2.exception_caught) { Console.Error.WriteLine("rethrown exception was not caught"); return(3); } if (!Caller2.return_from_inner_managed_callback) { Console.Error.WriteLine("managed callback called from native eh callback did not return"); return(4); } mono_test_cleanup_ftptr_eh_callback(); return(0); }
public static extern void mono_test_setup_ftnptr_eh_callback(VoidVoidDelegate del, VoidHandleHandleOutDelegate inside_eh_callback);