summaryrefslogtreecommitdiffstats
path: root/spec/ecore_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-14 08:01:38 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-14 08:01:38 +0200
commit350843476bf1156881a0dd45131f5f6e4efee77f (patch)
tree487f02ccb4ea66551e48edda143ebe34f088dae8 /spec/ecore_spec.rb
parent6a98ff745ba0e8ddb71375396465b5add8e736c9 (diff)
downloadffi-efl-350843476bf1156881a0dd45131f5f6e4efee77f.zip
ffi-efl-350843476bf1156881a0dd45131f5f6e4efee77f.tar.gz
update ecore, use FFIHelper
Diffstat (limited to 'spec/ecore_spec.rb')
-rw-r--r--spec/ecore_spec.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/ecore_spec.rb b/spec/ecore_spec.rb
index d027ab6..96ece40 100644
--- a/spec/ecore_spec.rb
+++ b/spec/ecore_spec.rb
@@ -26,21 +26,19 @@ describe E17::ECORE do
end
#
it 'should write and read data from pipe' do
- ECORE.init
+ data = FFI::MemoryPointer.from_string("none")
cb = Proc.new do |data,buffer,bytes|
data.read_string.should eql 'none'
buffer.read_string.should eql 'hello world'
bytes.should eql 12
end
- data = FFI::MemoryPointer.from_string("none")
- pipe = ECORE.pipe_add cb, data
- buffer = FFI::MemoryPointer.new(:string,128)
- buffer.write_string 'hello world'
- ECORE.pipe_write pipe, buffer, 12
+ ECORE.init
+ pipe = ECORE::EcorePipe.new cb, data
+ pipe.write("hello world").should be_true
ECORE.main_loop_iterate
- ECORE.pipe_read_close pipe
- ECORE.pipe_write_close pipe
- ECORE.pipe_del pipe
+ pipe.read_close
+ pipe.write_close
+ pipe.del.address.should eql data.address
ECORE.shutdown
end
end