summaryrefslogtreecommitdiffstats
path: root/spec/eina_list_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-12 11:32:03 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-12 11:32:03 +0200
commitc4c02d3bdd9cecf03667f2e6d152300eb7678e48 (patch)
tree21e978145545a2cf75d3040493861904a5b19e53 /spec/eina_list_spec.rb
parentc18b9432eeabad028cd252d6a983c5abf06d9ac2 (diff)
downloadffi-efl-c4c02d3bdd9cecf03667f2e6d152300eb7678e48.zip
ffi-efl-c4c02d3bdd9cecf03667f2e6d152300eb7678e48.tar.gz
add REinaList#from_a
Diffstat (limited to 'spec/eina_list_spec.rb')
-rw-r--r--spec/eina_list_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/eina_list_spec.rb b/spec/eina_list_spec.rb
index 0cf2501..a51b148 100644
--- a/spec/eina_list_spec.rb
+++ b/spec/eina_list_spec.rb
@@ -79,7 +79,7 @@ describe Efl::EinaList do
l.free
end
#
- it "should be able to build from ruby Array" do
+ it "should be able to build from a ruby Array of pointers" do
a = []
a << ::FFI::MemoryPointer.from_string("D0")
a << ::FFI::MemoryPointer.from_string("D1")
@@ -92,6 +92,15 @@ describe Efl::EinaList do
l.free
end
#
+ it "should be able to build from a ruby Array of int" do
+ a = [3,4,5,6]
+ l = REinaList.from_a a, :int
+ 0.upto 3 do |i|
+ l.nth(i).read_int.should == i+3
+ end
+ l.free
+ end
+ #
it "Enumerable" do
l = REinaList.new
d1 = ::FFI::MemoryPointer.from_string "D0"