gir_ffi 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/History.txt +8 -0
  2. data/README.md +1 -1
  3. data/TODO.rdoc +12 -4
  4. data/lib/ffi-glib.rb +0 -5
  5. data/lib/ffi-glib/list.rb +1 -1
  6. data/lib/ffi-glib/s_list.rb +1 -1
  7. data/lib/ffi-gobject.rb +2 -3
  8. data/lib/ffi-gobject/closure.rb +4 -3
  9. data/lib/ffi-gobject_introspection/i_base_info.rb +11 -14
  10. data/lib/ffi-gobject_introspection/i_constant_info.rb +1 -1
  11. data/lib/ffi-gobject_introspection/i_function_info.rb +0 -6
  12. data/lib/ffi-gobject_introspection/lib.rb +8 -2
  13. data/lib/gir_ffi.rb +5 -0
  14. data/lib/gir_ffi/arg_helper.rb +1 -1
  15. data/lib/gir_ffi/argument_builder.rb +161 -0
  16. data/lib/gir_ffi/base_argument_builder.rb +146 -0
  17. data/lib/gir_ffi/builder/field.rb +7 -5
  18. data/lib/gir_ffi/builder/module.rb +3 -14
  19. data/lib/gir_ffi/builder/property.rb +0 -2
  20. data/lib/gir_ffi/builder/type/callback.rb +0 -8
  21. data/lib/gir_ffi/builder/type/constant.rb +0 -4
  22. data/lib/gir_ffi/builder/type/enum.rb +0 -4
  23. data/lib/gir_ffi/builder/type/interface.rb +0 -4
  24. data/lib/gir_ffi/builder/type/object.rb +0 -1
  25. data/lib/gir_ffi/builder/type/struct_based.rb +0 -6
  26. data/lib/gir_ffi/builder/type/union.rb +0 -4
  27. data/lib/gir_ffi/builder/type/with_layout.rb +0 -1
  28. data/lib/gir_ffi/builder/type/with_methods.rb +1 -7
  29. data/lib/gir_ffi/callback.rb +9 -0
  30. data/lib/gir_ffi/callback_helper.rb +8 -1
  31. data/lib/gir_ffi/class_base.rb +6 -26
  32. data/lib/gir_ffi/error_argument_builder.rb +17 -0
  33. data/lib/gir_ffi/{builder/function.rb → function_builder.rb} +14 -11
  34. data/lib/gir_ffi/in_out_pointer.rb +29 -36
  35. data/lib/gir_ffi/in_pointer.rb +1 -1
  36. data/lib/gir_ffi/info_ext.rb +6 -0
  37. data/lib/gir_ffi/info_ext/i_field_info.rb +0 -2
  38. data/lib/gir_ffi/info_ext/i_type_info.rb +29 -10
  39. data/lib/gir_ffi/info_ext/safe_constant_name.rb +21 -0
  40. data/lib/gir_ffi/info_ext/safe_function_name.rb +13 -0
  41. data/lib/gir_ffi/interface_base.rb +1 -11
  42. data/lib/gir_ffi/module_base.rb +0 -10
  43. data/lib/gir_ffi/null_argument_builder.rb +9 -0
  44. data/lib/gir_ffi/return_value_builder.rb +75 -0
  45. data/lib/gir_ffi/setter_argument_info.rb +16 -0
  46. data/lib/gir_ffi/type_map.rb +10 -1
  47. data/lib/gir_ffi/version.rb +1 -1
  48. data/tasks/test.rake +61 -0
  49. data/test/base_test_helper.rb +0 -2
  50. data/test/ffi-gobject/value_test.rb +15 -0
  51. data/test/ffi-gobject_introspection/i_base_info_test.rb +31 -6
  52. data/test/ffi-gobject_introspection/i_function_info_test.rb +0 -17
  53. data/test/ffi-gobject_introspection/lib_test.rb +0 -55
  54. data/test/ffi-gobject_test.rb +2 -1
  55. data/test/gir_ffi/argument_builder_test.rb +414 -0
  56. data/test/gir_ffi/base_argument_builder_test.rb +13 -0
  57. data/test/gir_ffi/builder/module_test.rb +4 -40
  58. data/test/gir_ffi/builder/type/callback_test.rb +0 -27
  59. data/test/gir_ffi/builder/type/constant_test.rb +0 -12
  60. data/test/gir_ffi/builder/type/enum_test.rb +0 -20
  61. data/test/gir_ffi/builder/type/interface_test.rb +0 -11
  62. data/test/gir_ffi/builder/type/object_test.rb +2 -2
  63. data/test/gir_ffi/builder/type/struct_test.rb +0 -39
  64. data/test/gir_ffi/builder/type/unintrospectable_test.rb +1 -1
  65. data/test/gir_ffi/builder/type/union_test.rb +0 -11
  66. data/test/gir_ffi/builder_test.rb +3 -11
  67. data/test/gir_ffi/callback_helper_test.rb +7 -0
  68. data/test/gir_ffi/{builder/function_test.rb → function_builder_test.rb} +16 -28
  69. data/test/gir_ffi/in_out_pointer_test.rb +0 -20
  70. data/test/gir_ffi/info_ext/i_type_info_test.rb +112 -26
  71. data/test/gir_ffi/info_ext/safe_constant_name_test.rb +16 -0
  72. data/test/gir_ffi/info_ext/safe_function_name_test.rb +22 -0
  73. data/test/gir_ffi/return_value_builder_test.rb +355 -0
  74. data/test/integration/generated_gimarshallingtests_test.rb +608 -296
  75. data/test/integration/generated_regress_test.rb +879 -494
  76. metadata +35 -24
  77. data/lib/gir_ffi/builder/argument.rb +0 -569
  78. data/lib/gir_ffi/builder/argument/base.rb +0 -151
  79. data/lib/gir_ffi/builder/argument/in_base.rb +0 -14
  80. data/lib/gir_ffi/builder/argument/in_out_base.rb +0 -18
  81. data/lib/gir_ffi/builder/argument/out_base.rb +0 -15
  82. data/test/gir_ffi/builder/argument/base_test.rb +0 -55
  83. data/test/integration/pretty_print_test.rb +0 -33
@@ -6,24 +6,27 @@ require 'gir_ffi'
6
6
  GirFFI.setup :GIMarshallingTests
7
7
 
8
8
  # Tests generated methods and functions in the GIMarshallingTests namespace.
9
- describe "GIMarshallingTests" do
10
- describe "BoxedStruct" do
11
- it "is created with #new" do
9
+ describe GIMarshallingTests do
10
+ describe "GIMarshallingTests::BoxedStruct" do
11
+ it "creates an instance using #new" do
12
12
  bx = GIMarshallingTests::BoxedStruct.new
13
13
  assert_instance_of GIMarshallingTests::BoxedStruct, bx
14
14
  end
15
15
 
