summaryrefslogtreecommitdiffstats
path: root/spec/ecore_evas_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-27 15:48:45 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-27 15:48:45 +0100
commitef44077310b4ebf8d3cb31ccb57d15b96a94c9d3 (patch)
treec2bb690ccc1be37c03f6dcdcf892fbf3e17f5067 /spec/ecore_evas_spec.rb
parentdbb2c5713e11489dfaeb318a82785017f1794dde (diff)
parentb030c490265bb13ee98a650da419a033495042ed (diff)
downloadffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.zip
ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.tar.gz
Merge branch 'wip'
Conflicts: tools/genruby.rb
Diffstat (limited to 'spec/ecore_evas_spec.rb')
-rw-r--r--spec/ecore_evas_spec.rb50
1 files changed, 28 insertions, 22 deletions
diff --git a/spec/ecore_evas_spec.rb b/spec/ecore_evas_spec.rb
index 7ded12e..859e282 100644
--- a/spec/ecore_evas_spec.rb
+++ b/spec/ecore_evas_spec.rb
@@ -2,6 +2,7 @@
# -*- coding: UTF-8 -*-
#
require 'efl/eina_list'
+require 'efl/ecore'
require 'efl/ecore_evas'
require './spec/helper'
#
@@ -29,7 +30,6 @@ describe 'Efl::EcoreEvas' do
EcoreEvas.engines_free EcoreEvas.engines_get
l = EcoreEvas.engines_list
r = l.inject("\t") do |s,e| s+=e.read_string+' ' end
- puts r
EcoreEvas.engines_free l
end
#
@@ -52,16 +52,17 @@ describe 'Efl::EcoreEvas' do
EcoreEvas.init.should == 2
end
before(:each) do
- @e = EcoreEvas::REcoreEvas.new :engine_name=>"software_x11", :x=>10, :y=>10, :w=>100, :h=>120
+ @e = EcoreEvas::REcoreEvas.new :engine_name=>"software_x11", :x=>10, :y=>10, :w=>100, :h=>120 do
+ move 10, 10
+ show
+ end
@canvas = @e.evas
- @bg = @canvas.object_rectangle_add { |o|
- o.color = 100, 100, 255, 255
- o.size = @e.size
- }
- @bg.show
+ @bg = @canvas.object_rectangle_add do
+ color_set 100, 100, 255, 255
+ show
+ end
+ @bg.size = @e.size
@e.object_associate @bg, :ecore_evas_object_associate_base
- @e.move 10, 10
- @e.show
end
after(:each) do
@e.free
@@ -82,23 +83,34 @@ describe 'Efl::EcoreEvas' do
it "move, resize move_resize and geometry_get (and check association)" do
@e.geometry_get.should == [10,10,100,120]
@bg.geometry_get.should == [0,0,100,120]
- @e.move 20, 20
+ @e.move 50, 50
ecore_loop 3
g = @e.geometry_get
- g.delete_at 1
- g.should == [20,100,120]
+ g[0].should >=50
+ g[0].should <=60
+ g[1].should >=60
+ g[1].should <=80
+ g.delete_at 0
+ g.delete_at 0
+ g.should == [100,120]
@bg.geometry_get.should == [0,0,100,120]
@e.resize 200,150
ecore_loop 3
g = @e.geometry_get
- g.delete_at 1
- g.should == [20,200,150]
+ g.delete_at 0
+ g.delete_at 0
+ g.should == [200,150]
@bg.geometry_get.should == [0,0,200,150]
@e.move_resize 10, 0, 130, 100
ecore_loop 3
g = @e.geometry_get
- g.delete_at 1
- g.should == [10,130,100]
+ g[0].should >=10
+ g[0].should <=20
+ g[1].should >=20
+ g[1].should <=30
+ g.delete_at 0
+ g.delete_at 0
+ g.should == [130,100]
@bg.geometry_get.should == [0,0,130,100]
g = @e.geometry_get
end
@@ -203,12 +215,6 @@ describe 'Efl::EcoreEvas' do
bool_check @e, 'override'
end
#
- # FIXME maximized
- # ecore/src/lib/ecore_evas/ecore_evas.c => ecore_evas_maximized_set => IFC => return
- it "maximized set/get " do
- bool_check @e, 'maximized', 5
- end
- #
it "fullscreen set/get " do
bool_check @e, 'fullscreen', 5
end