diff options
author | Lauro Moura <lauromoura@expertisesolutions.com.br> | 2018-09-05 14:25:11 -0300 |
---|---|---|
committer | Vitor Sousa <vitorsousa@expertisesolutions.com.br> | 2018-09-05 14:47:19 -0300 |
commit | 4c53151096cf0e4e9e0f451b9d90ec0848aadd36 (patch) | |
tree | 7b8b95fe99aa15bb7bdf21ca57da7bd595444502 /src/tests/efl_mono | |
parent | 5e107aa19dc944e38624a0fa5a61a54db7f8035c (diff) | |
download | efl-4c53151096cf0e4e9e0f451b9d90ec0848aadd36.tar.gz |
efl-csharp: Fix event callback removal.
Summary:
Use the native event loaded from dlsym directly instead of wrapping it
in a Event_Description structure.
Fixes: T7355
Reviewers: felipealmeida, vitor.sousa, segfaultxavi
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl_language_bindings
Differential Revision: https://phab.enlightenment.org/D6981
Diffstat (limited to 'src/tests/efl_mono')
-rw-r--r-- | src/tests/efl_mono/Events.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index a08cd8b367..9cf7795dca 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -165,4 +165,29 @@ class TestEoEvents Test.AssertEquals(sent, received); } } + +class TestEventAddRemove +{ + public static void test_add_remove_event() + { + test.ITesting obj = new test.Testing(); + bool called = true; + + EventHandler<test.Testing.EvtWithIntEvt_Args> evtCb = (object sender, EvtWithIntEvt_Args e) => { + called = true; + }; + + obj.EvtWithIntEvt += evtCb; + obj.EmitEventWithInt(42); + Test.Assert(called); + + called = false; + obj.EvtWithIntEvt -= evtCb; + obj.EmitEventWithInt(42); + Test.Assert(!called); + + + + } +} } |