16
+ let(:instance) { GIMarshallingTests::BoxedStruct.new }
17
+
18
+ it "has a working method #inv" do
19
+ instance.long_ = 42
20
+ instance.inv
21
+ pass
22
+ end
23
+
16
24
  describe "an instance" do
17
25
  before do
18
- @bx = GIMarshallingTests::BoxedStruct.new
26
+ @bx = instance
19
27
  @bx.long_ = 42
20
28
  end
21
29
 
22
- it "has a working method #inv" do
23
- @bx.inv
24
- pass
25
- end
26
-
27
30
  it "has a writable field long_" do
28
31
  assert_equal 42, @bx.long_
29
32
  @bx.long_ = 43
@@ -38,7 +41,6 @@ describe "GIMarshallingTests" do
38
41
  end
39
42
 
40
43
  it "has a working function #inout" do
41
- skip unless get_method_introspection_data 'GIMarshallingTests', 'BoxedStruct', 'inout'
42
44
  bx = GIMarshallingTests::BoxedStruct.new
43
45
  bx.long_ = 42
44
46
 
@@ -49,13 +51,11 @@ describe "GIMarshallingTests" do
49
51
  end
50
52
 
51
53
  it "has a working function #out" do
52
- skip unless get_method_introspection_data 'GIMarshallingTests', 'BoxedStruct', 'out'
53
54
  res = GIMarshallingTests::BoxedStruct.out
54
55
  assert_equal 42, res.long_
55
56
  end
56
57
 
57
58
  it "has a working function #returnv" do
58
- skip unless get_method_introspection_data 'GIMarshallingTests', 'BoxedStruct', 'returnv'
59
59
  res = GIMarshallingTests::BoxedStruct.returnv
60
60
  assert_equal 42, res.long_
61
61
  assert_equal ["0", "1", "2"], res.g_strv.to_a
@@ -66,6 +66,10 @@ describe "GIMarshallingTests" do
66
66
  assert_equal 5, GIMarshallingTests::CONSTANT_GERROR_CODE
67
67
  end
68
68
 
69
+ it "has the constant CONSTANT_GERROR_DEBUG_MESSAGE" do
70
+ skip
71
+ end
72
+
69
73
  it "has the constant CONSTANT_GERROR_DOMAIN" do
70
74
  assert_equal "gi-marshalling-tests-gerror-domain",
71
75
  GIMarshallingTests::CONSTANT_GERROR_DOMAIN
@@ -84,35 +88,101 @@ describe "GIMarshallingTests" do
84
88
  assert_equal "const ♥ utf8", GIMarshallingTests::CONSTANT_UTF8
85
89
  end
86
90
 
87
- it "has the enum Enum" do
88
- assert_equal 0, GIMarshallingTests::Enum[:value1]
89
- assert_equal 1, GIMarshallingTests::Enum[:value2]
90
- assert_equal 42, GIMarshallingTests::Enum[:value3]
91
+ describe "GIMarshallingTests::Enum" do
92
+ it "has the member :value1" do
93
+ assert_equal 0, GIMarshallingTests::Enum[:value1]
94
+ end
95
+
96
+ it "has the member :value2" do
97
+ assert_equal 1, GIMarshallingTests::Enum[:value2]
98
+ end
99
+
100
+ it "has the member :value3" do
101
+ assert_equal 42, GIMarshallingTests::Enum[:value3]
102
+ end
91
103
  end
92
104
 
93
- it "has the bitfield Flags" do
94
- assert_equal 1, GIMarshallingTests::Flags[:value1]
95
- assert_equal 2, GIMarshallingTests::Flags[:value2]
96
- assert_equal 4, GIMarshallingTests::Flags[:value3]
97
- assert_equal 3, GIMarshallingTests::Flags[:mask]
98
- assert_equal 3, GIMarshallingTests::Flags[:mask2]
105
+ describe "GIMarshallingTests::Flags" do
106
+ it "has the member :value1" do
107
+ assert_equal 1, GIMarshallingTests::Flags[:value1]
108
+ end
109
+
110
+ it "has the member :value2" do
111
+ assert_equal 2, GIMarshallingTests::Flags[:value2]
112
+ end
113
+
114
+ it "has the member :value3" do
115
+ assert_equal 4, GIMarshallingTests::Flags[:value3]
116
+ end
117
+
118
+ it "has the member :mask" do
119
+ assert_equal 3, GIMarshallingTests::Flags[:mask]
120
+ end
121
+
122
+ it "has the member :mask2" do
123
+ assert_equal 3, GIMarshallingTests::Flags[:mask2]
124
+ end
125
+
126
+ it "has a working function #in" do
127
+ skip
128
+ end
129
+ it "has a working function #in_zero" do
130
+ skip
131
+ end
132
+ it "has a working function #inout" do
133
+ skip
134
+ end
135
+ it "has a working function #out" do
136
+ skip
137
+ end
138
+ it "has a working function #returnv" do
139
+ skip
140
+ end
141
+ end
142
+
143
+ describe "GIMarshallingTests::GEnum" do
144
+ it "has the member :value1" do
145
+ assert_equal 0, GIMarshallingTests::GEnum[:value1]
146
+ end
147
+ it "has the member :value2" do
148
+ assert_equal 1, GIMarshallingTests::GEnum[:value2]
149
+ end
150
+ it "has the member :value3" do
151
+ assert_equal 42, GIMarshallingTests::GEnum[:value3]
152
+ end
153
+ it "has a working function #in" do
154
+ skip
155
+ end
156
+ it "has a working function #inout" do
157
+ skip
158
+ end
159
+ it "has a working function #out" do
160
+ skip
161
+ end
162
+ it "has a working function #returnv" do
163
+ skip
164
+ end
99
165
  end
100
166
 
101
- it "has the enum GEnum" do
102
- assert_equal 0, GIMarshallingTests::GEnum[:value1]
103
- assert_equal 1, GIMarshallingTests::GEnum[:value2]
104
- assert_equal 42, GIMarshallingTests::GEnum[:value3]
167
+ describe "GIMarshallingTests::Interface" do
168
+ it "has a working method #test_int8_in" do
169
+ skip
170
+ end
105
171
  end
106
172
 
107
- describe "Interface" do
108
- it "must be tested"
173
+ describe "GIMarshallingTests::Interface2" do
174
+ it "must be tested" do
175
+ skip
176
+ end
109
177
  end
110
178
 
111
- describe "Interface2" do
112
- it "must be tested"
179
+ describe "GIMarshallingTests::Interface3" do
180
+ it "has a working method #test_variant_array_in" do
181
+ skip
182
+ end
113
183
  end
114
184
 
115
- describe "NestedStruct" do
185
+ describe "GIMarshallingTests::NestedStruct" do
116
186
  it "contains a SimpleStruct" do
117
187
  ns = GIMarshallingTests::NestedStruct.new
