summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy.zurcher@heraeus.com>2011-04-12 15:47:04 +0200
committerJérémy Zurcher <jeremy.zurcher@heraeus.com>2011-04-12 15:47:04 +0200
commit131839bfb26fadebc32ce86c10784e2ca2647bbc (patch)
tree6cde12217022eb41623e518e410d0beff83f092e
parentf36207c23b10c53bc74a5054b824bf6d80a21025 (diff)
downloadffi-efl-131839bfb26fadebc32ce86c10784e2ca2647bbc.zip
ffi-efl-131839bfb26fadebc32ce86c10784e2ca2647bbc.tar.gz
ecore_event_sepc.rb : use constant for FFI::MemoryPointer
-rw-r--r--spec/ecore_event_spec.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/ecore_event_spec.rb b/spec/ecore_event_spec.rb
index 7da5bfd..a61e4c8 100644
--- a/spec/ecore_event_spec.rb
+++ b/spec/ecore_event_spec.rb
@@ -1,6 +1,7 @@
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
+require 'efl/ecore'
require 'efl/ecore/event'
#
describe EFL::ECORE do
@@ -20,6 +21,8 @@ describe EFL::ECORE do
data.read_string.should eql "none"
event.read_int.should eql 666
end
+ NONE = "none"
+ NONE_PTR = FFI::MemoryPointer.from_string NONE
end
#
it 'should be able to add event hanlder and process event' do
@@ -33,10 +36,10 @@ describe EFL::ECORE do
evt_handler = ECORE.event_handler_add ECORE::EVENT_SIGNAL_USER, USER_SIGNAL_CB, "666"
evt_handler.null?.should be_false
# add, del, add event
- ecore_evt = ECORE.event_add ECORE::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, FFI::MemoryPointer.from_string("none")
+ ecore_evt = ECORE.event_add ECORE::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE_PTR
ecore_evt.null?.should be_false
ECORE.event_del ecore_evt
- ecore_evt = ECORE.event_add ECORE::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, FFI::MemoryPointer.from_string("none")
+ ecore_evt = ECORE.event_add ECORE::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE_PTR
ecore_evt.null?.should be_false
ECORE.main_loop_begin # process event
ECORE.shutdown
@@ -51,7 +54,7 @@ describe EFL::ECORE do
ECORE.event_handler_data_get(evt_handler).read_string.should eql "wrong"
ECORE.event_handler_data_set evt_handler, FFI::MemoryPointer.from_string("666")
ECORE.event_handler_data_get(evt_handler).read_string.should eql "666"
- ecore_evt = ECORE.event_add ECORE::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, FFI::MemoryPointer.from_string("none")
+ ecore_evt = ECORE.event_add ECORE::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE_PTR
ecore_evt.null?.should be_false
ECORE.main_loop_begin # process event
ECORE.shutdown