blob: f26b29c7030d75ea22fa25cf4244183c1341d0a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
require 'e17/evas'
#
describe E17::EVAS do
#
include E17
#
it "should init" do
EVAS.init.should eql 1
EVAS.init.should eql 2
EVAS.init.should eql 3
end
#
it "should shutdown" do
EVAS.shutdown.should eql 2
EVAS.shutdown.should eql 1
EVAS.shutdown.should eql 0
end
#
it "evas alloc error enum is ok" do
EVAS.enum_value(:none).should eql 0
EVAS.enum_value(:fatal).should eql 1
EVAS.enum_value(:recovered).should eql 2
EVAS.enum_type(:evas_alloc_error)[0].should eql :none
EVAS.enum_type(:evas_alloc_error)[1].should eql :fatal
EVAS.enum_type(:evas_alloc_error)[2].should eql :recovered
EVAS.enum_type(:evas_alloc_error)[:none].should eql 0
EVAS.enum_type(:evas_alloc_error)[:fatal].should eql 1
EVAS.enum_type(:evas_alloc_error)[:recovered].should eql 2
end
#
it "should have no memory allocation error occured" do
EVAS.init
EVAS.alloc_error.should eql :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
|