118
188
  assert_instance_of GIMarshallingTests::SimpleStruct,
@@ -120,15 +190,25 @@ describe "GIMarshallingTests" do
120
190
  end
121
191
  end
122
192
 
123
- it "has the bitfield NoTypeFlags" do
124
- assert_equal 1, GIMarshallingTests::NoTypeFlags[:value1]
125
- assert_equal 2, GIMarshallingTests::NoTypeFlags[:value2]
126
- assert_equal 4, GIMarshallingTests::NoTypeFlags[:value3]
127
- assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask]
128
- assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask2]
193
+ describe "GIMarshallingTests::NoTypeFlags" do
194
+ it "has the member :value1" do
195
+ assert_equal 1, GIMarshallingTests::NoTypeFlags[:value1]
196
+ end
197
+ it "has the member :value2" do
198
+ assert_equal 2, GIMarshallingTests::NoTypeFlags[:value2]
199
+ end
200
+ it "has the member :value3" do
201
+ assert_equal 4, GIMarshallingTests::NoTypeFlags[:value3]
202
+ end
203
+ it "has the member :mask" do
204
+ assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask]
205
+ end
206
+ it "has the member :mask2" do
207
+ assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask2]
208
+ end
129
209
  end
130
210
 
131
- describe "NotSimpleStruct" do
211
+ describe "GIMarshallingTests::NotSimpleStruct" do
132
212
  it "must be tested"
133
213
  end
134
214
 
@@ -136,8 +216,8 @@ describe "GIMarshallingTests" do
136
216
  assert_equal 42, GIMarshallingTests::OVERRIDES_CONSTANT
137
217
  end
138
218
 
139
- describe "Object" do
140
- it "creates instances with #new" do
219
+ describe "GIMarshallingTests::Object" do
220
+ it "creates an instance using #new" do
141
221
  ob = GIMarshallingTests::Object.new 42
142
222
  assert_instance_of GIMarshallingTests::Object, ob
143
223
  assert_equal 42, ob.int
@@ -160,8 +240,9 @@ describe "GIMarshallingTests" do
160
240
  assert_instance_of GIMarshallingTests::Object, res
161
241
  end
162
242
 
163
- # This function is only found in the header
164
- # it "has a working function #inout_same"
243
+ it "has a working function #inout_same" do
244
+ skip "This function is only found in the header"
245
+ end
165
246
 
166
247
  it "has a working function #none_inout" do
167
248
  ob = GIMarshallingTests::Object.new 42
@@ -185,276 +266,340 @@ describe "GIMarshallingTests" do
185
266
  pass
186
267
  end
187
268
 
188
- it "has a working function #static_method" do
189
- GIMarshallingTests::Object.static_method
190
- pass
269
+ let(:instance) { GIMarshallingTests::Object.new 42 }
270
+
271
+ it "has a working method #call_vfunc_with_callback" do
272
+ skip
191
273
  end
192
274
 
193
- describe "an instance" do
194
- before do
195
- @obj = GIMarshallingTests::Object.new 42
196
- end
275
+ it "has a working method #full_in" do
276
+ skip "This function is only found in the header"
277
+ end
197
278
 
198
- it "has a working virtual method #method_int8_in"
199
- it "has a working virtual method #method_int8_out"
279
+ it "has a working method #int8_in" do
280
+ skip
281
+ end
282
+ it "has a working method #int8_out" do
283
+ skip
284
+ end
200
285
 
201
- it "has a working virtual method #method_with_default_implementation" do
202
- @obj.method_with_default_implementation 104
203
- assert_equal 104, @obj.int
204
- end
286
+ # TODO: Avoid using common method names?
287
+ it "has a working method #method" do
288
+ instance.method
289
+ pass
290
+ end
205
291
 
206
- # This function is only found in the header
207
- # it "has a working method #full_in"
292
+ it "has a working method #method_array_in" do
293
+ instance.method_array_in [-1, 0, 1, 2]
294
+ pass
295
+ end
208
296
 
209
- it "has a working method #int8_in"
210
- it "has a working method #int8_out"
297
+ it "has a working method #method_array_inout" do
298
+ res = instance.method_array_inout [-1, 0, 1, 2]
299
+ assert_equal [-2, -1, 0, 1, 2], res
300
+ end
211
301
 
212
- # TODO: Avoid using common method names?
213
- it "has a working method #method" do
214
- @obj.method
215
- pass
216
- end
302
+ it "has a working method #method_array_out" do
303
+ res = instance.method_array_out
304
+ assert_equal [-1, 0, 1, 2], res
305
+ end
217
306
 
218
- it "has a working method #method_array_in" do
219
- @obj.method_array_in [-1, 0, 1, 2]
220
- pass
221
- end
307
+ it "has a working method #method_array_return" do
308
+ res = instance.method_array_return
309
+ assert_equal [-1, 0, 1, 2], res
310
+ end
222
311
 
223
- it "has a working method #method_array_inout" do
224
- res = @obj.method_array_inout [-1, 0, 1, 2]
225
- assert_equal [-2, -1, 0, 1, 2], res
226
- end
312
+ it "has a working method #method_int8_in" do
313
+ skip
314
+ end
315
+ it "has a working method #method_int8_out" do
316
+ skip
317
+ end
318
+ it "has a working method #method_variant_array_in" do
319
+ skip
320
+ end
227
321
 
228
- it "has a working method #method_array_out" do
229
- res = @obj.method_array_out
230
- assert_equal [-1, 0, 1, 2], res
231
- end
322
+ it "has a working method #method_with_default_implementation" do
323
+ instance.method_with_default_implementation 104
324
+ assert_equal 104, instance.int
325
+ end
232
326
 
233
- it "has a working method #method_array_return" do
234
- res = @obj.method_array_return
235
- assert_equal [-1, 0, 1, 2], res
236
- end
327
+ it "has a working method #none_in" do
328
+ instance.none_in
329
+ pass
330
+ end
237
331
 
238
- it "has a working method #none_in" do
239
- @obj.none_in
240
- pass
241
- end
332
+ it "has a working method #overridden_method" do
333
+ instance.set_property("int", 0)
334
+ instance.overridden_method
335
+ pass
336
+ end
242
337
 
243
- it "has a property 'int' containing the argument to #new" do
244
- assert_equal 42, @obj.get_property("int")
245
- @obj.set_property("int", 13)
246
- assert_equal 13, @obj.get_property("int")
247
- end
338
+ it "has a working method #vfunc_caller_allocated_out_parameter" do
339
+ skip
340
+ end
341
+ it "has a working method #vfunc_meth_with_error" do
342
+ skip
343
+ end
344
+ it "has a working method #vfunc_multiple_out_parameters" do
345
+ skip
346
+ end
347
+ it "has a working method #vfunc_one_out_parameter" do
348
+ skip
349
+ end
350
+ it "has a working method #vfunc_return_value_and_multiple_out_parameters" do
351
+ skip
352
+ end
353
+ it "has a working method #vfunc_return_value_and_one_out_parameter" do
354
+ skip
355
+ end
356
+ it "has a working method #vfunc_return_value_only" do
357
+ skip
358
+ end
359
+ it "has a working method #vfunc_with_callback" do
360
+ skip
361
+ end
248
362
 
