diff options
author | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2011-04-12 15:46:23 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2011-04-12 15:46:23 +0200 |
commit | f36207c23b10c53bc74a5054b824bf6d80a21025 (patch) | |
tree | bcd73247023cdc94f8b1c2e787cc21809cafcdf8 /spec | |
parent | dfee89d3a7aef90cc3ec4c62552becb10fa00cbe (diff) | |
download | ffi-efl-f36207c23b10c53bc74a5054b824bf6d80a21025.zip ffi-efl-f36207c23b10c53bc74a5054b824bf6d80a21025.tar.gz |
add async functions and spec to evas
Diffstat (limited to 'spec')
-rw-r--r-- | spec/evas_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb index 815c4a1..c04cd9f 100644 --- a/spec/evas_spec.rb +++ b/spec/evas_spec.rb @@ -19,4 +19,24 @@ describe EFL::EVAS do EVAS.shutdown.should eql 0 end # + it "should have no memory allocation error occured" do + EVAS.init + EVAS.alloc_error.should eql EVAS::ALLOC_ERROR_NONE + EVAS.shutdown + end + # + it "should process async events" do + cb = Proc.new do |target,type,evt| + target.read_string.should eql "target" + type.should eql 0 + evt.read_string.should eql "work" + end + EVAS.init + target = FFI::MemoryPointer.from_string("target") + work = FFI::MemoryPointer.from_string("work") + EVAS.async_events_put target, 0, work, cb + EVAS.async_events_process.should eql 1 + EVAS.async_events_process.should eql 0 + EVAS.shutdown + end end |