From 463e3906bdf41951e35269abdbd4341d91fdf5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 18 Aug 2011 10:36:24 +0200 Subject: clean up ecore_event_handler specs --- spec/ecore_spec.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/ecore_spec.rb b/spec/ecore_spec.rb index 66f9d4c..86475ae 100644 --- a/spec/ecore_spec.rb +++ b/spec/ecore_spec.rb @@ -60,6 +60,7 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE ecore_evt.null?.should be_false Ecore.main_loop_begin # process event + Ecore.event_handler_del(evt_handler).address.should == OK.address end # it "should be able to get and set event handler data" do @@ -73,6 +74,7 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE ecore_evt.null?.should be_false Ecore.main_loop_begin # process event + Ecore.event_handler_del(evt_handler).address.should == OK.address end # it "should be able to create new event type" do @@ -111,7 +113,7 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do loop_data.read_string.should == "loop_data" end filter = Ecore.event_filter_add start_cb, filter_cb, end_cb, OK - Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, OK + evt_handler = Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, OK e1 = FFI::MemoryPointer.new(:int) e1.write_int 69 evt1 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e1, event_free_cb, KO @@ -120,6 +122,12 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do evt2 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e2, EVENT_FREE_CB, NONE Ecore.event_filter_del(filter).address.should == OK.address evt2 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e2, EVENT_FREE_CB, NONE + Ecore.event_handler_del(evt_handler).address.should == OK.address + Ecore.main_loop_iterate + Ecore.main_loop_iterate + Ecore.main_loop_iterate + e1.free + e2.free end # describe Efl::Ecore::REcorePipe do -- cgit v1.1-2-g2b99