249
- it "has a working method #overridden_method" do
250
- @obj.set_property("int", 0)
251
- @obj.overridden_method
252
- pass
253
- end
363
+ it "has a property 'int' containing the argument to #new" do
364
+ assert_equal 42, instance.get_property("int")
365
+ instance.set_property("int", 13)
366
+ assert_equal 13, instance.get_property("int")
367
+ end
254
368
 
255
- it "has property accessors for the int property" do
256
- assert_equal 42, @obj.int
257
- @obj.int = 1
258
- assert_equal 1, @obj.int
259
- end
369
+ it "has property accessors for the int property" do
370
+ assert_equal 42, instance.int
371
+ instance.int = 1
372
+ assert_equal 1, instance.int
260
373
  end
261
374
  end
262
375
 
263
- describe "OverridesObject" do
264
- it "creates instances with #new" do
376
+ describe "GIMarshallingTests::OverridesObject" do
377
+ it "creates an instance using #new" do
265
378
  ob = GIMarshallingTests::OverridesObject.new
266
379
  assert_instance_of GIMarshallingTests::OverridesObject, ob
267
380
  end
268
381
 
269
- it "creates instances with #returnv" do
382
+ it "has a working function #returnv" do
270
383
  ob = GIMarshallingTests::OverridesObject.returnv
271
384
  assert_instance_of GIMarshallingTests::OverridesObject, ob
272
385
  end
273
386
 
274
- describe "an instance" do
275
- before do
276
- @obj = GIMarshallingTests::OverridesObject.new
277
- end
387
+ let(:instance) { GIMarshallingTests::OverridesObject.new }
278
388
 
279
- it "does not have field accessor methods" do
280
- assert_raises(NoMethodError) { @obj.parent_instance }
281
- assert_raises(NoMethodError) { @obj.parent_instance = nil }
282
- assert_raises(NoMethodError) { @obj.long_ }
283
- assert_raises(NoMethodError) { @obj.long_ = 1 }
284
- end
389
+ it "has a working method #method" do
390
+ result = instance.method
391
+ result.must_equal 42
392
+ end
393
+
394
+ it "does not have field accessor methods" do
395
+ assert_raises(NoMethodError) { instance.parent_instance }
396
+ assert_raises(NoMethodError) { instance.parent_instance = nil }
397
+ assert_raises(NoMethodError) { instance.long_ }
398
+ assert_raises(NoMethodError) { instance.long_ = 1 }
285
399
  end
286
400
  end
287
401
 
288
- describe "PointerStruct" do
289
- it "creates instances with #new" do
290
- ps = GIMarshallingTests::PointerStruct.new
291
- assert_instance_of GIMarshallingTests::PointerStruct, ps
402
+ describe "GIMarshallingTests::OverridesStruct" do
403
+ let(:instance) { GIMarshallingTests::OverridesStruct.new }
404
+
405
+ it "creates an instance using #new" do
406
+ ob = GIMarshallingTests::OverridesStruct.new
407
+ assert_instance_of GIMarshallingTests::OverridesStruct, ob
292
408
  end
293
409
 
294
- describe "an instance" do
295
- before do
296
- @ps = GIMarshallingTests::PointerStruct.new
297
- end
410
+ it "has a working method #method" do
411
+ instance.method.must_equal 42
412
+ end
298
413
 
299
- it "has a writable field long_" do
300
- assert_equal 0, @ps.long_
301
- @ps.long_ = 1056
302
- assert_equal 1056, @ps.long_
303
- end
414
+ it "has a working function #returnv" do
415
+ ob = GIMarshallingTests::OverridesStruct.returnv
416
+ assert_instance_of GIMarshallingTests::OverridesStruct, ob
417
+ end
304
418
 
305
- it "has a working method #inv" do
306
- @ps.long_ = 42
307
- @ps.inv
308
- pass
309
- end
419
+ it "has a writable field long_" do
420
+ instance.long_ = 43
421
+ instance.long_.must_equal 43
310
422
  end
311
423
  end
312
424
 
313
- it "has the enum SecondEnum" do
314
- assert_equal 0, GIMarshallingTests::SecondEnum[:secondvalue1]
315
- assert_equal 1, GIMarshallingTests::SecondEnum[:secondvalue2]
316
- end
425
+ describe "GIMarshallingTests::PointerStruct" do
426
+ it "creates an instance using #new" do
427
+ ps = GIMarshallingTests::PointerStruct.new
428
+ assert_instance_of GIMarshallingTests::PointerStruct, ps
429
+ end
317
430
 
318
- describe "SimpleStruct" do
319
- it "creates instances with #new" do
320
- ss = GIMarshallingTests::SimpleStruct.new
321
- assert_instance_of GIMarshallingTests::SimpleStruct, ss
431
+ let(:instance) { GIMarshallingTests::PointerStruct.new }
432
+
433
+ it "has a working method #inv" do
434
+ instance.long_ = 42
435
+ instance.inv
436
+ pass
322
437
  end
323
438
 
324
- describe "an instance" do
325
- before do
326
- @ss = GIMarshallingTests::SimpleStruct.new
327
- end
439
+ it "has a writable field long_" do
440
+ assert_equal 0, instance.long_
441
+ instance.long_ = 1056
442
+ assert_equal 1056, instance.long_
443
+ end
328
444
 
329
- it "has a writable field long_" do
330
- assert_equal 0, @ss.long_
331
- @ss.long_ = 1056
332
- assert_equal 1056, @ss.long_
333
- end
445
+ it "has a working function #returnv" do
446
+ ob = GIMarshallingTests::PointerStruct.returnv
447
+ assert_instance_of GIMarshallingTests::PointerStruct, ob
448
+ end
449
+ end
334
450
 
335
- it "has a writable field int8" do
336
- assert_equal 0, @ss.int8
337
- @ss.int8 = -43
338
- assert_equal(-43, @ss.int8)
339
- end
451
+ describe "GIMarshallingTests::PropertiesObject" do
452
+ it "creates an instance using #new" do
453
+ ob = GIMarshallingTests::PropertiesObject.new
454
+ assert_instance_of GIMarshallingTests::PropertiesObject, ob
455
+ end
340
456
 
