gir_ffi 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/ffi-glib/array.rb +2 -3
- data/lib/ffi-glib/container_class_methods.rb +3 -4
- data/lib/ffi-glib/hash_table.rb +7 -3
- data/lib/ffi-glib/list_methods.rb +1 -1
- data/lib/ffi-glib/sized_array.rb +66 -0
- data/lib/ffi-glib/strv.rb +1 -1
- data/lib/ffi-glib.rb +5 -4
- data/lib/ffi-gobject/object.rb +2 -3
- data/lib/ffi-gobject/ruby_closure.rb +3 -2
- data/lib/ffi-gobject/value.rb +26 -14
- data/lib/ffi-gobject.rb +8 -5
- data/lib/ffi-gobject_introspection/g_error.rb +1 -0
- data/lib/ffi-gobject_introspection/i_base_info.rb +3 -2
- data/lib/ffi-gobject_introspection/i_union_info.rb +21 -8
- data/lib/ffi-gobject_introspection/lib.rb +1 -0
- data/lib/gir_ffi/argument_builder.rb +8 -20
- data/lib/gir_ffi/base_argument_builder.rb +13 -30
- data/lib/gir_ffi/builder/module.rb +3 -9
- data/lib/gir_ffi/builder/type/base.rb +2 -0
- data/lib/gir_ffi/builder/type/callback.rb +2 -2
- data/lib/gir_ffi/builder/type/enum.rb +1 -0
- data/lib/gir_ffi/builder/type/object.rb +13 -3
- data/lib/gir_ffi/builder/type/registered_type.rb +1 -1
- data/lib/gir_ffi/builder/type/struct.rb +18 -3
- data/lib/gir_ffi/builder/type/unintrospectable.rb +5 -45
- data/lib/gir_ffi/builder/type/user_defined.rb +3 -15
- data/lib/gir_ffi/builder/type.rb +5 -5
- data/lib/gir_ffi/builder.rb +5 -80
- data/lib/gir_ffi/callback.rb +65 -2
- data/lib/gir_ffi/callback_helper.rb +0 -56
- data/lib/gir_ffi/class_base.rb +2 -2
- data/lib/gir_ffi/in_out_pointer.rb +7 -28
- data/lib/gir_ffi/in_pointer.rb +12 -19
- data/lib/gir_ffi/info_ext/i_arg_info.rb +5 -0
- data/lib/gir_ffi/info_ext/i_callable_info.rb +16 -0
- data/lib/gir_ffi/info_ext/i_function_info.rb +15 -0
- data/lib/gir_ffi/info_ext/i_signal_info.rb +17 -10
- data/lib/gir_ffi/info_ext/i_type_info.rb +63 -39
- data/lib/gir_ffi/info_ext.rb +5 -3
- data/lib/gir_ffi/null_argument_builder.rb +1 -1
- data/lib/gir_ffi/return_value_builder.rb +24 -16
- data/lib/gir_ffi/unintrospectable_type_info.rb +41 -0
- data/lib/gir_ffi/user_defined_property_info.rb +15 -0
- data/lib/gir_ffi/user_defined_type_info.rb +25 -0
- data/lib/gir_ffi/version.rb +1 -1
- data/lib/gir_ffi-base.rb +3 -0
- data/lib/gir_ffi.rb +2 -1
- data/test/ffi-glib/sized_array_test.rb +87 -0
- data/test/ffi-gobject_introspection/i_base_info_test.rb +4 -5
- data/test/gir_ffi/argument_builder_test.rb +26 -55
- data/test/gir_ffi/builder/type/unintrospectable_test.rb +3 -19
- data/test/gir_ffi/builder/type/user_defined_test.rb +16 -21
- data/test/gir_ffi/builder_test.rb +31 -53
- data/test/gir_ffi/callback_helper_test.rb +0 -47
- data/test/gir_ffi/callback_test.rb +49 -0
- data/test/gir_ffi/function_builder_test.rb +8 -8
- data/test/gir_ffi/in_out_pointer_test.rb +2 -53
- data/test/gir_ffi/in_pointer_test.rb +0 -13
- data/test/gir_ffi/info_ext/i_callable_info_test.rb +32 -0
- data/test/gir_ffi/info_ext/i_function_info_test.rb +61 -0
- data/test/gir_ffi/info_ext/i_signal_info_test.rb +7 -0
- data/test/gir_ffi/info_ext/i_type_info_test.rb +158 -77
- data/test/gir_ffi/return_value_builder_test.rb +2 -2
- data/test/gir_ffi/unintrospectable_type_info_test.rb +95 -0
- data/test/gir_ffi/user_defined_property_info_test.rb +19 -0
- data/test/gir_ffi/user_defined_type_info_test.rb +34 -0
- data/test/integration/generated_gimarshallingtests_test.rb +10 -10
- data/test/integration/generated_regress_test.rb +10 -10
- metadata +24 -15
- data/lib/gir_ffi/builder/type/struct_based.rb +0 -31
- data/lib/gir_ffi/user_defined/i_base_info.rb +0 -7
- data/lib/gir_ffi/user_defined/i_object_info.rb +0 -13
- data/lib/gir_ffi/user_defined/i_property_info.rb +0 -9
- data/lib/gir_ffi/user_defined/i_registered_type_info.rb +0 -10
- data/test/gir_ffi/user_defined/i_object_info_test.rb +0 -18
- data/test/gir_ffi/user_defined/i_property_info_test.rb +0 -14
- data/test/gir_ffi/user_defined/i_registered_type_info_test.rb +0 -10
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'gir_ffi_test_helper'
|
2
|
+
require 'gir_ffi/user_defined_type_info'
|
3
|
+
|
4
|
+
describe GirFFI::UserDefinedTypeInfo do
|
5
|
+
describe "#described_class" do
|
6
|
+
it "returns the class passed to #initialize" do
|
7
|
+
info = GirFFI::UserDefinedTypeInfo.new :some_class
|
8
|
+
info.described_class.must_equal :some_class
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "#install_property" do
|
13
|
+
it "adds the passed in property to the list of properties" do
|
14
|
+
mock(foo_spec = Object.new).get_name { :foo }
|
15
|
+
|
16
|
+
info = GirFFI::UserDefinedTypeInfo.new :some_class
|
17
|
+
info.install_property foo_spec
|
18
|
+
info.properties.map(&:name).must_equal [:foo]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#initialize" do
|
23
|
+
it "takes a block that is evaluated in the context of the instance" do
|
24
|
+
mock(foo_spec = Object.new).get_name { :foo }
|
25
|
+
mock(bar_spec = Object.new).get_name { :bar }
|
26
|
+
|
27
|
+
info = GirFFI::UserDefinedTypeInfo.new :some_class do
|
28
|
+
install_property foo_spec
|
29
|
+
install_property bar_spec
|
30
|
+
end
|
31
|
+
info.properties.map(&:name).must_equal [:foo, :bar]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -301,17 +301,17 @@ describe GIMarshallingTests do
|
|
301
301
|
|
302
302
|
it "has a working method #method_array_inout" do
|
303
303
|
res = instance.method_array_inout [-1, 0, 1, 2]
|
304
|
-
assert_equal [-2, -1, 0, 1, 2], res
|
304
|
+
assert_equal [-2, -1, 0, 1, 2], res.to_a
|
305
305
|
end
|
306
306
|
|
307
307
|
it "has a working method #method_array_out" do
|
308
308
|
res = instance.method_array_out
|
309
|
-
assert_equal [-1, 0, 1, 2], res
|
309
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
310
310
|
end
|
311
311
|
|
312
312
|
it "has a working method #method_array_return" do
|
313
313
|
res = instance.method_array_return
|
314
|
-
assert_equal [-1, 0, 1, 2], res
|
314
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
315
315
|
end
|
316
316
|
|
317
317
|
it "has a working method #method_int8_in" do
|
@@ -609,7 +609,7 @@ describe GIMarshallingTests do
|
|
609
609
|
|
610
610
|
it "has a working function #array_fixed_inout" do
|
611
611
|
res = GIMarshallingTests.array_fixed_inout [-1, 0, 1, 2]
|
612
|
-
assert_equal [2, 1, 0, -1], res
|
612
|
+
assert_equal [2, 1, 0, -1], res.to_a
|
613
613
|
end
|
614
614
|
|
615
615
|
it "has a working function #array_fixed_int_in" do
|
@@ -619,12 +619,12 @@ describe GIMarshallingTests do
|
|
619
619
|
|
620
620
|
it "has a working function #array_fixed_int_return" do
|
621
621
|
res = GIMarshallingTests.array_fixed_int_return
|
622
|
-
assert_equal [-1, 0, 1, 2], res
|
622
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
623
623
|
end
|
624
624
|
|
625
625
|
it "has a working function #array_fixed_out" do
|
626
626
|
res = GIMarshallingTests.array_fixed_out
|
627
|
-
assert_equal [-1, 0, 1, 2], res
|
627
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
628
628
|
end
|
629
629
|
|
630
630
|
it "has a working function #array_fixed_out_struct" do
|
@@ -639,7 +639,7 @@ describe GIMarshallingTests do
|
|
639
639
|
|
640
640
|
it "has a working function #array_fixed_short_return" do
|
641
641
|
res = GIMarshallingTests.array_fixed_short_return
|
642
|
-
assert_equal [-1, 0, 1, 2], res
|
642
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
643
643
|
end
|
644
644
|
|
645
645
|
it "has a working function #array_gvariant_container_in" do
|
@@ -684,7 +684,7 @@ describe GIMarshallingTests do
|
|
684
684
|
|
685
685
|
it "has a working function #array_inout" do
|
686
686
|
res = GIMarshallingTests.array_inout [-1, 0, 1, 2]
|
687
|
-
assert_equal [-2, -1, 0, 1, 2], res
|
687
|
+
assert_equal [-2, -1, 0, 1, 2], res.to_a
|
688
688
|
end
|
689
689
|
|
690
690
|
it "has a working function #array_inout_etc" do
|
@@ -693,7 +693,7 @@ describe GIMarshallingTests do
|
|
693
693
|
|
694
694
|
it "has a working function #array_out" do
|
695
695
|
res = GIMarshallingTests.array_out
|
696
|
-
assert_equal [-1, 0, 1, 2], res
|
696
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
697
697
|
end
|
698
698
|
|
699
699
|
it "has a working function #array_out_etc" do
|
@@ -702,7 +702,7 @@ describe GIMarshallingTests do
|
|
702
702
|
|
703
703
|
it "has a working function #array_return" do
|
704
704
|
res = GIMarshallingTests.array_return
|
705
|
-
assert_equal [-1, 0, 1, 2], res
|
705
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
706
706
|
end
|
707
707
|
|
708
708
|
it "has a working function #array_return_etc" do
|
@@ -885,9 +885,9 @@ describe Regress do
|
|
885
885
|
|
886
886
|
it "has a working method #set_testbool" do
|
887
887
|
instance.set_testbool true
|
888
|
-
assert_equal
|
888
|
+
assert_equal true, get_field_value(instance, :testbool)
|
889
889
|
instance.set_testbool false
|
890
|
-
assert_equal
|
890
|
+
assert_equal false, get_field_value(instance, :testbool)
|
891
891
|
end
|
892
892
|
|
893
893
|
describe "an instance" do
|
@@ -953,7 +953,7 @@ describe Regress do
|
|
953
953
|
end
|
954
954
|
|
955
955
|
it "has a working function #test_array_fixed_out_objects" do
|
956
|
-
result = Regress.test_array_fixed_out_objects
|
956
|
+
result = Regress.test_array_fixed_out_objects.to_a
|
957
957
|
|
958
958
|
assert_equal 2, result.length
|
959
959
|
|
@@ -980,11 +980,11 @@ describe Regress do
|
|
980
980
|
end
|
981
981
|
|
982
982
|
it "has a working function #test_array_fixed_size_int_out" do
|
983
|
-
assert_equal [0, 1, 2, 3, 4], Regress.test_array_fixed_size_int_out
|
983
|
+
assert_equal [0, 1, 2, 3, 4], Regress.test_array_fixed_size_int_out.to_a
|
984
984
|
end
|
985
985
|
|
986
986
|
it "has a working function #test_array_fixed_size_int_return" do
|
987
|
-
assert_equal [0, 1, 2, 3, 4], Regress.test_array_fixed_size_int_return
|
987
|
+
assert_equal [0, 1, 2, 3, 4], Regress.test_array_fixed_size_int_return.to_a
|
988
988
|
end
|
989
989
|
|
990
990
|
it "has a working function #test_array_gint16_in" do
|
@@ -1010,7 +1010,7 @@ describe Regress do
|
|
1010
1010
|
end
|
1011
1011
|
|
1012
1012
|
it "has a working function #test_array_int_full_out" do
|
1013
|
-
assert_equal [0, 1, 2, 3, 4], Regress.test_array_int_full_out
|
1013
|
+
assert_equal [0, 1, 2, 3, 4], Regress.test_array_int_full_out.to_a
|
1014
1014
|
end
|
1015
1015
|
|
1016
1016
|
it "has a working function #test_array_int_in" do
|
@@ -1018,11 +1018,11 @@ describe Regress do
|
|
1018
1018
|
end
|
1019
1019
|
|
1020
1020
|
it "has a working function #test_array_int_inout" do
|
1021
|
-
assert_equal [3, 4], Regress.test_array_int_inout([5, 2, 3])
|
1021
|
+
assert_equal [3, 4], Regress.test_array_int_inout([5, 2, 3]).to_a
|
1022
1022
|
end
|
1023
1023
|
|
1024
1024
|
it "has a working function #test_array_int_none_out" do
|
1025
|
-
assert_equal [1, 2, 3, 4, 5], Regress.test_array_int_none_out
|
1025
|
+
assert_equal [1, 2, 3, 4, 5], Regress.test_array_int_none_out.to_a
|
1026
1026
|
end
|
1027
1027
|
|
1028
1028
|
it "has a working function #test_array_int_null_in" do
|
@@ -1034,7 +1034,7 @@ describe Regress do
|
|
1034
1034
|
end
|
1035
1035
|
|
1036
1036
|
it "has a working function #test_array_int_out" do
|
1037
|
-
assert_equal [0, 1, 2, 3, 4], Regress.test_array_int_out
|
1037
|
+
assert_equal [0, 1, 2, 3, 4], Regress.test_array_int_out.to_a
|
1038
1038
|
end
|
1039
1039
|
|
1040
1040
|
it "has a working function #test_async_ready_callback" do
|
@@ -1664,7 +1664,7 @@ describe Regress do
|
|
1664
1664
|
begin
|
1665
1665
|
Regress.this_method_does_not_exist
|
1666
1666
|
rescue => e
|
1667
|
-
|
1667
|
+
e.message.must_match(/^undefined method `this_method_does_not_exist' (for Regress:Module|on Regress \(Module\))$/)
|
1668
1668
|
end
|
1669
1669
|
end
|
1670
1670
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gir_ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.8'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
29
|
+
version: '1.8'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: indentation
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,7 +115,6 @@ files:
|
|
115
115
|
- lib/gir_ffi/builder/type/object.rb
|
116
116
|
- lib/gir_ffi/builder/type/with_methods.rb
|
117
117
|
- lib/gir_ffi/builder/type/with_layout.rb
|
118
|
-
- lib/gir_ffi/builder/type/struct_based.rb
|
119
118
|
- lib/gir_ffi/builder/type/enum.rb
|
120
119
|
- lib/gir_ffi/builder/type/interface.rb
|
121
120
|
- lib/gir_ffi/builder/type/registered_type.rb
|
@@ -129,12 +128,10 @@ files:
|
|
129
128
|
- lib/gir_ffi/info_ext.rb
|
130
129
|
- lib/gir_ffi/allocation_helper.rb
|
131
130
|
- lib/gir_ffi/type_map.rb
|
132
|
-
- lib/gir_ffi/user_defined/i_property_info.rb
|
133
|
-
- lib/gir_ffi/user_defined/i_base_info.rb
|
134
|
-
- lib/gir_ffi/user_defined/i_object_info.rb
|
135
|
-
- lib/gir_ffi/user_defined/i_registered_type_info.rb
|
136
131
|
- lib/gir_ffi/zero_terminated.rb
|
132
|
+
- lib/gir_ffi/unintrospectable_type_info.rb
|
137
133
|
- lib/gir_ffi/callback.rb
|
134
|
+
- lib/gir_ffi/user_defined_property_info.rb
|
138
135
|
- lib/gir_ffi/argument_builder.rb
|
139
136
|
- lib/gir_ffi/error_argument_builder.rb
|
140
137
|
- lib/gir_ffi/ffi_ext/pointer.rb
|
@@ -151,6 +148,8 @@ files:
|
|
151
148
|
- lib/gir_ffi/interface_base.rb
|
152
149
|
- lib/gir_ffi/info_ext/i_arg_info.rb
|
153
150
|
- lib/gir_ffi/info_ext/i_type_info.rb
|
151
|
+
- lib/gir_ffi/info_ext/i_function_info.rb
|
152
|
+
- lib/gir_ffi/info_ext/i_callable_info.rb
|
154
153
|
- lib/gir_ffi/info_ext/i_field_info.rb
|
155
154
|
- lib/gir_ffi/info_ext/safe_constant_name.rb
|
156
155
|
- lib/gir_ffi/info_ext/i_property_info.rb
|
@@ -159,6 +158,7 @@ files:
|
|
159
158
|
- lib/gir_ffi/info_ext/i_registered_type_info.rb
|
160
159
|
- lib/gir_ffi/module_base.rb
|
161
160
|
- lib/gir_ffi/base_argument_builder.rb
|
161
|
+
- lib/gir_ffi/user_defined_type_info.rb
|
162
162
|
- lib/gir_ffi/class_base.rb
|
163
163
|
- lib/gir_ffi/object_base.rb
|
164
164
|
- lib/gir_ffi/function_builder.rb
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- lib/ffi-glib/strv.rb
|
181
181
|
- lib/ffi-glib/byte_array.rb
|
182
182
|
- lib/ffi-glib/ptr_array.rb
|
183
|
+
- lib/ffi-glib/sized_array.rb
|
183
184
|
- lib/ffi-glib/s_list.rb
|
184
185
|
- lib/ffi-gobject_introspection/i_struct_info.rb
|
185
186
|
- lib/ffi-gobject_introspection/i_callback_info.rb
|
@@ -226,11 +227,9 @@ files:
|
|
226
227
|
- test/gir_ffi/builder/type/unintrospectable_test.rb
|
227
228
|
- test/gir_ffi/builder/type/interface_test.rb
|
228
229
|
- test/gir_ffi/builder/module_test.rb
|
230
|
+
- test/gir_ffi/user_defined_property_info_test.rb
|
229
231
|
- test/gir_ffi/zero_terminated_test.rb
|
230
232
|
- test/gir_ffi/object_base_test.rb
|
231
|
-
- test/gir_ffi/user_defined/i_registered_type_info_test.rb
|
232
|
-
- test/gir_ffi/user_defined/i_object_info_test.rb
|
233
|
-
- test/gir_ffi/user_defined/i_property_info_test.rb
|
234
233
|
- test/gir_ffi/builder_test.rb
|
235
234
|
- test/gir_ffi/in_pointer_test.rb
|
236
235
|
- test/gir_ffi/in_out_pointer_test.rb
|
@@ -238,16 +237,21 @@ files:
|
|
238
237
|
- test/gir_ffi/function_builder_test.rb
|
239
238
|
- test/gir_ffi/variable_name_generator_test.rb
|
240
239
|
- test/gir_ffi/callback_helper_test.rb
|
240
|
+
- test/gir_ffi/callback_test.rb
|
241
241
|
- test/gir_ffi/base_argument_builder_test.rb
|
242
242
|
- test/gir_ffi/class_base_test.rb
|
243
243
|
- test/gir_ffi/argument_builder_test.rb
|
244
244
|
- test/gir_ffi/return_value_builder_test.rb
|
245
|
+
- test/gir_ffi/user_defined_type_info_test.rb
|
246
|
+
- test/gir_ffi/unintrospectable_type_info_test.rb
|
247
|
+
- test/gir_ffi/info_ext/i_callable_info_test.rb
|
245
248
|
- test/gir_ffi/info_ext/i_type_info_test.rb
|
246
249
|
- test/gir_ffi/info_ext/i_arg_info_test.rb
|
247
250
|
- test/gir_ffi/info_ext/i_signal_info_test.rb
|
248
251
|
- test/gir_ffi/info_ext/safe_constant_name_test.rb
|
249
252
|
- test/gir_ffi/info_ext/safe_function_name_test.rb
|
250
253
|
- test/gir_ffi/info_ext/i_field_info_test.rb
|
254
|
+
- test/gir_ffi/info_ext/i_function_info_test.rb
|
251
255
|
- test/gir_ffi/interface_base_test.rb
|
252
256
|
- test/gir_ffi-base/glib/strv_test.rb
|
253
257
|
- test/ffi-gobject/object_class_test.rb
|
@@ -263,6 +267,7 @@ files:
|
|
263
267
|
- test/ffi-glib/ptr_array_test.rb
|
264
268
|
- test/ffi-glib/byte_array_test.rb
|
265
269
|
- test/ffi-glib/ruby_closure_test.rb
|
270
|
+
- test/ffi-glib/sized_array_test.rb
|
266
271
|
- test/ffi-gobject_introspection/i_repository_test.rb
|
267
272
|
- test/ffi-gobject_introspection/i_constant_info_test.rb
|
268
273
|
- test/ffi-gobject_introspection/i_base_info_test.rb
|
@@ -321,6 +326,7 @@ test_files:
|
|
321
326
|
- test/ffi-glib/ptr_array_test.rb
|
322
327
|
- test/ffi-glib/ruby_closure_test.rb
|
323
328
|
- test/ffi-glib/s_list_test.rb
|
329
|
+
- test/ffi-glib/sized_array_test.rb
|
324
330
|
- test/ffi-gobject/gobject_test.rb
|
325
331
|
- test/ffi-gobject/object_class_test.rb
|
326
332
|
- test/ffi-gobject/object_test.rb
|
@@ -349,12 +355,15 @@ test_files:
|
|
349
355
|
- test/gir_ffi/builder/type/user_defined_test.rb
|
350
356
|
- test/gir_ffi/builder_test.rb
|
351
357
|
- test/gir_ffi/callback_helper_test.rb
|
358
|
+
- test/gir_ffi/callback_test.rb
|
352
359
|
- test/gir_ffi/class_base_test.rb
|
353
360
|
- test/gir_ffi/function_builder_test.rb
|
354
361
|
- test/gir_ffi/in_out_pointer_test.rb
|
355
362
|
- test/gir_ffi/in_pointer_test.rb
|
356
363
|
- test/gir_ffi/info_ext/i_arg_info_test.rb
|
364
|
+
- test/gir_ffi/info_ext/i_callable_info_test.rb
|
357
365
|
- test/gir_ffi/info_ext/i_field_info_test.rb
|
366
|
+
- test/gir_ffi/info_ext/i_function_info_test.rb
|
358
367
|
- test/gir_ffi/info_ext/i_signal_info_test.rb
|
359
368
|
- test/gir_ffi/info_ext/i_type_info_test.rb
|
360
369
|
- test/gir_ffi/info_ext/safe_constant_name_test.rb
|
@@ -362,9 +371,9 @@ test_files:
|
|
362
371
|
- test/gir_ffi/interface_base_test.rb
|
363
372
|
- test/gir_ffi/object_base_test.rb
|
364
373
|
- test/gir_ffi/return_value_builder_test.rb
|
365
|
-
- test/gir_ffi/
|
366
|
-
- test/gir_ffi/
|
367
|
-
- test/gir_ffi/
|
374
|
+
- test/gir_ffi/unintrospectable_type_info_test.rb
|
375
|
+
- test/gir_ffi/user_defined_property_info_test.rb
|
376
|
+
- test/gir_ffi/user_defined_type_info_test.rb
|
368
377
|
- test/gir_ffi/variable_name_generator_test.rb
|
369
378
|
- test/gir_ffi/zero_terminated_test.rb
|
370
379
|
- test/gir_ffi_test.rb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'gir_ffi/builder/type/registered_type'
|
2
|
-
require 'gir_ffi/builder/type/with_layout'
|
3
|
-
require 'gir_ffi/builder/type/with_methods'
|
4
|
-
|
5
|
-
module GirFFI
|
6
|
-
module Builder
|
7
|
-
module Type
|
8
|
-
|
9
|
-
# Implements the creation of a class representing one of the types
|
10
|
-
# whose C representation is a struct, i.e., :object and :struct.
|
11
|
-
class StructBased < RegisteredType
|
12
|
-
include WithMethods
|
13
|
-
include WithLayout
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def setup_class
|
18
|
-
setup_layout
|
19
|
-
setup_constants
|
20
|
-
stub_methods
|
21
|
-
setup_gtype_getter
|
22
|
-
setup_field_accessors
|
23
|
-
end
|
24
|
-
|
25
|
-
def layout_superclass
|
26
|
-
FFI::Struct
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'gir_ffi_test_helper'
|
2
|
-
|
3
|
-
describe GirFFI::UserDefined::IObjectInfo do
|
4
|
-
it "has the attribute #properties" do
|
5
|
-
inf = GirFFI::UserDefined::IObjectInfo.new
|
6
|
-
inf.properties.must_equal []
|
7
|
-
inf.properties << :foo
|
8
|
-
inf.properties.must_equal [:foo]
|
9
|
-
inf.properties = [:bar, :baz]
|
10
|
-
inf.properties.must_equal [:bar, :baz]
|
11
|
-
end
|
12
|
-
|
13
|
-
it "derives from GirFFI::UserDefined::IRegisteredTypeInfo" do
|
14
|
-
inf = GirFFI::UserDefined::IObjectInfo.new
|
15
|
-
inf.must_be_kind_of GirFFI::UserDefined::IRegisteredTypeInfo
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'gir_ffi_test_helper'
|
2
|
-
|
3
|
-
describe GirFFI::UserDefined::IPropertyInfo do
|
4
|
-
it "has the attribute #property_type" do
|
5
|
-
inf = GirFFI::UserDefined::IPropertyInfo.new
|
6
|
-
inf.property_type = :foo
|
7
|
-
inf.property_type.must_equal :foo
|
8
|
-
end
|
9
|
-
|
10
|
-
it "derives from GirFFI::UserDefined::IBaseInfo" do
|
11
|
-
inf = GirFFI::UserDefined::IPropertyInfo.new
|
12
|
-
inf.must_be_kind_of GirFFI::UserDefined::IBaseInfo
|
13
|
-
end
|
14
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
require 'gir_ffi_test_helper'
|
2
|
-
|
3
|
-
describe GirFFI::UserDefined::IRegisteredTypeInfo do
|
4
|
-
it "derives from GirFFI::UserDefined::IBaseInfo" do
|
5
|
-
inf = GirFFI::UserDefined::IRegisteredTypeInfo.new
|
6
|
-
inf.must_be_kind_of GirFFI::UserDefined::IBaseInfo
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
|