mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-05 09:39:14 +08:00
9 lines
285 B
Ruby
9 lines
285 B
Ruby
describe "Pointer" do
|
|
it "can point to C strings" do
|
|
vals = (1..10).to_a
|
|
ptr = Pointer.new(:string, vals.size)
|
|
vals.each_with_index { |v, i| ptr[i] = v.to_s }
|
|
TestMethod.testPointerToStrings(ptr, length:vals.size).should == vals.inject(0) { |m, v| m + v }
|
|
end
|
|
end
|