341
- it "has a working method #inv" do
342
- @ss.long_ = 6
343
- @ss.int8 = 7
344
- @ss.inv
345
- pass
346
- end
457
+ it "has the property 'some-boolean'"
458
+ it "has the property 'some-boxed-struct'"
459
+ it "has the property 'some-char'"
460
+ it "has the property 'some-double'"
461
+ it "has the property 'some-float'"
462
+ it "has the property 'some-int'"
463
+ it "has the property 'some-int64'"
464
+ it "has the property 'some-long'"
465
+ it "has the property 'some-strv'"
466
+ it "has the property 'some-uchar'"
467
+ it "has the property 'some-uint'"
468
+ it "has the property 'some-uint64'"
469
+ it "has the property 'some-ulong'"
470
+ end
471
+
472
+ describe "GIMarshallingTests::SecondEnum" do
473
+ it "has the member :secondvalue1" do
474
+ assert_equal 0, GIMarshallingTests::SecondEnum[:secondvalue1]
475
+ end
476
+ it "has the member :secondvalue2" do
477
+ assert_equal 1, GIMarshallingTests::SecondEnum[:secondvalue2]
347
478
  end
348
479
  end
349
480
 
350
- describe "SubObject" do
351
- it "creates instances with #new" do
352
- so = GIMarshallingTests::SubObject.new 42
353
- assert_instance_of GIMarshallingTests::SubObject, so
481
+ describe "GIMarshallingTests::SimpleStruct" do
482
+ it "creates an instance using #new" do
483
+ ss = GIMarshallingTests::SimpleStruct.new
484
+ assert_instance_of GIMarshallingTests::SimpleStruct, ss
354
485
  end
355
486
 
356
- describe "an instance" do
357
- before do
358
- @so = GIMarshallingTests::SubObject.new 0
359
- end
487
+ let(:instance) { GIMarshallingTests::SimpleStruct.new }
360
488
 
361
- it "has the method #overwritten_method" do
362
- @so.overwritten_method
363
- pass
364
- end
489
+ it "has a working method #inv" do
490
+ instance.long_ = 6
491
+ instance.int8 = 7
492
+ instance.inv
493
+ pass
494
+ end
365
495
 
366
- it "has the method #sub_method" do
367
- @so.sub_method
368
- pass
369
- end
496
+ it "has a working method #method" do
497
+ instance.long_ = 6
498
+ instance.int8 = 7
499
+ instance.method
500
+ pass
501
+ end
370
502
 
371
- it "does not have field accessors" do
372
- assert_raises(NoMethodError) { @so.parent_instance }
373
- assert_raises(NoMethodError) { @so.parent_instance = nil }
374
- end
503
+ it "has a writable field long_" do
504
+ assert_equal 0, instance.long_
505
+ instance.long_ = 1056
506
+ assert_equal 1056, instance.long_
507
+ end
375
508
 
376
- it "has a working inherited virtual method #method_int8_in"
377
- it "has a working inherited virtual method #method_int8_out"
509
+ it "has a writable field int8" do
510
+ assert_equal 0, instance.int8
511
+ instance.int8 = -43
512
+ assert_equal(-43, instance.int8)
513
+ end
378
514
 
379
- it "has a working inherited virtual method #method_with_default_implementation" do
380
- @so.method_with_default_implementation 104
381
- assert_equal 104, @so.int
382
- end
515
+ it "has a working function #returnv" do
516
+ ss = GIMarshallingTests::SimpleStruct.returnv
517
+ assert_instance_of GIMarshallingTests::SimpleStruct, ss
518
+ end
519
+ end
383
520
 
384
- it "has a working inherited method #int8_in"
385
- it "has a working inherited method #int8_out"
521
+ describe "GIMarshallingTests::SubObject" do
522
+ it "creates an instance using #new" do
523
+ so = GIMarshallingTests::SubObject.new 42
524
+ assert_instance_of GIMarshallingTests::SubObject, so
525
+ end
386
526
 
387
- it "has a working inherited method #method" do
388
- @so.set_property("int", 42)
389
- @so.method
390
- pass
391
- end
527
+ let(:instance) { GIMarshallingTests::SubObject.new 0 }
392
528
 
393
- it "has a working inherited method #method_array_in" do
394
- @so.method_array_in [-1, 0, 1, 2]
395
- pass
396
- end
529
+ it "has a working method #overwritten_method" do
530
+ instance.overwritten_method
531
+ pass
532
+ end
397
533
 
398
- it "has a working inherited method #method_array_inout" do
399
- res = @so.method_array_inout [-1, 0, 1, 2]
400
- assert_equal [-2, -1, 0, 1, 2], res
401
- end
534
+ it "has a working method #sub_method" do
535
+ instance.sub_method
536
+ pass
537
+ end
402
538
 
403
- it "has a working inherited method #method_array_out" do
404
- res = @so.method_array_out
405
- assert_equal [-1, 0, 1, 2], res
406
- end
539
+ it "does not have field accessors" do
540
+ assert_raises(NoMethodError) { instance.parent_instance }
541
+ assert_raises(NoMethodError) { instance.parent_instance = nil }
542
+ end
543
+ end
407
544
 
408
- it "has a working inherited method #method_array_return" do
409
- res = @so.method_array_return
410
- assert_equal [-1, 0, 1, 2], res
411
- end
545
+ describe "GIMarshallingTests::SubSubObject" do
546
+ it "creates an instance using #new" do
547
+ so = GIMarshallingTests::SubSubObject.new 42
548
+ assert_instance_of GIMarshallingTests::SubSubObject, so
549
+ end
412
550
 
413
- it "has a working inherited method #none_in" do
414
- @so.set_property("int", 42)
415
- @so.none_in
416
- pass
417
- end
551
+ let(:instance) { GIMarshallingTests::SubSubObject.new 0 }
418
552
 
419
- it "has a working inherited method #overridden_method" do
420
- @so.set_property("int", 0)
421
- @so.overridden_method
422
- pass
423
- end
553
+ it "does not have field accessors" do
554
+ assert_raises(NoMethodError) { instance.parent_instance }
555
+ assert_raises(NoMethodError) { instance.parent_instance = nil }
424
556
  end
425
557
  end
426
558
 
427
- describe "Union" do
559
+ describe "GIMarshallingTests::Union" do
428
560
  it "creates an instance with #new" do
429
561
  u = GIMarshallingTests::Union.new
430
562
  assert_instance_of GIMarshallingTests::Union, u
431
563
  end
432
564
 
433
- describe "an instance" do
434
- before do
435
- @it = GIMarshallingTests::Union.new
436
- end
565
+ let(:instance) { GIMarshallingTests::Union.new }
437
566
 
438
- it "has a writable field long_" do
439
- assert_equal 0, @it.long_
440
- @it.long_ = 1056
441
- assert_equal 1056, @it.long_
442
- end
567
+ it "has a writable field long_" do
568
+ assert_equal 0, instance.long_
569
+ instance.long_ = 1056
570
+ assert_equal 1056, instance.long_
571
+ end
443
572
 
