summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-04 23:42:07 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-04 23:42:07 +0200
commite4baccaefd209a25daa3ff8d5277fe86aca1d379 (patch)
treeeb2744b7a8624a7538cb0224d40879074c819653 /spec
parent3974ea1fb3734cbf4150c759eebdf8a93d77dc8b (diff)
downloadffi-efl-e4baccaefd209a25daa3ff8d5277fe86aca1d379.zip
ffi-efl-e4baccaefd209a25daa3ff8d5277fe86aca1d379.tar.gz
FFI are in separate namespaces (Efl::Evas::Native), ruby classes are in upper level (Efl::Evas)seperate-natives
Diffstat (limited to 'spec')
-rw-r--r--spec/ecore_getopt_spec.rb2
-rw-r--r--spec/eet_spec.rb14
-rw-r--r--spec/eina_hash_spec.rb2
-rw-r--r--spec/evas_spec.rb42
4 files changed, 30 insertions, 30 deletions
diff --git a/spec/ecore_getopt_spec.rb b/spec/ecore_getopt_spec.rb
index 997eb4a..62916c1 100644
--- a/spec/ecore_getopt_spec.rb
+++ b/spec/ecore_getopt_spec.rb
@@ -49,7 +49,7 @@ describe Efl::EcoreGetopt do
@p.help 'H', 'help'
@p.value :boolp, @values[:help]
# FIXME debug callback : ecore_getopt_callback_ecore_evas_list_engines
- @p.callback_noargs 'E', 'list-engines', 'list ecore-evas available engines', Efl::EcoreEvas.method(:ecore_getopt_callback_ecore_evas_list_engines), FFI::Pointer::NULL
+ @p.callback_noargs 'E', 'list-engines', 'list ecore-evas available engines', Efl::EcoreEvas::Native.method(:ecore_getopt_callback_ecore_evas_list_engines), FFI::Pointer::NULL
@p.value :boolp, @values[:engines]
@p.store_type :int, 'i', 'int', 'store an integer'
@p.value :intp, @values[:int]
diff --git a/spec/eet_spec.rb b/spec/eet_spec.rb
index a0c195c..89da878 100644
--- a/spec/eet_spec.rb
+++ b/spec/eet_spec.rb
@@ -31,10 +31,10 @@ describe Efl::Eet do
end
#
it "should have good enums" do
- Eet.enum_type(:eet_file_mode)[:eet_file_mode_invalid].should == -1
- Eet.enum_type(:eet_file_mode)[:eet_file_mode_read].should == 0
- Eet.enum_type(:eet_file_mode)[:eet_file_mode_write].should == 1
- Eet.enum_type(:eet_file_mode)[:eet_file_mode_read_write].should == 2
+ Eet::Native.enum_type(:eet_file_mode)[:eet_file_mode_invalid].should == -1
+ Eet::Native.enum_type(:eet_file_mode)[:eet_file_mode_read].should == 0
+ Eet::Native.enum_type(:eet_file_mode)[:eet_file_mode_write].should == 1
+ Eet::Native.enum_type(:eet_file_mode)[:eet_file_mode_read_write].should == 2
end
#
describe Efl::Eet::REetFile do
@@ -42,15 +42,15 @@ describe Efl::Eet do
after(:each) { Eet.shutdown }
#
it "should open and close" do
- f = REetFile.open FP, Eet.enum_type(:eet_file_mode)[:eet_file_mode_write]
+ f = REetFile.open FP, Eet::Native.enum_type(:eet_file_mode)[:eet_file_mode_write]
f.write 'fake', 'value'
f.close
end
#
it "should be able to get file access mode" do
- Eet.enum_type(:eet_file_mode).symbols.each do |m|
+ Eet::Native.enum_type(:eet_file_mode).symbols.each do |m|
next if m==:eet_file_mode_invalid
- REetFile.open FP, Eet.enum_type(:eet_file_mode)[m] do |f|
+ REetFile.open FP, Eet::Native.enum_type(:eet_file_mode)[m] do |f|
f.mode_get.should == m
end
end
diff --git a/spec/eina_hash_spec.rb b/spec/eina_hash_spec.rb
index 4d1526c..fbf8985 100644
--- a/spec/eina_hash_spec.rb
+++ b/spec/eina_hash_spec.rb
@@ -169,7 +169,7 @@ describe Efl::EinaHash do
#
it "alternate constructor should work" do
cstr_cnt = 0
- h = REinaHash.new { cstr_cnt+=1; Efl::EinaHash.eina_hash_string_superfast_new FFI::Pointer::NULL }
+ h = REinaHash.new { cstr_cnt+=1; Efl::EinaHash::Native.eina_hash_string_superfast_new FFI::Pointer::NULL }
cstr_cnt.should == 1
end
end
diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb
index 9a3749c..728935b 100644
--- a/spec/evas_spec.rb
+++ b/spec/evas_spec.rb
@@ -21,15 +21,15 @@ describe Efl::Evas do
end
#
it "evas alloc error enum is ok" do
- Efl::Evas.enum_value(:evas_alloc_error_none).should == 0
- Efl::Evas.enum_value(:evas_alloc_error_fatal).should == 1
- Efl::Evas.enum_value(:evas_alloc_error_recovered).should == 2
- Efl::Evas.enum_type(:evas_alloc_error)[0].should == :evas_alloc_error_none
- Efl::Evas.enum_type(:evas_alloc_error)[1].should == :evas_alloc_error_fatal
- Efl::Evas.enum_type(:evas_alloc_error)[2].should == :evas_alloc_error_recovered
- Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_none].should == 0
- Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_fatal].should == 1
- Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_recovered].should == 2
+ Evas::Native.enum_value(:evas_alloc_error_none).should == 0
+ Evas::Native.enum_value(:evas_alloc_error_fatal).should == 1
+ Evas::Native.enum_value(:evas_alloc_error_recovered).should == 2
+ Evas::Native.enum_type(:evas_alloc_error)[0].should == :evas_alloc_error_none
+ Evas::Native.enum_type(:evas_alloc_error)[1].should == :evas_alloc_error_fatal
+ Evas::Native.enum_type(:evas_alloc_error)[2].should == :evas_alloc_error_recovered
+ Evas::Native.enum_type(:evas_alloc_error)[:evas_alloc_error_none].should == 0
+ Evas::Native.enum_type(:evas_alloc_error)[:evas_alloc_error_fatal].should == 1
+ Evas::Native.enum_type(:evas_alloc_error)[:evas_alloc_error_recovered].should == 2
end
#
it "should have no memory allocation error occured" do
@@ -63,7 +63,7 @@ describe Efl::Evas do
@e.output_method_set Evas::render_method_lookup("buffer")
@e.output_viewport_set 0, 0, @width, @height
@e.output_size_set @width, @height
- einfo = Efl::Evas::EngineInfoBufferStruct.new @e.engine_info_get
+ einfo = Evas::Native::EngineInfoBufferStruct.new @e.engine_info_get
einfo[:info][:depth_type] = Efl::Evas::EVAS_ENGINE_BUFFER_DEPTH_ARGB32
einfo[:info][:dest_buffer] = @pixels
einfo[:info][:dest_buffer_row_bytes] = @width * FFI::type_size(:int);
@@ -90,7 +90,7 @@ describe Efl::Evas do
e1.to_ptr.should be_nil
e2.free
e2.free
- e4 = Evas::REvas.new Evas.evas_new
+ e4 = Evas::REvas.new Evas::Native.evas_new
e4.address.should_not == 0
e5 = e4.dup
e4.address.should == e5.address
@@ -101,14 +101,14 @@ describe Efl::Evas do
end
#
it "focus should work" do
- Efl::Evas.evas_focus_in @e.to_ptr
- Efl::Evas.evas_focus_state_get(@e.to_ptr).should be_true
- Efl::Evas.evas_focus_out @e.to_ptr
- Efl::Evas.evas_focus_state_get(@e.to_ptr).should be_false
- Efl::Evas.focus_in @e.to_ptr
- Efl::Evas.focus_state_get(@e.to_ptr).should be_true
- Efl::Evas.focus_out @e.to_ptr
- Efl::Evas.focus_state_get(@e.to_ptr).should be_false
+ Evas::Native.evas_focus_in @e.to_ptr
+ Evas::Native.evas_focus_state_get(@e.to_ptr).should be_true
+ Evas::Native.evas_focus_out @e.to_ptr
+ Evas::Native.evas_focus_state_get(@e.to_ptr).should be_false
+ Evas.focus_in @e.to_ptr
+ Evas.focus_state_get(@e.to_ptr).should be_true
+ Evas.focus_out @e.to_ptr
+ Evas.focus_state_get(@e.to_ptr).should be_false
@e.focus_in { |r| r.should be_nil }
@e.focus_state_get.should be_true
@e.focus_state_get { |r| r.should be_true }
@@ -142,7 +142,7 @@ describe Efl::Evas do
it "output method should work" do
@e.output_method_get.should == Evas::render_method_lookup("buffer")
# output_method_set tested in before(:all)
- l = Efl::Evas::render_method_list
+ l = Efl::Evas.render_method_list
Evas::render_method_list_free l
end
#
@@ -268,7 +268,7 @@ describe Efl::Evas do
@e.output_method_set Evas.render_method_lookup("buffer")
@e.output_viewport_set 0, 0, 100, 100
@e.output_size_set 100, 100
- einfo = Efl::Evas::EngineInfoBufferStruct.new @e.engine_info_get
+ einfo = Evas::Native::EngineInfoBufferStruct.new @e.engine_info_get
einfo[:info][:depth_type] = Efl::Evas::EVAS_ENGINE_BUFFER_DEPTH_ARGB32
einfo[:info][:dest_buffer] = @pixels
einfo[:info][:dest_buffer_row_bytes] = 100 * FFI::type_size(:int);