gir_ffi 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +11 -0
- data/TODO.rdoc +5 -0
- data/examples/01_empty_window.rb +0 -1
- data/examples/02_hello_world.rb +0 -1
- data/examples/03_upgraded_hello_world.rb +0 -1
- data/examples/04_webkit.rb +0 -1
- data/lib/gir_ffi/arg_helper.rb +231 -94
- data/lib/gir_ffi/builder/argument.rb +372 -46
- data/lib/gir_ffi/builder/module.rb +25 -10
- data/lib/gir_ffi/builder/type/constant.rb +39 -0
- data/lib/gir_ffi/builder/type/enum.rb +15 -5
- data/lib/gir_ffi/builder/type/registered_type.rb +25 -6
- data/lib/gir_ffi/builder/type/struct.rb +1 -9
- data/lib/gir_ffi/builder/type/union.rb +5 -0
- data/lib/gir_ffi/builder/type.rb +13 -14
- data/lib/gir_ffi/builder.rb +7 -4
- data/lib/gir_ffi/builder_helper.rb +4 -3
- data/lib/gir_ffi/i_base_info.rb +4 -0
- data/lib/gir_ffi/i_constant_info.rb +9 -0
- data/lib/gir_ffi/i_registered_type_info.rb +0 -1
- data/lib/gir_ffi/i_repository.rb +8 -2
- data/lib/gir_ffi/i_type_info.rb +7 -0
- data/lib/gir_ffi/lib.rb +41 -3
- data/lib/gir_ffi/overrides/glib.rb +188 -4
- data/lib/gir_ffi/overrides/gobject.rb +16 -5
- data/tasks/test.rake +1 -1
- data/test/arg_helper_test.rb +5 -5
- data/test/builder_test.rb +64 -41
- data/test/class_base_test.rb +1 -1
- data/test/function_definition_builder_test.rb +24 -2
- data/test/g_object_overrides_test.rb +1 -3
- data/test/g_object_test.rb +1 -1
- data/test/generated_gimarshallingtests_test.rb +1677 -0
- data/test/generated_gio_test.rb +1 -1
- data/test/generated_gtk_test.rb +31 -2
- data/test/generated_regress_test.rb +278 -54
- data/test/girffi_test.rb +20 -5
- data/test/glib_overrides_test.rb +81 -0
- data/test/gtk_overrides_test.rb +2 -3
- data/test/i_object_info_test.rb +1 -1
- data/test/i_repository_test.rb +3 -4
- data/test/lib/Makefile.am +18 -2
- data/test/module_builder_test.rb +1 -1
- data/test/test_helper.rb +88 -5
- data/test/type_builder_test.rb +7 -10
- metadata +16 -13
@@ -0,0 +1,1677 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('test_helper.rb', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
# Tests generated methods and functions in the GIMarshallingTests namespace.
|
5
|
+
describe "GIMarshallingTests" do
|
6
|
+
before do
|
7
|
+
GirFFI.setup :GIMarshallingTests
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "BoxedStruct" do
|
11
|
+
it "is created with #new" do
|
12
|
+
bx = GIMarshallingTests::BoxedStruct.new
|
13
|
+
assert_instance_of GIMarshallingTests::BoxedStruct, bx
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "an instance" do
|
17
|
+
before do
|
18
|
+
@bx = GIMarshallingTests::BoxedStruct.new
|
19
|
+
@bx[:long_] = 42
|
20
|
+
end
|
21
|
+
|
22
|
+
it "has a working method #inv" do
|
23
|
+
@bx.inv
|
24
|
+
pass
|
25
|
+
end
|
26
|
+
|
27
|
+
it "has a field :long_" do
|
28
|
+
assert_equal 42, @bx[:long_]
|
29
|
+
end
|
30
|
+
|
31
|
+
# TODO: More friendly access to array fields.
|
32
|
+
it "has a field :g_strv" do
|
33
|
+
assert @bx[:g_strv].null?
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
it "has the constant CONSTANT_GERROR_CODE" do
|
39
|
+
assert_equal 5, GIMarshallingTests::CONSTANT_GERROR_CODE
|
40
|
+
end
|
41
|
+
|
42
|
+
it "has the constant CONSTANT_GERROR_DOMAIN" do
|
43
|
+
assert_equal "gi-marshalling-tests-gerror-domain",
|
44
|
+
GIMarshallingTests::CONSTANT_GERROR_DOMAIN
|
45
|
+
end
|
46
|
+
|
47
|
+
it "has the constant CONSTANT_GERROR_MESSAGE" do
|
48
|
+
assert_equal "gi-marshalling-tests-gerror-message",
|
49
|
+
GIMarshallingTests::CONSTANT_GERROR_MESSAGE
|
50
|
+
end
|
51
|
+
|
52
|
+
it "has the constant CONSTANT_NUMBER" do
|
53
|
+
assert_equal 42, GIMarshallingTests::CONSTANT_NUMBER
|
54
|
+
end
|
55
|
+
|
56
|
+
it "has the constant CONSTANT_UTF8" do
|
57
|
+
assert_equal "const ♥ utf8", GIMarshallingTests::CONSTANT_UTF8
|
58
|
+
end
|
59
|
+
|
60
|
+
it "has the enum Enum" do
|
61
|
+
assert_equal 0, GIMarshallingTests::Enum[:value1]
|
62
|
+
assert_equal 1, GIMarshallingTests::Enum[:value2]
|
63
|
+
assert_equal 42, GIMarshallingTests::Enum[:value3]
|
64
|
+
end
|
65
|
+
|
66
|
+
it "has the bitfield Flags" do
|
67
|
+
assert_equal 1, GIMarshallingTests::Flags[:value1]
|
68
|
+
assert_equal 2, GIMarshallingTests::Flags[:value2]
|
69
|
+
assert_equal 4, GIMarshallingTests::Flags[:value3]
|
70
|
+
assert_equal 3, GIMarshallingTests::Flags[:mask]
|
71
|
+
assert_equal 3, GIMarshallingTests::Flags[:mask2]
|
72
|
+
end
|
73
|
+
|
74
|
+
it "has the enum GEnum" do
|
75
|
+
assert_equal 0, GIMarshallingTests::GEnum[:value1]
|
76
|
+
assert_equal 1, GIMarshallingTests::GEnum[:value2]
|
77
|
+
assert_equal 42, GIMarshallingTests::GEnum[:value3]
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "Interface" do
|
81
|
+
it "must be tested"
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "Interface2" do
|
85
|
+
it "must be tested"
|
86
|
+
end
|
87
|
+
|
88
|
+
describe "NestedStruct" do
|
89
|
+
it "contains a SimpleStruct" do
|
90
|
+
ns = GIMarshallingTests::NestedStruct.new
|
91
|
+
# FIXME: Make it an instance of SimpleStruct
|
92
|
+
assert_instance_of GIMarshallingTests::SimpleStruct::Struct,
|
93
|
+
ns[:simple_struct]
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
it "has the bitfield NoTypeFlags" do
|
98
|
+
assert_equal 1, GIMarshallingTests::NoTypeFlags[:value1]
|
99
|
+
assert_equal 2, GIMarshallingTests::NoTypeFlags[:value2]
|
100
|
+
assert_equal 4, GIMarshallingTests::NoTypeFlags[:value3]
|
101
|
+
assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask]
|
102
|
+
assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask2]
|
103
|
+
end
|
104
|
+
|
105
|
+
describe "NotSimpleStruct" do
|
106
|
+
it "must be tested"
|
107
|
+
end
|
108
|
+
|
109
|
+
it "has the constant OVERRIDES_CONSTANT" do
|
110
|
+
assert_equal 42, GIMarshallingTests::OVERRIDES_CONSTANT
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "Object" do
|
114
|
+
it "creates instances with #new" do
|
115
|
+
ob = GIMarshallingTests::Object.new 42
|
116
|
+
assert_instance_of GIMarshallingTests::Object, ob
|
117
|
+
assert_equal 42, ob[:int_]
|
118
|
+
end
|
119
|
+
|
120
|
+
it "has a working function #full_inout" do
|
121
|
+
ob = GIMarshallingTests::Object.new 42
|
122
|
+
res = GIMarshallingTests::Object.full_inout ob
|
123
|
+
assert_instance_of GIMarshallingTests::Object, res
|
124
|
+
refute_equal res.to_ptr, ob.to_ptr
|
125
|
+
end
|
126
|
+
|
127
|
+
it "has a working function #full_out" do
|
128
|
+
res = GIMarshallingTests::Object.full_out
|
129
|
+
assert_instance_of GIMarshallingTests::Object, res
|
130
|
+
end
|
131
|
+
|
132
|
+
it "has a working function #full_return" do
|
133
|
+
res = GIMarshallingTests::Object.full_return
|
134
|
+
assert_instance_of GIMarshallingTests::Object, res
|
135
|
+
end
|
136
|
+
|
137
|
+
# This function is only found in the header
|
138
|
+
# it "has a working function #inout_same"
|
139
|
+
|
140
|
+
it "has a working function #none_inout" do
|
141
|
+
ob = GIMarshallingTests::Object.new 42
|
142
|
+
res = GIMarshallingTests::Object.none_inout ob
|
143
|
+
assert_instance_of GIMarshallingTests::Object, res
|
144
|
+
refute_equal res.to_ptr, ob.to_ptr
|
145
|
+
end
|
146
|
+
|
147
|
+
it "has a working function #none_out" do
|
148
|
+
res = GIMarshallingTests::Object.none_out
|
149
|
+
assert_instance_of GIMarshallingTests::Object, res
|
150
|
+
end
|
151
|
+
|
152
|
+
it "has a working function #none_return" do
|
153
|
+
res = GIMarshallingTests::Object.none_return
|
154
|
+
assert_instance_of GIMarshallingTests::Object, res
|
155
|
+
end
|
156
|
+
|
157
|
+
it "has a working function #static_method" do
|
158
|
+
GIMarshallingTests::Object.static_method
|
159
|
+
pass
|
160
|
+
end
|
161
|
+
|
162
|
+
it "has a working function #static_method" do
|
163
|
+
GIMarshallingTests::Object.static_method
|
164
|
+
pass
|
165
|
+
end
|
166
|
+
|
167
|
+
describe "an instance" do
|
168
|
+
before do
|
169
|
+
@obj = GIMarshallingTests::Object.new 42
|
170
|
+
end
|
171
|
+
|
172
|
+
it "has a working virtual method #method_int8_in"
|
173
|
+
it "has a working virtual method #method_int8_out"
|
174
|
+
|
175
|
+
it "has a working virtual method #method_with_default_implementation" do
|
176
|
+
@obj.method_with_default_implementation 104
|
177
|
+
assert_equal 104, @obj[:int_]
|
178
|
+
end
|
179
|
+
|
180
|
+
# This function is only found in the header
|
181
|
+
# it "has a working method #full_in"
|
182
|
+
|
183
|
+
it "has a working method #int8_in"
|
184
|
+
it "has a working method #int8_out"
|
185
|
+
|
186
|
+
# TODO: Avoid using common method names?
|
187
|
+
it "has a working method #method" do
|
188
|
+
@obj.method
|
189
|
+
pass
|
190
|
+
end
|
191
|
+
|
192
|
+
it "has a working method #method_array_in" do
|
193
|
+
@obj.method_array_in [-1, 0, 1, 2]
|
194
|
+
pass
|
195
|
+
end
|
196
|
+
|
197
|
+
it "has a working method #method_array_inout" do
|
198
|
+
res = @obj.method_array_inout [-1, 0, 1, 2]
|
199
|
+
assert_equal [-2, -1, 0, 1, 2], res
|
200
|
+
end
|
201
|
+
|
202
|
+
it "has a working method #method_array_out" do
|
203
|
+
res = @obj.method_array_out
|
204
|
+
assert_equal [-1, 0, 1, 2], res
|
205
|
+
end
|
206
|
+
|
207
|
+
it "has a working method #method_array_return" do
|
208
|
+
res = @obj.method_array_return
|
209
|
+
assert_equal [-1, 0, 1, 2], res
|
210
|
+
end
|
211
|
+
|
212
|
+
it "has a working method #none_in" do
|
213
|
+
@obj.none_in
|
214
|
+
pass
|
215
|
+
end
|
216
|
+
|
217
|
+
it "has a working method #overridden_method" do
|
218
|
+
@obj[:int_] = 0
|
219
|
+
@obj.overridden_method
|
220
|
+
pass
|
221
|
+
end
|
222
|
+
|
223
|
+
it "has a property 'int'"
|
224
|
+
|
225
|
+
it "has a field parent_instance containing the parent struct" do
|
226
|
+
assert_instance_of GObject::Object::Struct, @obj[:parent_instance]
|
227
|
+
end
|
228
|
+
|
229
|
+
it "has a field int_ containing the argument to #new" do
|
230
|
+
assert_equal 42, @obj[:int_]
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
describe "OverridesObject" do
|
236
|
+
it "creates instances with #new" do
|
237
|
+
ob = GIMarshallingTests::OverridesObject.new
|
238
|
+
assert_instance_of GIMarshallingTests::OverridesObject, ob
|
239
|
+
end
|
240
|
+
|
241
|
+
it "creates instances with #returnv" do
|
242
|
+
ob = GIMarshallingTests::OverridesObject.returnv
|
243
|
+
assert_instance_of GIMarshallingTests::OverridesObject, ob
|
244
|
+
end
|
245
|
+
|
246
|
+
describe "an instance" do
|
247
|
+
before do
|
248
|
+
@obj = GIMarshallingTests::OverridesObject.new
|
249
|
+
end
|
250
|
+
|
251
|
+
it "has a field parent_instance containing the parent struct" do
|
252
|
+
assert_instance_of GObject::Object::Struct, @obj[:parent_instance]
|
253
|
+
end
|
254
|
+
|
255
|
+
it "has a field long_" do
|
256
|
+
assert_equal 0.0, @obj[:long_]
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
describe "PointerStruct" do
|
262
|
+
it "creates instances with #new" do
|
263
|
+
ps = GIMarshallingTests::PointerStruct.new
|
264
|
+
assert_instance_of GIMarshallingTests::PointerStruct, ps
|
265
|
+
end
|
266
|
+
|
267
|
+
describe "an instance" do
|
268
|
+
before do
|
269
|
+
@ps = GIMarshallingTests::PointerStruct.new
|
270
|
+
end
|
271
|
+
|
272
|
+
it "has a field long_" do
|
273
|
+
assert_equal 0.0, @ps[:long_]
|
274
|
+
end
|
275
|
+
|
276
|
+
it "has a working method #inv" do
|
277
|
+
@ps[:long_] = 42.0
|
278
|
+
@ps.inv
|
279
|
+
pass
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
it "has the enum SecondEnum" do
|
285
|
+
assert_equal 0, GIMarshallingTests::SecondEnum[:secondvalue1]
|
286
|
+
assert_equal 1, GIMarshallingTests::SecondEnum[:secondvalue2]
|
287
|
+
end
|
288
|
+
|
289
|
+
describe "SimpleStruct" do
|
290
|
+
it "creates instances with #new" do
|
291
|
+
ss = GIMarshallingTests::SimpleStruct.new
|
292
|
+
assert_instance_of GIMarshallingTests::SimpleStruct, ss
|
293
|
+
end
|
294
|
+
|
295
|
+
describe "an instance" do
|
296
|
+
before do
|
297
|
+
@ss = GIMarshallingTests::SimpleStruct.new
|
298
|
+
end
|
299
|
+
|
300
|
+
it "has a field long_" do
|
301
|
+
assert_equal 0, @ss[:long_]
|
302
|
+
end
|
303
|
+
|
304
|
+
it "has a field int8" do
|
305
|
+
assert_equal 0, @ss[:int8]
|
306
|
+
end
|
307
|
+
|
308
|
+
it "has a working method #inv" do
|
309
|
+
@ss[:long_] = 6
|
310
|
+
@ss[:int8] = 7
|
311
|
+
@ss.inv
|
312
|
+
pass
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
describe "SubObject" do
|
318
|
+
it "creates instances with #new" do
|
319
|
+
so = GIMarshallingTests::SubObject.new 42
|
320
|
+
assert_instance_of GIMarshallingTests::SubObject, so
|
321
|
+
end
|
322
|
+
|
323
|
+
describe "an instance" do
|
324
|
+
before do
|
325
|
+
@so = GIMarshallingTests::SubObject.new 0
|
326
|
+
end
|
327
|
+
|
328
|
+
it "has the method #overwritten_method" do
|
329
|
+
@so.overwritten_method
|
330
|
+
pass
|
331
|
+
end
|
332
|
+
|
333
|
+
it "has the method #sub_method" do
|
334
|
+
@so.sub_method
|
335
|
+
pass
|
336
|
+
end
|
337
|
+
|
338
|
+
it "has a field parent_instance containing the parent struct" do
|
339
|
+
assert_instance_of GIMarshallingTests::Object::Struct, @so[:parent_instance]
|
340
|
+
end
|
341
|
+
|
342
|
+
it "has a working inherited virtual method #method_int8_in"
|
343
|
+
it "has a working inherited virtual method #method_int8_out"
|
344
|
+
|
345
|
+
it "has a working inherited virtual method #method_with_default_implementation" do
|
346
|
+
@so.method_with_default_implementation 104
|
347
|
+
assert_equal 104, @so[:parent_instance][:int_]
|
348
|
+
end
|
349
|
+
|
350
|
+
it "has a working inherited method #int8_in"
|
351
|
+
it "has a working inherited method #int8_out"
|
352
|
+
|
353
|
+
it "has a working inherited method #method" do
|
354
|
+
@so[:parent_instance][:int_] = 42
|
355
|
+
@so.method
|
356
|
+
pass
|
357
|
+
end
|
358
|
+
|
359
|
+
it "has a working inherited method #method_array_in" do
|
360
|
+
@so.method_array_in [-1, 0, 1, 2]
|
361
|
+
pass
|
362
|
+
end
|
363
|
+
|
364
|
+
it "has a working inherited method #method_array_inout" do
|
365
|
+
res = @so.method_array_inout [-1, 0, 1, 2]
|
366
|
+
assert_equal [-2, -1, 0, 1, 2], res
|
367
|
+
end
|
368
|
+
|
369
|
+
it "has a working inherited method #method_array_out" do
|
370
|
+
res = @so.method_array_out
|
371
|
+
assert_equal [-1, 0, 1, 2], res
|
372
|
+
end
|
373
|
+
|
374
|
+
it "has a working inherited method #method_array_return" do
|
375
|
+
res = @so.method_array_return
|
376
|
+
assert_equal [-1, 0, 1, 2], res
|
377
|
+
end
|
378
|
+
|
379
|
+
it "has a working inherited method #none_in" do
|
380
|
+
@so[:parent_instance][:int_] = 42
|
381
|
+
@so.none_in
|
382
|
+
pass
|
383
|
+
end
|
384
|
+
|
385
|
+
it "has a working inherited method #overridden_method" do
|
386
|
+
@so[:parent_instance][:int_] = 0
|
387
|
+
@so.overridden_method
|
388
|
+
pass
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
393
|
+
describe "Union" do
|
394
|
+
it "creates an instance with #new" do
|
395
|
+
u = GIMarshallingTests::Union.new
|
396
|
+
assert_instance_of GIMarshallingTests::Union, u
|
397
|
+
end
|
398
|
+
|
399
|
+
describe "an instance" do
|
400
|
+
before do
|
401
|
+
@it = GIMarshallingTests::Union.new
|
402
|
+
end
|
403
|
+
|
404
|
+
it "has a field long_" do
|
405
|
+
assert_equal 0, @it[:long_]
|
406
|
+
end
|
407
|
+
|
408
|
+
it "has a working method #inv" do
|
409
|
+
@it[:long_] = 42
|
410
|
+
@it.inv
|
411
|
+
pass
|
412
|
+
end
|
413
|
+
|
414
|
+
it "has a working method #method" do
|
415
|
+
@it[:long_] = 42
|
416
|
+
@it.method
|
417
|
+
pass
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
it "has a working function #array_fixed_inout" do
|
423
|
+
res = GIMarshallingTests.array_fixed_inout [-1, 0, 1, 2]
|
424
|
+
assert_equal [2, 1, 0, -1], res
|
425
|
+
end
|
426
|
+
|
427
|
+
it "has a working function #array_fixed_int_in" do
|
428
|
+
GIMarshallingTests.array_fixed_int_in [-1, 0, 1, 2]
|
429
|
+
pass
|
430
|
+
end
|
431
|
+
|
432
|
+
it "has a working function #array_fixed_int_return" do
|
433
|
+
res = GIMarshallingTests.array_fixed_int_return
|
434
|
+
assert_equal [-1, 0, 1, 2], res
|
435
|
+
end
|
436
|
+
|
437
|
+
it "has a working function #array_fixed_out" do
|
438
|
+
res = GIMarshallingTests.array_fixed_out
|
439
|
+
assert_equal [-1, 0, 1, 2], res
|
440
|
+
end
|
441
|
+
|
442
|
+
it "has a working function #array_fixed_out_struct" do
|
443
|
+
res = GIMarshallingTests.array_fixed_out_struct
|
444
|
+
assert_equal [[7, 6], [6, 7]], res.map {|s| [s[:long_], s[:int8]]}
|
445
|
+
end
|
446
|
+
|
447
|
+
it "has a working function #array_fixed_short_in" do
|
448
|
+
GIMarshallingTests.array_fixed_short_in [-1, 0, 1, 2]
|
449
|
+
pass
|
450
|
+
end
|
451
|
+
|
452
|
+
it "has a working function #array_fixed_short_return" do
|
453
|
+
res = GIMarshallingTests.array_fixed_short_return
|
454
|
+
assert_equal [-1, 0, 1, 2], res
|
455
|
+
end
|
456
|
+
|
457
|
+
it "has a working function #array_gvariant_in" do
|
458
|
+
v1 = GLib::Variant.new_int32(27)
|
459
|
+
v2 = GLib::Variant.new_string("Hello")
|
460
|
+
res = GIMarshallingTests.array_gvariant_in [v1, v2]
|
461
|
+
pass
|
462
|
+
# TODO: Can we determine that res should be an array?
|
463
|
+
# assert_equal 27, res[0].get_int32
|
464
|
+
# assert_equal "Hello", res[1].get_string
|
465
|
+
end
|
466
|
+
|
467
|
+
it "has a working function #array_in" do
|
468
|
+
GIMarshallingTests.array_in [-1, 0, 1, 2]
|
469
|
+
pass
|
470
|
+
end
|
471
|
+
|
472
|
+
it "has a working function #array_inout" do
|
473
|
+
res = GIMarshallingTests.array_inout [-1, 0, 1, 2]
|
474
|
+
assert_equal [-2, -1, 0, 1, 2], res
|
475
|
+
end
|
476
|
+
|
477
|
+
it "has a working function #array_out" do
|
478
|
+
res = GIMarshallingTests.array_out
|
479
|
+
assert_equal [-1, 0, 1, 2], res
|
480
|
+
end
|
481
|
+
|
482
|
+
it "has a working function #array_return" do
|
483
|
+
res = GIMarshallingTests.array_return
|
484
|
+
assert_equal [-1, 0, 1, 2], res
|
485
|
+
end
|
486
|
+
|
487
|
+
it "has a working function #array_uint8_in" do
|
488
|
+
arr = "abcd".bytes.to_a
|
489
|
+
GIMarshallingTests.array_uint8_in arr
|
490
|
+
pass
|
491
|
+
end
|
492
|
+
|
493
|
+
it "has a working function #array_zero_terminated_in" do
|
494
|
+
GIMarshallingTests.array_zero_terminated_in ["0", "1", "2"]
|
495
|
+
pass
|
496
|
+
end
|
497
|
+
|
498
|
+
it "has a working function #array_zero_terminated_out" do
|
499
|
+
res = GIMarshallingTests.array_zero_terminated_out
|
500
|
+
assert_equal ["0", "1", "2"], res
|
501
|
+
end
|
502
|
+
|
503
|
+
it "has a working function #array_zero_terminated_return" do
|
504
|
+
res = GIMarshallingTests.array_zero_terminated_return
|
505
|
+
assert_equal ["0", "1", "2"], res
|
506
|
+
end
|
507
|
+
|
508
|
+
it "has a working function #boolean_in_false" do
|
509
|
+
GIMarshallingTests.boolean_in_false false
|
510
|
+
pass
|
511
|
+
end
|
512
|
+
|
513
|
+
it "has a working function #boolean_in_true" do
|
514
|
+
GIMarshallingTests.boolean_in_true true
|
515
|
+
pass
|
516
|
+
end
|
517
|
+
|
518
|
+
it "has a working function #boolean_inout_false_true" do
|
519
|
+
res = GIMarshallingTests.boolean_inout_false_true false
|
520
|
+
assert_equal true, res
|
521
|
+
end
|
522
|
+
|
523
|
+
it "has a working function #boolean_inout_true_false" do
|
524
|
+
res = GIMarshallingTests.boolean_inout_true_false true
|
525
|
+
assert_equal false, res
|
526
|
+
end
|
527
|
+
|
528
|
+
it "has a working function #boolean_out_false" do
|
529
|
+
res = GIMarshallingTests.boolean_out_false
|
530
|
+
assert_equal false, res
|
531
|
+
end
|
532
|
+
|
533
|
+
it "has a working function #boolean_out_true" do
|
534
|
+
res = GIMarshallingTests.boolean_out_true
|
535
|
+
assert_equal true, res
|
536
|
+
end
|
537
|
+
|
538
|
+
it "has a working function #boolean_return_false" do
|
539
|
+
res = GIMarshallingTests.boolean_return_false
|
540
|
+
assert_equal false, res
|
541
|
+
end
|
542
|
+
|
543
|
+
it "has a working function #boolean_return_true" do
|
544
|
+
res = GIMarshallingTests.boolean_return_true
|
545
|
+
assert_equal true, res
|
546
|
+
end
|
547
|
+
|
548
|
+
it "has a working function #boxed_struct_inout" do
|
549
|
+
bx = GIMarshallingTests::BoxedStruct.new
|
550
|
+
bx[:long_] = 42
|
551
|
+
res = GIMarshallingTests.boxed_struct_inout bx
|
552
|
+
assert_equal 0, res[:long_]
|
553
|
+
end
|
554
|
+
|
555
|
+
it "has a working function #boxed_struct_out" do
|
556
|
+
res = GIMarshallingTests.boxed_struct_out
|
557
|
+
assert_equal 42, res[:long_]
|
558
|
+
end
|
559
|
+
|
560
|
+
it "has a working function #boxed_struct_returnv" do
|
561
|
+
res = GIMarshallingTests.boxed_struct_returnv
|
562
|
+
assert_equal 42, res[:long_]
|
563
|
+
assert_equal ["0", "1", "2"], GirFFI::ArgHelper.strv_to_utf8_array(res[:g_strv])
|
564
|
+
end
|
565
|
+
|
566
|
+
it "has a working function #bytearray_full_return" do
|
567
|
+
ret = GIMarshallingTests.bytearray_full_return
|
568
|
+
assert_instance_of GLib::ByteArray, ret
|
569
|
+
assert_equal "0123", ret.to_string
|
570
|
+
end
|
571
|
+
|
572
|
+
it "has a working function #bytearray_none_in" do
|
573
|
+
ba = GLib.byte_array_new
|
574
|
+
GLib.byte_array_append ba, "0123"
|
575
|
+
GIMarshallingTests.bytearray_none_in ba
|
576
|
+
pass
|
577
|
+
end
|
578
|
+
|
579
|
+
it "has a working function #double_in" do
|
580
|
+
GIMarshallingTests.double_in Float::MAX
|
581
|
+
pass
|
582
|
+
end
|
583
|
+
|
584
|
+
it "has a working function #double_inout" do
|
585
|
+
ret = GIMarshallingTests.double_inout Float::MAX
|
586
|
+
assert_in_epsilon 2.225e-308, ret
|
587
|
+
end
|
588
|
+
|
589
|
+
it "has a working function #double_out" do
|
590
|
+
ret = GIMarshallingTests.double_out
|
591
|
+
assert_equal Float::MAX, ret
|
592
|
+
end
|
593
|
+
|
594
|
+
it "has a working function #double_return" do
|
595
|
+
ret = GIMarshallingTests.double_return
|
596
|
+
assert_equal Float::MAX, ret
|
597
|
+
end
|
598
|
+
|
599
|
+
it "has a working function #enum_in" do
|
600
|
+
GIMarshallingTests.enum_in :value3
|
601
|
+
pass
|
602
|
+
end
|
603
|
+
|
604
|
+
it "has a working function #enum_inout" do
|
605
|
+
e = GIMarshallingTests.enum_inout :value3
|
606
|
+
assert_equal :value1, e
|
607
|
+
end
|
608
|
+
|
609
|
+
it "has a working function #enum_out" do
|
610
|
+
e = GIMarshallingTests.enum_out
|
611
|
+
assert_equal :value3, e
|
612
|
+
end
|
613
|
+
|
614
|
+
it "has a working function #enum_returnv" do
|
615
|
+
e = GIMarshallingTests.enum_returnv
|
616
|
+
assert_equal :value3, e
|
617
|
+
end
|
618
|
+
|
619
|
+
it "has a working function #filename_list_return" do
|
620
|
+
fl = GIMarshallingTests.filename_list_return
|
621
|
+
assert_equal nil, fl
|
622
|
+
end
|
623
|
+
|
624
|
+
it "has a working function #flags_in" do
|
625
|
+
GIMarshallingTests.flags_in :value2
|
626
|
+
pass
|
627
|
+
end
|
628
|
+
|
629
|
+
it "has a working function #flags_in_zero" do
|
630
|
+
GIMarshallingTests.flags_in_zero 0
|
631
|
+
pass
|
632
|
+
end
|
633
|
+
|
634
|
+
it "has a working function #flags_inout" do
|
635
|
+
res = GIMarshallingTests.flags_inout :value2
|
636
|
+
assert_equal :value1, res
|
637
|
+
end
|
638
|
+
|
639
|
+
it "has a working function #flags_out" do
|
640
|
+
res = GIMarshallingTests.flags_out
|
641
|
+
assert_equal :value2, res
|
642
|
+
end
|
643
|
+
|
644
|
+
it "has a working function #flags_returnv" do
|
645
|
+
res = GIMarshallingTests.flags_returnv
|
646
|
+
assert_equal :value2, res
|
647
|
+
end
|
648
|
+
|
649
|
+
it "has a working function #float_in" do
|
650
|
+
# float_return returns MAX_FLT
|
651
|
+
flt = GIMarshallingTests.float_return
|
652
|
+
GIMarshallingTests.float_in flt
|
653
|
+
pass
|
654
|
+
end
|
655
|
+
|
656
|
+
it "has a working function #float_inout" do
|
657
|
+
# float_return returns MAX_FLT
|
658
|
+
flt = GIMarshallingTests.float_return
|
659
|
+
res = GIMarshallingTests.float_inout flt
|
660
|
+
assert_in_epsilon 1.175e-38, res
|
661
|
+
end
|
662
|
+
|
663
|
+
it "has a working function #float_out" do
|
664
|
+
flt = GIMarshallingTests.float_out
|
665
|
+
assert_in_epsilon 3.402e+38, flt
|
666
|
+
end
|
667
|
+
|
668
|
+
it "has a working function #float_return" do
|
669
|
+
flt = GIMarshallingTests.float_return
|
670
|
+
assert_in_epsilon 3.402e+38, flt
|
671
|
+
end
|
672
|
+
|
673
|
+
it "has a working function #garray_int_none_in" do
|
674
|
+
arr = GLib.array_new :int
|
675
|
+
GLib.array_append_vals arr, [-1, 0, 1, 2]
|
676
|
+
GIMarshallingTests.garray_int_none_in arr
|
677
|
+
pass
|
678
|
+
end
|
679
|
+
|
680
|
+
it "has a working function #garray_int_none_return" do
|
681
|
+
arr = GIMarshallingTests.garray_int_none_return
|
682
|
+
assert_equal [-1, 0, 1, 2], arr.to_a
|
683
|
+
end
|
684
|
+
|
685
|
+
it "has a working function #garray_utf8_container_out" do
|
686
|
+
res = GIMarshallingTests.garray_utf8_container_out
|
687
|
+
assert_equal ["0", "1", "2"], res.to_a
|
688
|
+
end
|
689
|
+
|
690
|
+
it "has a working function #garray_utf8_container_return" do
|
691
|
+
res = GIMarshallingTests.garray_utf8_container_return
|
692
|
+
assert_equal ["0", "1", "2"], res.to_a
|
693
|
+
end
|
694
|
+
|
695
|
+
# TODO: Allow regular arrays as arguments directly.
|
696
|
+
it "has a working function #garray_utf8_full_inout" do
|
697
|
+
arr = GLib.array_new :utf8
|
698
|
+
GLib.array_append_vals arr, ["0", "1", "2"]
|
699
|
+
res = GIMarshallingTests.garray_utf8_full_inout arr
|
700
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
701
|
+
end
|
702
|
+
|
703
|
+
it "has a working function #garray_utf8_full_out" do
|
704
|
+
res = GIMarshallingTests.garray_utf8_full_out
|
705
|
+
assert_equal ["0", "1", "2"], res.to_a
|
706
|
+
end
|
707
|
+
|
708
|
+
it "has a working function #garray_utf8_full_return" do
|
709
|
+
res = GIMarshallingTests.garray_utf8_full_return
|
710
|
+
assert_equal ["0", "1", "2"], res.to_a
|
711
|
+
end
|
712
|
+
|
713
|
+
it "has a working function #garray_utf8_none_in" do
|
714
|
+
arr = GLib.array_new :utf8
|
715
|
+
GLib.array_append_vals arr, ["0", "1", "2"]
|
716
|
+
GIMarshallingTests.garray_utf8_none_in arr
|
717
|
+
pass
|
718
|
+
end
|
719
|
+
|
720
|
+
it "has a working function #garray_utf8_none_inout" do
|
721
|
+
arr = GLib.array_new :utf8
|
722
|
+
GLib.array_append_vals arr, ["0", "1", "2"]
|
723
|
+
res = GIMarshallingTests.garray_utf8_none_inout arr
|
724
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
725
|
+
end
|
726
|
+
|
727
|
+
it "has a working function #garray_utf8_none_out" do
|
728
|
+
res = GIMarshallingTests.garray_utf8_none_out
|
729
|
+
assert_equal ["0", "1", "2"], res.to_a
|
730
|
+
end
|
731
|
+
|
732
|
+
it "has a working function #garray_utf8_none_return" do
|
733
|
+
res = GIMarshallingTests.garray_utf8_none_return
|
734
|
+
assert_equal ["0", "1", "2"], res.to_a
|
735
|
+
end
|
736
|
+
|
737
|
+
it "has a working function #gclosure_in" do
|
738
|
+
cl = GObject::RubyClosure.new { 42 }
|
739
|
+
GIMarshallingTests.gclosure_in cl
|
740
|
+
end
|
741
|
+
|
742
|
+
it "has a working function #gclosure_return" do
|
743
|
+
cl = GIMarshallingTests.gclosure_return
|
744
|
+
gv = GObject::Value.wrap_ruby_value 0
|
745
|
+
cl.invoke gv, nil, nil
|
746
|
+
assert_equal 42, gv.ruby_value
|
747
|
+
end
|
748
|
+
|
749
|
+
it "has a working function #genum_in" do
|
750
|
+
GIMarshallingTests.genum_in :value3
|
751
|
+
pass
|
752
|
+
end
|
753
|
+
|
754
|
+
it "has a working function #genum_inout" do
|
755
|
+
res = GIMarshallingTests.genum_inout :value3
|
756
|
+
assert_equal :value1, res
|
757
|
+
end
|
758
|
+
|
759
|
+
it "has a working function #genum_out" do
|
760
|
+
res = GIMarshallingTests.genum_out
|
761
|
+
assert_equal :value3, res
|
762
|
+
end
|
763
|
+
|
764
|
+
it "has a working function #genum_returnv" do
|
765
|
+
res = GIMarshallingTests.genum_returnv
|
766
|
+
assert_equal :value3, res
|
767
|
+
end
|
768
|
+
|
769
|
+
it "has a working function #gerror" do
|
770
|
+
begin
|
771
|
+
GIMarshallingTests.gerror
|
772
|
+
rescue RuntimeError => e
|
773
|
+
assert_equal "gi-marshalling-tests-gerror-message", e.message
|
774
|
+
end
|
775
|
+
end
|
776
|
+
|
777
|
+
it "has a working function #gerror_array_in" do
|
778
|
+
begin
|
779
|
+
GIMarshallingTests.gerror_array_in [1, 2, 3]
|
780
|
+
rescue RuntimeError => e
|
781
|
+
assert_equal "gi-marshalling-tests-gerror-message", e.message
|
782
|
+
end
|
783
|
+
end
|
784
|
+
|
785
|
+
it "has a working function #ghashtable_int_none_in" do
|
786
|
+
GIMarshallingTests.ghashtable_int_none_in(
|
787
|
+
{-1 => 1, 0 => 0, 1 => -1, 2 => -2})
|
788
|
+
end
|
789
|
+
|
790
|
+
it "has a working function #ghashtable_int_none_return" do
|
791
|
+
gh = GIMarshallingTests.ghashtable_int_none_return
|
792
|
+
assert_equal({-1 => 1, 0 => 0, 1 => -1, 2 => -2}, gh.to_hash)
|
793
|
+
end
|
794
|
+
|
795
|
+
# XXX: Only defined in header
|
796
|
+
# it "has a working function #ghashtable_utf8_container_in"
|
797
|
+
|
798
|
+
it "has a working function #ghashtable_utf8_container_inout" do
|
799
|
+
hsh = {"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"}
|
800
|
+
res = GIMarshallingTests.ghashtable_utf8_container_inout hsh
|
801
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "1"}, res.to_hash)
|
802
|
+
end
|
803
|
+
|
804
|
+
it "has a working function #ghashtable_utf8_container_out" do
|
805
|
+
res = GIMarshallingTests.ghashtable_utf8_container_out
|
806
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"},
|
807
|
+
res.to_hash)
|
808
|
+
end
|
809
|
+
|
810
|
+
it "has a working function #ghashtable_utf8_container_return" do
|
811
|
+
res = GIMarshallingTests.ghashtable_utf8_container_return
|
812
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"},
|
813
|
+
res.to_hash)
|
814
|
+
end
|
815
|
+
|
816
|
+
# XXX: Only defined in header
|
817
|
+
# it "has a working function #ghashtable_utf8_full_in"
|
818
|
+
|
819
|
+
it "has a working function #ghashtable_utf8_full_inout" do
|
820
|
+
hsh = {"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"}
|
821
|
+
res = GIMarshallingTests.ghashtable_utf8_full_inout hsh
|
822
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "1"}, res.to_hash)
|
823
|
+
end
|
824
|
+
|
825
|
+
it "has a working function #ghashtable_utf8_full_out" do
|
826
|
+
res = GIMarshallingTests.ghashtable_utf8_full_out
|
827
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"},
|
828
|
+
res.to_hash)
|
829
|
+
end
|
830
|
+
|
831
|
+
it "has a working function #ghashtable_utf8_full_return" do
|
832
|
+
res = GIMarshallingTests.ghashtable_utf8_full_return
|
833
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"},
|
834
|
+
res.to_hash)
|
835
|
+
end
|
836
|
+
|
837
|
+
it "has a working function #ghashtable_utf8_none_in" do
|
838
|
+
hsh = {"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"}
|
839
|
+
GIMarshallingTests.ghashtable_utf8_none_in hsh
|
840
|
+
pass
|
841
|
+
end
|
842
|
+
|
843
|
+
it "has a working function #ghashtable_utf8_none_inout" do
|
844
|
+
hsh = {"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"}
|
845
|
+
res = GIMarshallingTests.ghashtable_utf8_none_inout hsh
|
846
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "1"}, res.to_hash)
|
847
|
+
end
|
848
|
+
|
849
|
+
it "has a working function #ghashtable_utf8_none_out" do
|
850
|
+
res = GIMarshallingTests.ghashtable_utf8_none_out
|
851
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"},
|
852
|
+
res.to_hash)
|
853
|
+
end
|
854
|
+
|
855
|
+
it "has a working function #ghashtable_utf8_none_return" do
|
856
|
+
res = GIMarshallingTests.ghashtable_utf8_none_return
|
857
|
+
assert_equal({"-1" => "1", "0" => "0", "1" => "-1", "2" => "-2"},
|
858
|
+
res.to_hash)
|
859
|
+
end
|
860
|
+
|
861
|
+
it "has a working function #glist_int_none_in" do
|
862
|
+
GIMarshallingTests.glist_int_none_in [-1, 0, 1, 2]
|
863
|
+
pass
|
864
|
+
end
|
865
|
+
|
866
|
+
it "has a working function #glist_int_none_return" do
|
867
|
+
res = GIMarshallingTests.glist_int_none_return
|
868
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
869
|
+
end
|
870
|
+
|
871
|
+
# XXX: Only defined in header
|
872
|
+
# it "has a working function #glist_utf8_container_in"
|
873
|
+
|
874
|
+
it "has a working function #glist_utf8_container_inout" do
|
875
|
+
res = GIMarshallingTests.glist_utf8_container_inout ["0", "1", "2"]
|
876
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
877
|
+
end
|
878
|
+
|
879
|
+
it "has a working function #glist_utf8_container_out" do
|
880
|
+
res = GIMarshallingTests.glist_utf8_container_out
|
881
|
+
assert_equal ["0", "1", "2"], res.to_a
|
882
|
+
end
|
883
|
+
|
884
|
+
it "has a working function #glist_utf8_container_return" do
|
885
|
+
res = GIMarshallingTests.glist_utf8_container_return
|
886
|
+
assert_equal ["0", "1", "2"], res.to_a
|
887
|
+
end
|
888
|
+
|
889
|
+
# XXX: Only defined in header
|
890
|
+
# it "has a working function #glist_utf8_full_in"
|
891
|
+
|
892
|
+
it "has a working function #glist_utf8_full_inout" do
|
893
|
+
res = GIMarshallingTests.glist_utf8_full_inout ["0", "1", "2"]
|
894
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
895
|
+
end
|
896
|
+
|
897
|
+
it "has a working function #glist_utf8_full_out" do
|
898
|
+
res = GIMarshallingTests.glist_utf8_full_out
|
899
|
+
assert_equal ["0", "1", "2"], res.to_a
|
900
|
+
end
|
901
|
+
|
902
|
+
it "has a working function #glist_utf8_full_return" do
|
903
|
+
res = GIMarshallingTests.glist_utf8_full_return
|
904
|
+
assert_equal ["0", "1", "2"], res.to_a
|
905
|
+
end
|
906
|
+
|
907
|
+
it "has a working function #glist_utf8_none_in" do
|
908
|
+
GIMarshallingTests.glist_utf8_none_in ["0", "1", "2"]
|
909
|
+
end
|
910
|
+
|
911
|
+
it "has a working function #glist_utf8_none_inout" do
|
912
|
+
res = GIMarshallingTests.glist_utf8_none_inout ["0", "1", "2"]
|
913
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
914
|
+
end
|
915
|
+
|
916
|
+
it "has a working function #glist_utf8_none_out" do
|
917
|
+
res = GIMarshallingTests.glist_utf8_none_out
|
918
|
+
assert_equal ["0", "1", "2"], res.to_a
|
919
|
+
end
|
920
|
+
|
921
|
+
it "has a working function #glist_utf8_none_return" do
|
922
|
+
res = GIMarshallingTests.glist_utf8_none_return
|
923
|
+
assert_equal ["0", "1", "2"], res.to_a
|
924
|
+
end
|
925
|
+
|
926
|
+
it "has a working function #gslist_int_none_in" do
|
927
|
+
GIMarshallingTests.gslist_int_none_in [-1, 0, 1, 2]
|
928
|
+
pass
|
929
|
+
end
|
930
|
+
|
931
|
+
it "has a working function #gslist_int_none_return" do
|
932
|
+
res = GIMarshallingTests.gslist_int_none_return
|
933
|
+
assert_equal [-1, 0, 1, 2], res.to_a
|
934
|
+
end
|
935
|
+
|
936
|
+
# XXX: Only defined in header
|
937
|
+
# it "has a working function #gslist_utf8_container_in"
|
938
|
+
|
939
|
+
it "has a working function #gslist_utf8_container_inout" do
|
940
|
+
res = GIMarshallingTests.gslist_utf8_container_inout ["0", "1", "2"]
|
941
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
942
|
+
end
|
943
|
+
|
944
|
+
it "has a working function #gslist_utf8_container_out" do
|
945
|
+
res = GIMarshallingTests.gslist_utf8_container_out
|
946
|
+
assert_equal ["0", "1", "2"], res.to_a
|
947
|
+
end
|
948
|
+
|
949
|
+
it "has a working function #gslist_utf8_container_return" do
|
950
|
+
res = GIMarshallingTests.gslist_utf8_container_return
|
951
|
+
assert_equal ["0", "1", "2"], res.to_a
|
952
|
+
end
|
953
|
+
|
954
|
+
# XXX: Only defined in header
|
955
|
+
# it "has a working function #gslist_utf8_full_in"
|
956
|
+
|
957
|
+
it "has a working function #gslist_utf8_full_inout" do
|
958
|
+
res = GIMarshallingTests.gslist_utf8_full_inout ["0", "1", "2"]
|
959
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
960
|
+
end
|
961
|
+
|
962
|
+
it "has a working function #gslist_utf8_full_out" do
|
963
|
+
res = GIMarshallingTests.gslist_utf8_full_out
|
964
|
+
assert_equal ["0", "1", "2"], res.to_a
|
965
|
+
end
|
966
|
+
|
967
|
+
it "has a working function #gslist_utf8_full_return" do
|
968
|
+
res = GIMarshallingTests.gslist_utf8_full_return
|
969
|
+
assert_equal ["0", "1", "2"], res.to_a
|
970
|
+
end
|
971
|
+
|
972
|
+
it "has a working function #gslist_utf8_none_in" do
|
973
|
+
GIMarshallingTests.gslist_utf8_none_in ["0", "1", "2"]
|
974
|
+
pass
|
975
|
+
end
|
976
|
+
|
977
|
+
it "has a working function #gslist_utf8_none_inout" do
|
978
|
+
res = GIMarshallingTests.gslist_utf8_none_inout ["0", "1", "2"]
|
979
|
+
assert_equal ["-2", "-1", "0", "1"], res.to_a
|
980
|
+
end
|
981
|
+
|
982
|
+
it "has a working function #gslist_utf8_none_out" do
|
983
|
+
res = GIMarshallingTests.gslist_utf8_none_out
|
984
|
+
assert_equal ["0", "1", "2"], res.to_a
|
985
|
+
end
|
986
|
+
|
987
|
+
it "has a working function #gslist_utf8_none_return" do
|
988
|
+
res = GIMarshallingTests.gslist_utf8_none_return
|
989
|
+
assert_equal ["0", "1", "2"], res.to_a
|
990
|
+
end
|
991
|
+
|
992
|
+
it "has a working function #gstrv_in" do
|
993
|
+
GIMarshallingTests.gstrv_in ["0", "1", "2"]
|
994
|
+
pass
|
995
|
+
end
|
996
|
+
|
997
|
+
it "has a working function #gstrv_inout" do
|
998
|
+
res = GIMarshallingTests.gstrv_inout ["0", "1", "2"]
|
999
|
+
assert_equal ["-1", "0", "1", "2"], res
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
it "has a working function #gstrv_out" do
|
1003
|
+
res = GIMarshallingTests.gstrv_out
|
1004
|
+
assert_equal ["0", "1", "2"], res
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
it "has a working function #gstrv_return" do
|
1008
|
+
res = GIMarshallingTests.gstrv_return
|
1009
|
+
assert_equal ["0", "1", "2"], res
|
1010
|
+
end
|
1011
|
+
|
1012
|
+
it "has a working function #gtype_inout" do
|
1013
|
+
none = GObject.type_from_name "void"
|
1014
|
+
res = GIMarshallingTests.gtype_inout none
|
1015
|
+
name = GObject.type_name res
|
1016
|
+
assert_equal "gint", name
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
it "has a working function #gtype_out" do
|
1020
|
+
res = GIMarshallingTests.gtype_out
|
1021
|
+
name = GObject.type_name res
|
1022
|
+
assert_equal "void", name
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
it "has a working function #gtype_return" do
|
1026
|
+
res = GIMarshallingTests.gtype_return
|
1027
|
+
name = GObject.type_name res
|
1028
|
+
assert_equal "void", name
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
it "has a working function #gvalue_in" do
|
1032
|
+
GIMarshallingTests.gvalue_in GObject::Value.wrap_ruby_value(42)
|
1033
|
+
pass
|
1034
|
+
end
|
1035
|
+
|
1036
|
+
it "has a working function #gvalue_in_enum" do
|
1037
|
+
gv = GObject::Value.new
|
1038
|
+
gv.init GIMarshallingTests::GEnum.get_gtype
|
1039
|
+
gv.set_enum GIMarshallingTests::GEnum[:value3]
|
1040
|
+
GIMarshallingTests.gvalue_in_enum gv
|
1041
|
+
pass
|
1042
|
+
end
|
1043
|
+
|
1044
|
+
it "has a working function #gvalue_inout" do
|
1045
|
+
res = GIMarshallingTests.gvalue_inout GObject::Value.wrap_ruby_value(42)
|
1046
|
+
assert_equal "42", res.ruby_value
|
1047
|
+
end
|
1048
|
+
|
1049
|
+
it "has a working function #gvalue_out" do
|
1050
|
+
res = GIMarshallingTests.gvalue_out
|
1051
|
+
assert_equal 42, res.ruby_value
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
it "has a working function #gvalue_return" do
|
1055
|
+
res = GIMarshallingTests.gvalue_return
|
1056
|
+
assert_equal 42, res.ruby_value
|
1057
|
+
end
|
1058
|
+
|
1059
|
+
it "has a working function #int16_in_max" do
|
1060
|
+
GIMarshallingTests.int16_in_max 0x7fff
|
1061
|
+
pass
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
it "has a working function #int16_in_min" do
|
1065
|
+
GIMarshallingTests.int16_in_min(-0x8000)
|
1066
|
+
pass
|
1067
|
+
end
|
1068
|
+
|
1069
|
+
it "has a working function #int16_inout_max_min" do
|
1070
|
+
res = GIMarshallingTests.int16_inout_max_min 0x7fff
|
1071
|
+
assert_equal res, -0x8000
|
1072
|
+
end
|
1073
|
+
|
1074
|
+
it "has a working function #int16_inout_min_max" do
|
1075
|
+
res = GIMarshallingTests.int16_inout_min_max(-0x8000)
|
1076
|
+
assert_equal 0x7fff, res
|
1077
|
+
end
|
1078
|
+
|
1079
|
+
it "has a working function #int16_out_max" do
|
1080
|
+
res = GIMarshallingTests.int16_out_max
|
1081
|
+
assert_equal 0x7fff, res
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
it "has a working function #int16_out_min" do
|
1085
|
+
res = GIMarshallingTests.int16_out_min
|
1086
|
+
assert_equal(-0x8000, res)
|
1087
|
+
end
|
1088
|
+
|
1089
|
+
it "has a working function #int16_return_max" do
|
1090
|
+
res = GIMarshallingTests.int16_return_max
|
1091
|
+
assert_equal 0x7fff, res
|
1092
|
+
end
|
1093
|
+
|
1094
|
+
it "has a working function #int16_return_min" do
|
1095
|
+
res = GIMarshallingTests.int16_return_min
|
1096
|
+
assert_equal(-0x8000, res)
|
1097
|
+
end
|
1098
|
+
|
1099
|
+
it "has a working function #int32_in_max" do
|
1100
|
+
GIMarshallingTests.int32_in_max 0x7fffffff
|
1101
|
+
pass
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
it "has a working function #int32_in_min" do
|
1105
|
+
GIMarshallingTests.int32_in_min(-0x80000000)
|
1106
|
+
pass
|
1107
|
+
end
|
1108
|
+
|
1109
|
+
it "has a working function #int32_inout_max_min" do
|
1110
|
+
res = GIMarshallingTests.int32_inout_max_min 0x7fffffff
|
1111
|
+
assert_equal(-0x80000000, res)
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
it "has a working function #int32_inout_min_max" do
|
1115
|
+
res = GIMarshallingTests.int32_inout_min_max(-0x80000000)
|
1116
|
+
assert_equal 0x7fffffff, res
|
1117
|
+
end
|
1118
|
+
|
1119
|
+
it "has a working function #int32_out_max" do
|
1120
|
+
res = GIMarshallingTests.int32_out_max
|
1121
|
+
assert_equal 0x7fffffff, res
|
1122
|
+
end
|
1123
|
+
|
1124
|
+
it "has a working function #int32_out_min" do
|
1125
|
+
res = GIMarshallingTests.int32_out_min
|
1126
|
+
assert_equal(-0x80000000, res)
|
1127
|
+
end
|
1128
|
+
|
1129
|
+
it "has a working function #int32_return_max" do
|
1130
|
+
res = GIMarshallingTests.int32_return_max
|
1131
|
+
assert_equal 0x7fffffff, res
|
1132
|
+
end
|
1133
|
+
|
1134
|
+
it "has a working function #int32_return_min" do
|
1135
|
+
res = GIMarshallingTests.int32_return_min
|
1136
|
+
assert_equal(-0x80000000, res)
|
1137
|
+
end
|
1138
|
+
|
1139
|
+
it "has a working function #int64_in_max" do
|
1140
|
+
GIMarshallingTests.int64_in_max 0x7fffffffffffffff
|
1141
|
+
pass
|
1142
|
+
end
|
1143
|
+
|
1144
|
+
it "has a working function #int64_in_min" do
|
1145
|
+
GIMarshallingTests.int64_in_min(-0x8000000000000000)
|
1146
|
+
pass
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
it "has a working function #int64_inout_max_min" do
|
1150
|
+
res = GIMarshallingTests.int64_inout_max_min 0x7fffffffffffffff
|
1151
|
+
assert_equal(-0x8000000000000000, res)
|
1152
|
+
end
|
1153
|
+
|
1154
|
+
it "has a working function #int64_inout_min_max" do
|
1155
|
+
res = GIMarshallingTests.int64_inout_min_max(-0x8000000000000000)
|
1156
|
+
assert_equal 0x7fffffffffffffff, res
|
1157
|
+
end
|
1158
|
+
|
1159
|
+
it "has a working function #int64_out_max" do
|
1160
|
+
res = GIMarshallingTests.int64_out_max
|
1161
|
+
assert_equal 0x7fffffffffffffff, res
|
1162
|
+
end
|
1163
|
+
|
1164
|
+
it "has a working function #int64_out_min" do
|
1165
|
+
res = GIMarshallingTests.int64_out_min
|
1166
|
+
assert_equal(-0x8000000000000000, res)
|
1167
|
+
end
|
1168
|
+
|
1169
|
+
it "has a working function #int64_return_max" do
|
1170
|
+
res = GIMarshallingTests.int64_return_max
|
1171
|
+
assert_equal 0x7fffffffffffffff, res
|
1172
|
+
end
|
1173
|
+
|
1174
|
+
it "has a working function #int64_return_min" do
|
1175
|
+
res = GIMarshallingTests.int64_return_min
|
1176
|
+
assert_equal(-0x8000000000000000, res)
|
1177
|
+
end
|
1178
|
+
|
1179
|
+
it "has a working function #int8_in_max" do
|
1180
|
+
GIMarshallingTests.int8_in_max 0x7f
|
1181
|
+
pass
|
1182
|
+
end
|
1183
|
+
|
1184
|
+
it "has a working function #int8_in_min" do
|
1185
|
+
GIMarshallingTests.int8_in_min(-0x80)
|
1186
|
+
pass
|
1187
|
+
end
|
1188
|
+
|
1189
|
+
it "has a working function #int8_inout_max_min" do
|
1190
|
+
res = GIMarshallingTests.int8_inout_max_min 0x7f
|
1191
|
+
assert_equal(-0x80, res)
|
1192
|
+
end
|
1193
|
+
|
1194
|
+
it "has a working function #int8_inout_min_max" do
|
1195
|
+
res = GIMarshallingTests.int8_inout_min_max(-0x80)
|
1196
|
+
assert_equal 0x7f, res
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
it "has a working function #int8_out_max" do
|
1200
|
+
res = GIMarshallingTests.int8_out_max
|
1201
|
+
assert_equal 0x7f, res
|
1202
|
+
end
|
1203
|
+
|
1204
|
+
it "has a working function #int8_out_min" do
|
1205
|
+
res = GIMarshallingTests.int8_out_min
|
1206
|
+
assert_equal(-0x80, res)
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
it "has a working function #int8_return_max" do
|
1210
|
+
res = GIMarshallingTests.int8_return_max
|
1211
|
+
assert_equal 0x7f, res
|
1212
|
+
end
|
1213
|
+
|
1214
|
+
it "has a working function #int8_return_min" do
|
1215
|
+
res = GIMarshallingTests.int8_return_min
|
1216
|
+
assert_equal(-0x80, res)
|
1217
|
+
end
|
1218
|
+
|
1219
|
+
it "has a working function #int_in_max" do
|
1220
|
+
GIMarshallingTests.int_in_max 0x7fffffff
|
1221
|
+
pass
|
1222
|
+
end
|
1223
|
+
|
1224
|
+
it "has a working function #int_in_min" do
|
1225
|
+
GIMarshallingTests.int_in_min(-0x80000000)
|
1226
|
+
pass
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
it "has a working function #int_inout_max_min" do
|
1230
|
+
res = GIMarshallingTests.int_inout_max_min 0x7fffffff
|
1231
|
+
assert_equal(-0x80000000, res)
|
1232
|
+
end
|
1233
|
+
|
1234
|
+
it "has a working function #int_inout_min_max" do
|
1235
|
+
res = GIMarshallingTests.int_inout_min_max(-0x80000000)
|
1236
|
+
assert_equal 0x7fffffff, res
|
1237
|
+
end
|
1238
|
+
|
1239
|
+
it "has a working function #int_out_max" do
|
1240
|
+
res = GIMarshallingTests.int_out_max
|
1241
|
+
assert_equal 0x7fffffff, res
|
1242
|
+
end
|
1243
|
+
|
1244
|
+
it "has a working function #int_out_min" do
|
1245
|
+
res = GIMarshallingTests.int_out_min
|
1246
|
+
assert_equal(-0x80000000, res)
|
1247
|
+
end
|
1248
|
+
|
1249
|
+
it "has a working function #int_out_out" do
|
1250
|
+
res = GIMarshallingTests.int_out_out
|
1251
|
+
assert_equal [6, 7], res
|
1252
|
+
end
|
1253
|
+
|
1254
|
+
it "has a working function #int_return_max" do
|
1255
|
+
res = GIMarshallingTests.int_return_max
|
1256
|
+
assert_equal 0x7fffffff, res
|
1257
|
+
end
|
1258
|
+
|
1259
|
+
it "has a working function #int_return_min" do
|
1260
|
+
res = GIMarshallingTests.int_return_min
|
1261
|
+
assert_equal(-0x80000000, res)
|
1262
|
+
end
|
1263
|
+
|
1264
|
+
it "has a working function #int_return_out" do
|
1265
|
+
res = GIMarshallingTests.int_return_out
|
1266
|
+
assert_equal [6, 7], res
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
it "has a working function #int_three_in_three_out" do
|
1270
|
+
res = GIMarshallingTests.int_three_in_three_out 4, 5, 6
|
1271
|
+
assert_equal [4, 5, 6], res
|
1272
|
+
end
|
1273
|
+
|
1274
|
+
it "has a working function #long_in_max" do
|
1275
|
+
GIMarshallingTests.long_in_max max_long
|
1276
|
+
pass
|
1277
|
+
end
|
1278
|
+
|
1279
|
+
it "has a working function #long_in_min" do
|
1280
|
+
GIMarshallingTests.long_in_min min_long
|
1281
|
+
pass
|
1282
|
+
end
|
1283
|
+
|
1284
|
+
it "has a working function #long_inout_max_min" do
|
1285
|
+
res = GIMarshallingTests.long_inout_max_min max_long
|
1286
|
+
assert_equal min_long, res
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
it "has a working function #long_inout_min_max" do
|
1290
|
+
res = GIMarshallingTests.long_inout_min_max min_long
|
1291
|
+
assert_equal max_long, res
|
1292
|
+
end
|
1293
|
+
|
1294
|
+
it "has a working function #long_out_max" do
|
1295
|
+
res = GIMarshallingTests.long_out_max
|
1296
|
+
assert_equal max_long, res
|
1297
|
+
end
|
1298
|
+
|
1299
|
+
it "has a working function #long_out_min" do
|
1300
|
+
res = GIMarshallingTests.long_out_min
|
1301
|
+
assert_equal min_long, res
|
1302
|
+
end
|
1303
|
+
|
1304
|
+
it "has a working function #long_return_max" do
|
1305
|
+
res = GIMarshallingTests.long_return_max
|
1306
|
+
assert_equal max_long, res
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
it "has a working function #long_return_min" do
|
1310
|
+
res = GIMarshallingTests.long_return_min
|
1311
|
+
assert_equal min_long, res
|
1312
|
+
end
|
1313
|
+
|
1314
|
+
it "has a working function #no_type_flags_in" do
|
1315
|
+
GIMarshallingTests.no_type_flags_in :value2
|
1316
|
+
pass
|
1317
|
+
end
|
1318
|
+
|
1319
|
+
it "has a working function #no_type_flags_in_zero" do
|
1320
|
+
GIMarshallingTests.no_type_flags_in_zero 0
|
1321
|
+
pass
|
1322
|
+
end
|
1323
|
+
|
1324
|
+
it "has a working function #no_type_flags_inout" do
|
1325
|
+
res = GIMarshallingTests.no_type_flags_inout :value2
|
1326
|
+
assert_equal :value1, res
|
1327
|
+
end
|
1328
|
+
|
1329
|
+
it "has a working function #no_type_flags_out" do
|
1330
|
+
res = GIMarshallingTests.no_type_flags_out
|
1331
|
+
assert_equal :value2, res
|
1332
|
+
end
|
1333
|
+
|
1334
|
+
it "has a working function #no_type_flags_returnv" do
|
1335
|
+
res = GIMarshallingTests.no_type_flags_returnv
|
1336
|
+
assert_equal :value2, res
|
1337
|
+
end
|
1338
|
+
|
1339
|
+
it "has a working function #pointer_in_return" do
|
1340
|
+
ptr = FFI::MemoryPointer.new 1
|
1341
|
+
res = GIMarshallingTests.pointer_in_return ptr
|
1342
|
+
assert_equal ptr.address, res.address
|
1343
|
+
end
|
1344
|
+
|
1345
|
+
it "has a working function #pointer_struct_get_type" do
|
1346
|
+
res = GIMarshallingTests.pointer_struct_get_type
|
1347
|
+
gtype = GObject.type_from_name "GIMarshallingTestsPointerStruct"
|
1348
|
+
assert_equal gtype, res
|
1349
|
+
end
|
1350
|
+
|
1351
|
+
it "has a working function #pointer_struct_returnv" do
|
1352
|
+
res = GIMarshallingTests.pointer_struct_returnv
|
1353
|
+
assert_instance_of GIMarshallingTests::PointerStruct, res
|
1354
|
+
assert_equal 42, res[:long_]
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
it "has a working function #short_in_max" do
|
1358
|
+
GIMarshallingTests.short_in_max 0x7fff
|
1359
|
+
pass
|
1360
|
+
end
|
1361
|
+
|
1362
|
+
it "has a working function #short_in_min" do
|
1363
|
+
GIMarshallingTests.short_in_min(-0x8000)
|
1364
|
+
pass
|
1365
|
+
end
|
1366
|
+
|
1367
|
+
it "has a working function #short_inout_max_min" do
|
1368
|
+
res = GIMarshallingTests.short_inout_max_min 0x7fff
|
1369
|
+
assert_equal(-0x8000, res)
|
1370
|
+
end
|
1371
|
+
|
1372
|
+
it "has a working function #short_inout_min_max" do
|
1373
|
+
res = GIMarshallingTests.short_inout_min_max(-0x8000)
|
1374
|
+
assert_equal 0x7fff, res
|
1375
|
+
end
|
1376
|
+
|
1377
|
+
it "has a working function #short_out_max" do
|
1378
|
+
res = GIMarshallingTests.short_out_max
|
1379
|
+
assert_equal 0x7fff, res
|
1380
|
+
end
|
1381
|
+
|
1382
|
+
it "has a working function #short_out_min" do
|
1383
|
+
res = GIMarshallingTests.short_out_min
|
1384
|
+
assert_equal(-0x8000, res)
|
1385
|
+
end
|
1386
|
+
|
1387
|
+
it "has a working function #short_return_max" do
|
1388
|
+
res = GIMarshallingTests.short_return_max
|
1389
|
+
assert_equal 0x7fff, res
|
1390
|
+
end
|
1391
|
+
|
1392
|
+
it "has a working function #short_return_min" do
|
1393
|
+
res = GIMarshallingTests.short_return_min
|
1394
|
+
assert_equal(-0x8000, res)
|
1395
|
+
end
|
1396
|
+
|
1397
|
+
it "has a working function #simple_struct_returnv" do
|
1398
|
+
res = GIMarshallingTests.simple_struct_returnv
|
1399
|
+
assert_instance_of GIMarshallingTests::SimpleStruct, res
|
1400
|
+
assert_equal 6, res[:long_]
|
1401
|
+
assert_equal 7, res[:int8]
|
1402
|
+
end
|
1403
|
+
|
1404
|
+
it "has a working function #size_in" do
|
1405
|
+
GIMarshallingTests.size_in max_size_t
|
1406
|
+
end
|
1407
|
+
|
1408
|
+
it "has a working function #size_inout" do
|
1409
|
+
res = GIMarshallingTests.size_inout max_size_t
|
1410
|
+
assert_equal 0, res
|
1411
|
+
end
|
1412
|
+
|
1413
|
+
it "has a working function #size_out" do
|
1414
|
+
res = GIMarshallingTests.size_out
|
1415
|
+
assert_equal max_size_t, res
|
1416
|
+
end
|
1417
|
+
|
1418
|
+
it "has a working function #size_return" do
|
1419
|
+
res = GIMarshallingTests.size_return
|
1420
|
+
assert_equal max_size_t, res
|
1421
|
+
end
|
1422
|
+
|
1423
|
+
it "has a working function #ssize_in_max" do
|
1424
|
+
GIMarshallingTests.ssize_in_max max_ssize_t
|
1425
|
+
pass
|
1426
|
+
end
|
1427
|
+
|
1428
|
+
it "has a working function #ssize_in_min" do
|
1429
|
+
GIMarshallingTests.ssize_in_min min_ssize_t
|
1430
|
+
pass
|
1431
|
+
end
|
1432
|
+
|
1433
|
+
it "has a working function #ssize_inout_max_min" do
|
1434
|
+
res = GIMarshallingTests.ssize_inout_max_min max_ssize_t
|
1435
|
+
assert_equal min_ssize_t, res
|
1436
|
+
end
|
1437
|
+
|
1438
|
+
it "has a working function #ssize_inout_min_max" do
|
1439
|
+
res = GIMarshallingTests.ssize_inout_min_max min_ssize_t
|
1440
|
+
assert_equal max_ssize_t, res
|
1441
|
+
end
|
1442
|
+
|
1443
|
+
it "has a working function #ssize_out_max" do
|
1444
|
+
res = GIMarshallingTests.ssize_out_max
|
1445
|
+
assert_equal max_ssize_t, res
|
1446
|
+
end
|
1447
|
+
|
1448
|
+
it "has a working function #ssize_out_min" do
|
1449
|
+
res = GIMarshallingTests.ssize_out_min
|
1450
|
+
assert_equal min_ssize_t, res
|
1451
|
+
end
|
1452
|
+
|
1453
|
+
it "has a working function #ssize_return_max" do
|
1454
|
+
res = GIMarshallingTests.ssize_return_max
|
1455
|
+
assert_equal max_ssize_t, res
|
1456
|
+
end
|
1457
|
+
|
1458
|
+
it "has a working function #ssize_return_min" do
|
1459
|
+
res = GIMarshallingTests.ssize_return_min
|
1460
|
+
assert_equal min_ssize_t, res
|
1461
|
+
end
|
1462
|
+
|
1463
|
+
it "has a working function #test_interface_test_int8_in"
|
1464
|
+
|
1465
|
+
it "has a working function #time_t_in" do
|
1466
|
+
GIMarshallingTests.time_t_in 1234567890
|
1467
|
+
pass
|
1468
|
+
end
|
1469
|
+
|
1470
|
+
it "has a working function #time_t_inout" do
|
1471
|
+
res = GIMarshallingTests.time_t_inout 1234567890
|
1472
|
+
assert_equal 0, res
|
1473
|
+
end
|
1474
|
+
|
1475
|
+
it "has a working function #time_t_out" do
|
1476
|
+
res = GIMarshallingTests.time_t_out
|
1477
|
+
assert_equal 1234567890, res
|
1478
|
+
end
|
1479
|
+
|
1480
|
+
it "has a working function #time_t_return" do
|
1481
|
+
res = GIMarshallingTests.time_t_return
|
1482
|
+
assert_equal 1234567890, res
|
1483
|
+
end
|
1484
|
+
|
1485
|
+
it "has a working function #uint16_in" do
|
1486
|
+
GIMarshallingTests.uint16_in 0xffff
|
1487
|
+
pass
|
1488
|
+
end
|
1489
|
+
|
1490
|
+
it "has a working function #uint16_inout" do
|
1491
|
+
res = GIMarshallingTests.uint16_inout 0xffff
|
1492
|
+
assert_equal 0, res
|
1493
|
+
end
|
1494
|
+
|
1495
|
+
it "has a working function #uint16_out" do
|
1496
|
+
res = GIMarshallingTests.uint16_out
|
1497
|
+
assert_equal 0xffff, res
|
1498
|
+
end
|
1499
|
+
|
1500
|
+
it "has a working function #uint16_return" do
|
1501
|
+
res = GIMarshallingTests.uint16_return
|
1502
|
+
assert_equal 0xffff, res
|
1503
|
+
end
|
1504
|
+
|
1505
|
+
it "has a working function #uint32_in" do
|
1506
|
+
GIMarshallingTests.uint32_in 0xffffffff
|
1507
|
+
end
|
1508
|
+
|
1509
|
+
it "has a working function #uint32_inout" do
|
1510
|
+
res = GIMarshallingTests.uint32_inout 0xffffffff
|
1511
|
+
assert_equal 0, res
|
1512
|
+
end
|
1513
|
+
|
1514
|
+
it "has a working function #uint32_out" do
|
1515
|
+
res = GIMarshallingTests.uint32_out
|
1516
|
+
assert_equal 0xffffffff, res
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
it "has a working function #uint32_return" do
|
1520
|
+
res = GIMarshallingTests.uint32_return
|
1521
|
+
assert_equal 0xffffffff, res
|
1522
|
+
end
|
1523
|
+
|
1524
|
+
it "has a working function #uint64_in" do
|
1525
|
+
GIMarshallingTests.uint64_in 0xffff_ffff_ffff_ffff
|
1526
|
+
pass
|
1527
|
+
end
|
1528
|
+
|
1529
|
+
it "has a working function #uint64_inout" do
|
1530
|
+
res = GIMarshallingTests.uint64_inout 0xffff_ffff_ffff_ffff
|
1531
|
+
assert_equal 0, res
|
1532
|
+
end
|
1533
|
+
|
1534
|
+
it "has a working function #uint64_out" do
|
1535
|
+
res = GIMarshallingTests.uint64_out
|
1536
|
+
assert_equal 0xffff_ffff_ffff_ffff, res
|
1537
|
+
end
|
1538
|
+
|
1539
|
+
it "has a working function #uint64_return" do
|
1540
|
+
res = GIMarshallingTests.uint64_return
|
1541
|
+
assert_equal 0xffff_ffff_ffff_ffff, res
|
1542
|
+
end
|
1543
|
+
|
1544
|
+
it "has a working function #uint8_in" do
|
1545
|
+
GIMarshallingTests.uint8_in 0xff
|
1546
|
+
end
|
1547
|
+
|
1548
|
+
it "has a working function #uint8_inout" do
|
1549
|
+
res = GIMarshallingTests.uint8_inout 0xff
|
1550
|
+
assert_equal 0, res
|
1551
|
+
end
|
1552
|
+
|
1553
|
+
it "has a working function #uint8_out" do
|
1554
|
+
res = GIMarshallingTests.uint8_out
|
1555
|
+
assert_equal 0xff, res
|
1556
|
+
end
|
1557
|
+
|
1558
|
+
it "has a working function #uint8_return" do
|
1559
|
+
res = GIMarshallingTests.uint8_return
|
1560
|
+
assert_equal 0xff, res
|
1561
|
+
end
|
1562
|
+
|
1563
|
+
it "has a working function #uint_in" do
|
1564
|
+
GIMarshallingTests.uint_in max_uint
|
1565
|
+
pass
|
1566
|
+
end
|
1567
|
+
|
1568
|
+
it "has a working function #uint_inout" do
|
1569
|
+
res = GIMarshallingTests.uint_inout max_uint
|
1570
|
+
assert_equal 0, res
|
1571
|
+
end
|
1572
|
+
|
1573
|
+
it "has a working function #uint_out" do
|
1574
|
+
res = GIMarshallingTests.uint_out
|
1575
|
+
assert_equal max_uint, res
|
1576
|
+
end
|
1577
|
+
|
1578
|
+
it "has a working function #uint_return" do
|
1579
|
+
res = GIMarshallingTests.uint_return
|
1580
|
+
assert_equal max_uint, res
|
1581
|
+
end
|
1582
|
+
|
1583
|
+
it "has a working function #ulong_in" do
|
1584
|
+
GIMarshallingTests.ulong_in max_ulong
|
1585
|
+
end
|
1586
|
+
|
1587
|
+
it "has a working function #ulong_inout" do
|
1588
|
+
res = GIMarshallingTests.ulong_inout max_ulong
|
1589
|
+
assert_equal 0, res
|
1590
|
+
end
|
1591
|
+
|
1592
|
+
it "has a working function #ulong_out" do
|
1593
|
+
res = GIMarshallingTests.ulong_out
|
1594
|
+
assert_equal max_ulong, res
|
1595
|
+
end
|
1596
|
+
|
1597
|
+
it "has a working function #ulong_return" do
|
1598
|
+
res = GIMarshallingTests.ulong_return
|
1599
|
+
assert_equal max_ulong, res
|
1600
|
+
end
|
1601
|
+
|
1602
|
+
# XXX: Only defined in header
|
1603
|
+
# it "has a working function #union_inout"
|
1604
|
+
|
1605
|
+
# XXX: Only defined in header
|
1606
|
+
# it "has a working function #union_out"
|
1607
|
+
|
1608
|
+
it "has a working function #union_returnv" do
|
1609
|
+
res = GIMarshallingTests.union_returnv
|
1610
|
+
assert_instance_of GIMarshallingTests::Union, res
|
1611
|
+
assert_equal 42, res[:long_]
|
1612
|
+
end
|
1613
|
+
|
1614
|
+
it "has a working function #ushort_in" do
|
1615
|
+
GIMarshallingTests.ushort_in max_ushort
|
1616
|
+
pass
|
1617
|
+
end
|
1618
|
+
|
1619
|
+
it "has a working function #ushort_inout" do
|
1620
|
+
res = GIMarshallingTests.ushort_inout max_ushort
|
1621
|
+
assert_equal 0, res
|
1622
|
+
end
|
1623
|
+
|
1624
|
+
it "has a working function #ushort_out" do
|
1625
|
+
res = GIMarshallingTests.ushort_out
|
1626
|
+
assert_equal max_ushort, res
|
1627
|
+
end
|
1628
|
+
|
1629
|
+
it "has a working function #ushort_return" do
|
1630
|
+
res = GIMarshallingTests.ushort_return
|
1631
|
+
assert_equal max_ushort, res
|
1632
|
+
end
|
1633
|
+
|
1634
|
+
it "has a working function #utf8_dangling_out" do
|
1635
|
+
res = GIMarshallingTests.utf8_dangling_out
|
1636
|
+
assert_nil res
|
1637
|
+
end
|
1638
|
+
|
1639
|
+
# XXX: Only defined in header
|
1640
|
+
# it "has a working function #utf8_full_in"
|
1641
|
+
|
1642
|
+
it "has a working function #utf8_full_inout" do
|
1643
|
+
res = GIMarshallingTests.utf8_full_inout "const ♥ utf8"
|
1644
|
+
assert_equal "", res
|
1645
|
+
end
|
1646
|
+
|
1647
|
+
it "has a working function #utf8_full_out" do
|
1648
|
+
res = GIMarshallingTests.utf8_full_out
|
1649
|
+
assert_equal "const ♥ utf8", res
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
it "has a working function #utf8_full_return" do
|
1653
|
+
res = GIMarshallingTests.utf8_full_return
|
1654
|
+
assert_equal "const ♥ utf8", res
|
1655
|
+
end
|
1656
|
+
|
1657
|
+
it "has a working function #utf8_none_in" do
|
1658
|
+
GIMarshallingTests.utf8_none_in "const ♥ utf8"
|
1659
|
+
pass
|
1660
|
+
end
|
1661
|
+
|
1662
|
+
it "has a working function #utf8_none_inout" do
|
1663
|
+
res = GIMarshallingTests.utf8_none_inout "const ♥ utf8"
|
1664
|
+
assert_equal "", res
|
1665
|
+
end
|
1666
|
+
|
1667
|
+
it "has a working function #utf8_none_out" do
|
1668
|
+
res = GIMarshallingTests.utf8_none_out
|
1669
|
+
assert_equal "const ♥ utf8", res
|
1670
|
+
end
|
1671
|
+
|
1672
|
+
it "has a working function #utf8_none_return" do
|
1673
|
+
res = GIMarshallingTests.utf8_none_return
|
1674
|
+
assert_equal "const ♥ utf8", res
|
1675
|
+
end
|
1676
|
+
end
|
1677
|
+
|