444
- it "has a working method #inv" do
445
- @it.long_ = 42
446
- @it.inv
447
- pass
448
- end
573
+ it "has a working method #inv" do
574
+ instance.long_ = 42
575
+ instance.inv
576
+ pass
577
+ end
449
578
 
450
- it "has a working method #method" do
451
- @it.long_ = 42
452
- @it.method
453
- pass
454
- end
579
+ it "has a working method #method" do
580
+ instance.long_ = 42
581
+ instance.method
582
+ pass
583
+ end
584
+
585
+ it "has a working function #inout" do
586
+ skip "This function is defined in the header but not implemented"
587
+ end
588
+
589
+ it "has a working function #out" do
590
+ skip "This function is defined in the header but not implemented"
591
+ end
592
+
593
+ it "has a working function #returnv" do
594
+ u = GIMarshallingTests::Union.returnv
595
+ assert_instance_of GIMarshallingTests::Union, u
455
596
  end
456
597
  end
457
598
 
599
+ it "has a working function #array_enum_in" do
600
+ skip
601
+ end
602
+
458
603
  it "has a working function #array_fixed_inout" do
459
604
  res = GIMarshallingTests.array_fixed_inout [-1, 0, 1, 2]
460
605
  assert_equal [2, 1, 0, -1], res
@@ -490,45 +635,85 @@ describe "GIMarshallingTests" do
490
635
  assert_equal [-1, 0, 1, 2], res
491
636
  end
492
637
 
493
- it "has a working function #array_gvariant_(none)_in"
494
- # FIXME: Test was disabled since the implementation of the return value
495
- # handling was never correct.
496
- #
497
- #do
498
- #v1 = GLib::Variant.new_int32(27)
499
- #v2 = GLib::Variant.new_string("Hello")
500
- #if GIMarshallingTests._builder.setup_method :array_gvariant_in
501
- #GIMarshallingTests.array_gvariant_in [v1, v2]
502
- #else
503
- #GIMarshallingTests.array_gvariant_none_in [v1, v2]
504
- #end
505
-
506
- #pass
507
- ## TODO: Can we determine that result should be an array?
508
- ## assert_equal 27, res[0].get_int32
509
- ## assert_equal "Hello", res[1].get_string
510
- #end
638
+ it "has a working function #array_gvariant_container_in" do
639
+ skip
640
+ end
641
+ it "has a working function #array_gvariant_full_in" do
642
+ skip
643
+ end
644
+
645
+ it "has a working function #array_gvariant_none_in" do
646
+ skip "Test was disabled the return value was never correct"
647
+ v1 = GLib::Variant.new_int32(27)
648
+ v2 = GLib::Variant.new_string("Hello")
649
+ GIMarshallingTests.array_gvariant_none_in [v1, v2]
650
+
651
+ pass
652
+ # TODO: Can we determine that result should be an array?
653
+ # assert_equal 27, res[0].get_int32
654
+ # assert_equal "Hello", res[1].get_string
655
+ end
511
656
 
512
657
  it "has a working function #array_in" do
513
658
  GIMarshallingTests.array_in [-1, 0, 1, 2]
514
659
  pass
515
660
  end
516
661
 
662
+ it "has a working function #array_in_guint64_len" do
663
+ skip
664
+ end
665
+ it "has a working function #array_in_guint8_len" do
666
+ skip
667
+ end
668
+ it "has a working function #array_in_len_before" do
669
+ skip
670
+ end
671
+ it "has a working function #array_in_len_zero_terminated" do
672
+ skip
673
+ end
674
+ it "has a working function #array_in_nonzero_nonlen" do
675
+ skip
676
+ end
677
+
517
678
  it "has a working function #array_inout" do
518
679
  res = GIMarshallingTests.array_inout [-1, 0, 1, 2]
519
680
  assert_equal [-2, -1, 0, 1, 2], res
520
681
  end
521
682
 
683
+ it "has a working function #array_inout_etc" do
684
+ skip
685
+ end
686
+
522
687
  it "has a working function #array_out" do
523
688
  res = GIMarshallingTests.array_out
524
689
  assert_equal [-1, 0, 1, 2], res
525
690
  end
526
691
 
692
+ it "has a working function #array_out_etc" do
693
+ skip
694
+ end
695
+
527
696
  it "has a working function #array_return" do
528
697
  res = GIMarshallingTests.array_return
529
698
  assert_equal [-1, 0, 1, 2], res
530
699
  end
531
700
 
701
+ it "has a working function #array_return_etc" do
702
+ skip
703
+ end
704
+ it "has a working function #array_simple_struct_in" do
705
+ skip
706
+ end
707
+ it "has a working function #array_string_in" do
708
+ skip
709
+ end
710
+ it "has a working function #array_struct_in" do
711
+ skip
712
+ end
713
+ it "has a working function #array_struct_take_in" do
714
+ skip
715
+ end
716
+
532
717
  it "has a working function #array_uint8_in" do
533
718
  arr = "abcd".bytes.to_a
534
719
  GIMarshallingTests.array_uint8_in arr
@@ -540,6 +725,10 @@ describe "GIMarshallingTests" do
540
725
  pass
541
726
  end
542
727
 
728
+ it "has a working function #array_zero_terminated_inout" do
729
+ skip
730
+ end
731
+
543
732
  it "has a working function #array_zero_terminated_out" do
544
733
  res = GIMarshallingTests.array_zero_terminated_out
545
734
  assert_equal ["0", "1", "2"], res.to_a
@@ -550,6 +739,13 @@ describe "GIMarshallingTests" do
550
739
  assert_equal ["0", "1", "2"], res.to_a
551
740
  end
552
741
 
742
+ it "has a working function #array_zero_terminated_return_null" do
743
+ skip
744
+ end
745
+ it "has a working function #array_zero_terminated_return_struct" do
746
+ skip
747
+ end
748
+
553
749
  it "has a working function #boolean_in_false" do
554
750
  GIMarshallingTests.boolean_in_false false
555
751
  pass
@@ -624,6 +820,22 @@ describe "GIMarshallingTests" do
624
820
  pass
625
821
  end
626
822
 
823
+ it "has a working function #callback_multiple_out_parameters" do
824
+ skip
825
+ end
826
+ it "has a working function #callback_one_out_parameter" do
827
+ skip
828
+ end
829
+ it "has a working function #callback_return_value_and_multiple_out_parameters" do
830
+ skip
831
+ end
832
+ it "has a working function #callback_return_value_and_one_out_parameter" do
833
+ skip
834
+ end
835
+ it "has a working function #callback_return_value_only" do
836
+ skip
837
+ end
838
+
627
839
  it "has a working function #double_in" do
628
840
  GIMarshallingTests.double_in Float::MAX
629
841
  pass
@@ -730,6 +942,16 @@ describe "GIMarshallingTests" do
730
942
  assert_equal [-1, 0, 1, 2], arr.to_a
731
943
  end
732
944
 
945
+ it "has a working function #garray_uint64_none_in" do
946
+ skip
947
+ end
948
+ it "has a working function #garray_uint64_none_return" do
949
+ skip
950
+ end
951
+ it "has a working function #garray_utf8_container_inout" do
952
+ skip
953
+ end
954
+
733
955
  it "has a working function #garray_utf8_container_out" do
734
956
  res = GIMarshallingTests.garray_utf8_container_out
735
957
  assert_equal ["0", "1", "2"], res.to_a
@@ -830,6 +1052,16 @@ describe "GIMarshallingTests" do
830
1052
  end
831
1053
  end
832
1054
 
1055
+ it "has a working function #gerror_out" do
1056
+ skip
1057
+ end
1058
+ it "has a working function #gerror_out_transfer_none" do
1059
+ skip
1060
+ end
1061
+ it "has a working function #gerror_return" do
1062
+ skip
1063
+ end
1064
+
833
1065
  it "has a working function #ghashtable_int_none_in" do
834
1066
  GIMarshallingTests.ghashtable_int_none_in(
835
1067
  {-1 => 1, 0 => 0, 1 => -1, 2 => -2})
@@ -840,8 +1072,9 @@ describe "GIMarshallingTests" do
840
1072
  assert_equal({-1 => 1, 0 => 0, 1 => -1, 2 => -2}, gh.to_hash)
841
1073
  end
842
1074
 
843
- # This function is defined in the header but not implemented.
844
- # it "has a working function #ghashtable_utf8_container_in"
1075
+ it "has a working function #ghashtable_utf8_container_in" do
1076
+ skip "This function is defined in the header but not implemented"
1077
+ end
845
1078
 
846
1079
  it "has a working function #ghashtable_utf8_container_inout" do
847
1080
  hsh = {"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"}
@@ -861,8 +1094,9 @@ describe "GIMarshallingTests" do
861
1094
  res.to_hash)
862
1095
  end
863
1096
 
864
- # This function is defined in the header but not implemented.
865
- # it "has a working function #ghashtable_utf8_full_in"
1097
+ it "has a working function #ghashtable_utf8_full_in" do
1098
+ skip "This function is defined in the header but not implemented"
1099
+ end
866
1100
 
867
1101
  it "has a working function #ghashtable_utf8_full_inout" do
868
1102
  hsh = {"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"}
@@ -916,8 +1150,12 @@ describe "GIMarshallingTests" do
916
1150
  assert_equal [-1, 0, 1, 2], res.to_a
917
1151
  end
918
1152
 
919
- # This function is defined in the header but not implemented.
920
- # it "has a working function #glist_utf8_container_in"
1153
+ it "has a working function #glist_uint32_none_in" do
1154
+ skip
1155
+ end
1156
+ it "has a working function #glist_uint32_none_return" do
1157
+ skip
1158
+ end
921
1159
 
922
1160
  it "has a working function #glist_utf8_container_inout" do
923
1161
  res = GIMarshallingTests.glist_utf8_container_inout ["0", "1", "2"]
@@ -934,9 +1172,6 @@ describe "GIMarshallingTests" do
934
1172
  assert_equal ["0", "1", "2"], res.to_a
935
1173
  end
936
1174
 
937
- # This function is defined in the header but not implemented.
938
- # it "has a working function #glist_utf8_full_in"
939
-
940
1175
  it "has a working function #glist_utf8_full_inout" do
941
1176
  res = GIMarshallingTests.glist_utf8_full_inout ["0", "1", "2"]
942
1177
  assert_equal ["-2", "-1", "0", "1"], res.to_a
@@ -971,6 +1206,37 @@ describe "GIMarshallingTests" do
971
1206
  assert_equal ["0", "1", "2"], res.to_a
972
1207
  end
973
1208
 
1209
+ it "has a working function #gptrarray_utf8_container_inout" do
1210
+ skip
1211
+ end
1212
+ it "has a working function #gptrarray_utf8_container_out" do
1213
+ skip
1214
+ end
1215
+ it "has a working function #gptrarray_utf8_container_return" do
1216
+ skip
1217
+ end
1218
+ it "has a working function #gptrarray_utf8_full_inout" do
1219
+ skip
1220
+ end
1221
+ it "has a working function #gptrarray_utf8_full_out" do
1222
+ skip
1223
+ end
1224
+ it "has a working function #gptrarray_utf8_full_return" do
1225
+ skip
1226
+ end
1227
+ it "has a working function #gptrarray_utf8_none_in" do
1228
+ skip
1229
+ end
1230
+ it "has a working function #gptrarray_utf8_none_inout" do
1231
+ skip
1232
+ end
1233
+ it "has a working function #gptrarray_utf8_none_out" do
1234
+ skip
1235
+ end
1236
+ it "has a working function #gptrarray_utf8_none_return" do
1237
+ skip
1238
+ end
1239
+
974
1240
  it "has a working function #gslist_int_none_in" do
975
1241
  GIMarshallingTests.gslist_int_none_in [-1, 0, 1, 2]
976
1242
  pass
@@ -981,9 +1247,6 @@ describe "GIMarshallingTests" do
981
1247
  assert_equal [-1, 0, 1, 2], res.to_a
982
1248
  end
983
1249
 
984
- # This function is defined in the header but not implemented.
985
- # it "has a working function #gslist_utf8_container_in"
986
-
987
1250
  it "has a working function #gslist_utf8_container_inout" do
988
1251
  res = GIMarshallingTests.gslist_utf8_container_inout ["0", "1", "2"]
989
1252
  assert_equal ["-2", "-1", "0", "1"], res.to_a
@@ -999,9 +1262,6 @@ describe "GIMarshallingTests" do
999
1262
  assert_equal ["0", "1", "2"], res.to_a
1000
1263
  end
1001
1264
 
1002
- # This function is defined in the header but not implemented.
1003
- # it "has a working function #gslist_utf8_full_in"
1004
-
1005
1265
  it "has a working function #gslist_utf8_full_inout" do
1006
1266
  res = GIMarshallingTests.gslist_utf8_full_inout ["0", "1", "2"]
1007
1267
  assert_equal ["-2", "-1", "0", "1"], res.to_a
@@ -1057,6 +1317,10 @@ describe "GIMarshallingTests" do
1057
1317
  assert_equal ["0", "1", "2"], res.to_a
1058
1318
  end
1059
1319
 
1320
+ it "has a working function #gtype_in" do
1321
+ skip
1322
+ end
1323
+
1060
1324
  it "has a working function #gtype_inout" do
1061
1325
  none = GObject.type_from_name "void"
1062
1326
  res = GIMarshallingTests.gtype_inout none
@@ -1076,16 +1340,26 @@ describe "GIMarshallingTests" do
1076
1340
  assert_equal "void", name
1077
1341
  end
1078
1342
 
1079
- describe "#gvalue_in" do
1080
- it "works when passed a GObject::Value object" do
1081
- GIMarshallingTests.gvalue_in GObject::Value.wrap_ruby_value(42)
1082
- pass
1083
- end
1343
+ it "has a working function #gtype_string_in" do
1344
+ skip
1345
+ end
1346
+ it "has a working function #gtype_string_out" do
1347
+ skip
1348
+ end
1349
+ it "has a working function #gtype_string_return" do
1350
+ skip
1351
+ end
1352
+ it "has a working function #gvalue_flat_array" do
1353
+ skip
1354
+ end
1355
+ it "has a working function #gvalue_flat_array_round_trip" do
1356
+ skip
1357
+ end
1084
1358
 
1085
- it "automatically converts a non-GValue object to a GValue" do
1086
- GIMarshallingTests.gvalue_in 42
1087
- pass
1088
- end
1359
+ it "has a working function #gvalue_in" do
1360
+ GIMarshallingTests.gvalue_in GObject::Value.wrap_ruby_value(42)
1361
+ GIMarshallingTests.gvalue_in 42
1362
+ pass
1089
1363
  end
1090
1364
 
1091
1365
  it "has a working function #gvalue_in_enum" do
@@ -1096,16 +1370,23 @@ describe "GIMarshallingTests" do
1096
1370
  pass
1097
1371
  end
1098
1372
 
1099
- describe "#gvalue_inout" do
1100
- it "works when passed a GObject::Value object" do
1101
- res = GIMarshallingTests.gvalue_inout GObject::Value.wrap_ruby_value(42)
1102
- assert_equal "42", res.ruby_value
1103
- end
1373
+ it "has a working function #gvalue_in_with_type" do
1374
+ skip
1375
+ end
1104
1376
 
1105
- it "automatically converts a non-GValue input to a GValue" do
1106
- res = GIMarshallingTests.gvalue_inout 42
1107
- assert_equal "42", res.ruby_value
1108
- end
1377
+ it "has a working function #gvalue_inout" do
1378
+ res = GIMarshallingTests.gvalue_inout GObject::Value.wrap_ruby_value(42)
1379
+ assert_equal "42", res.ruby_value
1380
+
1381
+ res = GIMarshallingTests.gvalue_inout 42
1382
+ assert_equal "42", res.ruby_value
1383
+ end
1384
+
1385
+ it "has a working function #gvalue_int64_in" do
1386
+ skip
1387
+ end
1388
+ it "has a working function #gvalue_int64_out" do
1389
+ skip
1109
1390
  end
1110
1391
 
1111
1392
  it "has a working function #gvalue_out" do
@@ -1113,11 +1394,19 @@ describe "GIMarshallingTests" do
1113
1394
  assert_equal 42, res.ruby_value
1114
1395
  end
1115
1396
 
1397
+ it "has a working function #gvalue_out_caller_allocates" do
1398
+ skip
1399
+ end
1400
+
1116
1401
  it "has a working function #gvalue_return" do
1117
1402
  res = GIMarshallingTests.gvalue_return
1118
1403
  assert_equal 42, res.ruby_value
1119
1404
  end
1120
1405
 
1406
+ it "has a working function #init_function" do
1407
+ skip
1408
+ end
1409
+
1121
1410
  it "has a working function #int16_in_max" do
1122
1411
  GIMarshallingTests.int16_in_max 0x7fff
1123
1412
  pass
@@ -1373,6 +1662,10 @@ describe "GIMarshallingTests" do
1373
1662
  assert_equal min_long, res
1374
1663
  end
1375
1664
 
1665
+ it "has a working function #multi_array_key_value_in" do
1666
+ skip
1667
+ end
1668
+
1376
1669
  it "has a working function #no_type_flags_in" do
1377
1670
  GIMarshallingTests.no_type_flags_in :value2
1378
1671
  pass
@@ -1398,6 +1691,16 @@ describe "GIMarshallingTests" do
1398
1691
  assert_equal :value2, res
1399
1692
  end
1400
1693
 
1694
+ it "has a working function #overrides_struct_returnv" do
1695
+ skip
1696
+ end
1697
+ it "has a working function #param_spec_out" do
1698
+ skip
1699
+ end
1700
+ it "has a working function #param_spec_return" do
1701
+ skip
1702
+ end
1703
+
1401
1704
  it "has a working function #pointer_in_return" do
1402
1705
  ptr = FFI::MemoryPointer.new 1
1403
1706
  res = GIMarshallingTests.pointer_in_return ptr
@@ -1416,6 +1719,10 @@ describe "GIMarshallingTests" do
1416
1719
  assert_equal 42, res.long_
1417
1720
  end
1418
1721
 
1722
+ it "has a working function #return_gvalue_flat_array" do
1723
+ skip
1724
+ end
1725
+
1419
1726
  it "has a working function #short_in_max" do
1420
1727
  GIMarshallingTests.short_in_max 0x7fff
1421
1728
  pass
@@ -1522,7 +1829,9 @@ describe "GIMarshallingTests" do
1522
1829
  assert_equal min_ssize_t, res
1523
1830
  end
1524
1831
 
1525
- it "has a working function #test_interface_test_int8_in"
1832
+ it "has a working function #test_interface_test_int8_in" do
1833
+ skip
1834
+ end
1526
1835
 
1527
1836
  it "has a working function #time_t_in" do
1528
1837
  GIMarshallingTests.time_t_in 1234567890
@@ -1661,11 +1970,13 @@ describe "GIMarshallingTests" do
1661
1970
  assert_equal max_ulong, res
1662
1971
  end
1663
1972
 
1664
- # This function is defined in the header but not implemented.
1665
- # it "has a working function #union_inout"
1973
+ it "has a working function #union_inout" do
1974
+ skip "This function is defined in the header but not implemented"
1975
+ end
1666
1976
 
1667
- # This function is defined in the header but not implemented.
1668
- # it "has a working function #union_out"
1977
+ it "has a working function #union_out" do
1978
+ skip "This function is defined in the header but not implemented"
1979
+ end
1669
1980
 
1670
1981
  it "has a working function #union_returnv" do
1671
1982
  res = GIMarshallingTests.union_returnv
@@ -1698,8 +2009,10 @@ describe "GIMarshallingTests" do
1698
2009
  assert_nil res
1699
2010
  end
1700
2011
 
1701
- # This function is defined in the header but not implemented.
1702
- # it "has a working function #utf8_full_in"
2012
+ it "has a working function #utf8_full_in" do
2013
+ skip "This function is defined in the header but not implemented"
2014
+ end
2015
+
1703
2016
 
1704
2017
  it "has a working function #utf8_full_inout" do
1705
2018
  res = GIMarshallingTests.utf8_full_inout "const ♥ utf8"
@@ -1736,4 +2049,3 @@ describe "GIMarshallingTests" do
1736
2049
  assert_equal "const ♥ utf8", res
1737
2050
  end
1738
2051
  end
1739
-