gir_ffi 0.14.0 → 0.15.3

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.
Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +45 -0
  3. data/Gemfile +6 -4
  4. data/README.md +11 -10
  5. data/Rakefile +5 -5
  6. data/lib/ffi-glib.rb +16 -16
  7. data/lib/ffi-glib/array.rb +14 -4
  8. data/lib/ffi-glib/byte_array.rb +7 -2
  9. data/lib/ffi-glib/container_class_methods.rb +1 -1
  10. data/lib/ffi-glib/error.rb +1 -1
  11. data/lib/ffi-glib/hash_table.rb +3 -3
  12. data/lib/ffi-glib/list.rb +1 -1
  13. data/lib/ffi-glib/list_methods.rb +1 -1
  14. data/lib/ffi-glib/main_loop.rb +3 -3
  15. data/lib/ffi-glib/ptr_array.rb +30 -8
  16. data/lib/ffi-glib/s_list.rb +1 -1
  17. data/lib/ffi-glib/variant.rb +1 -1
  18. data/lib/ffi-gobject.rb +13 -13
  19. data/lib/ffi-gobject/object.rb +23 -32
  20. data/lib/ffi-gobject/param_spec.rb +1 -1
  21. data/lib/ffi-gobject/ruby_closure.rb +2 -2
  22. data/lib/ffi-gobject/value.rb +40 -29
  23. data/lib/ffi-gobject_introspection.rb +20 -20
  24. data/lib/ffi-gobject_introspection/gobject_type_init.rb +2 -2
  25. data/lib/ffi-gobject_introspection/i_arg_info.rb +2 -2
  26. data/lib/ffi-gobject_introspection/i_base_info.rb +27 -17
  27. data/lib/ffi-gobject_introspection/i_callable_info.rb +4 -4
  28. data/lib/ffi-gobject_introspection/i_constant_info.rb +2 -2
  29. data/lib/ffi-gobject_introspection/i_enum_info.rb +1 -0
  30. data/lib/ffi-gobject_introspection/i_field_info.rb +1 -1
  31. data/lib/ffi-gobject_introspection/i_function_info.rb +1 -1
  32. data/lib/ffi-gobject_introspection/i_interface_info.rb +1 -1
  33. data/lib/ffi-gobject_introspection/i_object_info.rb +2 -2
  34. data/lib/ffi-gobject_introspection/i_property_info.rb +2 -2
  35. data/lib/ffi-gobject_introspection/i_repository.rb +9 -6
  36. data/lib/ffi-gobject_introspection/i_struct_info.rb +2 -1
  37. data/lib/ffi-gobject_introspection/i_type_info.rb +13 -7
  38. data/lib/ffi-gobject_introspection/i_unresolved_info.rb +1 -1
  39. data/lib/ffi-gobject_introspection/i_vfunc_info.rb +1 -1
  40. data/lib/ffi-gobject_introspection/lib.rb +30 -19
  41. data/lib/ffi-gobject_introspection/strv.rb +1 -1
  42. data/lib/gir_ffi-base.rb +1 -1
  43. data/lib/gir_ffi-base/gobject.rb +26 -25
  44. data/lib/gir_ffi-base/gobject/lib.rb +3 -2
  45. data/lib/gir_ffi.rb +3 -3
  46. data/lib/gir_ffi/allocation_helper.rb +1 -1
  47. data/lib/gir_ffi/arg_helper.rb +4 -4
  48. data/lib/gir_ffi/{in_out_pointer.rb → array_element_convertor.rb} +16 -23
  49. data/lib/gir_ffi/boolean.rb +1 -1
  50. data/lib/gir_ffi/boxed_base.rb +1 -1
  51. data/lib/gir_ffi/builder.rb +18 -10
  52. data/lib/gir_ffi/builder_helper.rb +6 -1
  53. data/lib/gir_ffi/builders/argument_builder.rb +19 -19
  54. data/lib/gir_ffi/builders/argument_builder_collection.rb +2 -2
  55. data/lib/gir_ffi/builders/base_argument_builder.rb +1 -0
  56. data/lib/gir_ffi/builders/base_method_builder.rb +7 -7
  57. data/lib/gir_ffi/builders/base_return_value_builder.rb +1 -1
  58. data/lib/gir_ffi/builders/base_type_builder.rb +1 -1
  59. data/lib/gir_ffi/builders/c_to_ruby_convertor.rb +5 -5
  60. data/lib/gir_ffi/builders/callback_argument_builder.rb +8 -8
  61. data/lib/gir_ffi/builders/callback_builder.rb +16 -4
  62. data/lib/gir_ffi/builders/callback_return_value_builder.rb +2 -2
  63. data/lib/gir_ffi/builders/closure_argument_builder.rb +1 -1
  64. data/lib/gir_ffi/builders/closure_return_value_builder.rb +1 -1
  65. data/lib/gir_ffi/builders/constant_builder.rb +1 -1
  66. data/lib/gir_ffi/builders/constructor_builder.rb +9 -9
  67. data/lib/gir_ffi/builders/enum_builder.rb +16 -3
  68. data/lib/gir_ffi/builders/field_builder.rb +20 -18
  69. data/lib/gir_ffi/builders/flags_builder.rb +2 -2
  70. data/lib/gir_ffi/builders/full_c_to_ruby_convertor.rb +1 -1
  71. data/lib/gir_ffi/builders/function_builder.rb +11 -5
  72. data/lib/gir_ffi/builders/initializer_builder.rb +3 -3
  73. data/lib/gir_ffi/builders/initializer_return_value_builder.rb +2 -2
  74. data/lib/gir_ffi/builders/interface_builder.rb +2 -2
  75. data/lib/gir_ffi/builders/mapping_method_builder.rb +9 -9
  76. data/lib/gir_ffi/builders/marshalling_method_builder.rb +7 -7
  77. data/lib/gir_ffi/builders/method_template.rb +1 -1
  78. data/lib/gir_ffi/builders/module_builder.rb +7 -7
  79. data/lib/gir_ffi/builders/object_builder.rb +6 -6
  80. data/lib/gir_ffi/builders/property_argument_builder.rb +1 -1
  81. data/lib/gir_ffi/builders/property_builder.rb +13 -12
  82. data/lib/gir_ffi/builders/property_return_value_builder.rb +1 -1
  83. data/lib/gir_ffi/builders/registered_type_builder.rb +14 -5
  84. data/lib/gir_ffi/builders/return_value_builder.rb +4 -4
  85. data/lib/gir_ffi/builders/ruby_to_c_convertor.rb +6 -6
  86. data/lib/gir_ffi/builders/signal_closure_builder.rb +2 -2
  87. data/lib/gir_ffi/builders/struct_builder.rb +6 -4
  88. data/lib/gir_ffi/builders/struct_like.rb +1 -1
  89. data/lib/gir_ffi/builders/type_builder.rb +12 -12
  90. data/lib/gir_ffi/builders/unintrospectable_boxed_builder.rb +2 -2
  91. data/lib/gir_ffi/builders/unintrospectable_builder.rb +2 -2
  92. data/lib/gir_ffi/builders/union_builder.rb +4 -4
  93. data/lib/gir_ffi/builders/user_defined_builder.rb +2 -2
  94. data/lib/gir_ffi/builders/vfunc_argument_builder.rb +1 -1
  95. data/lib/gir_ffi/builders/vfunc_builder.rb +8 -8
  96. data/lib/gir_ffi/builders/with_layout.rb +2 -2
  97. data/lib/gir_ffi/callback_base.rb +4 -6
  98. data/lib/gir_ffi/class_base.rb +6 -5
  99. data/lib/gir_ffi/core.rb +19 -20
  100. data/lib/gir_ffi/enum_base.rb +1 -1
  101. data/lib/gir_ffi/enum_like_base.rb +2 -2
  102. data/lib/gir_ffi/error_argument_info.rb +2 -2
  103. data/lib/gir_ffi/error_type_info.rb +1 -1
  104. data/lib/gir_ffi/ffi_ext.rb +1 -1
  105. data/lib/gir_ffi/ffi_ext/pointer.rb +1 -1
  106. data/lib/gir_ffi/flags_base.rb +1 -1
  107. data/lib/gir_ffi/in_pointer.rb +10 -0
  108. data/lib/gir_ffi/info_ext.rb +15 -14
  109. data/lib/gir_ffi/info_ext/full_type_name.rb +3 -3
  110. data/lib/gir_ffi/info_ext/i_arg_info.rb +1 -1
  111. data/lib/gir_ffi/info_ext/i_callable_info.rb +1 -1
  112. data/lib/gir_ffi/info_ext/i_callback_info.rb +1 -1
  113. data/lib/gir_ffi/info_ext/i_field_info.rb +1 -1
  114. data/lib/gir_ffi/info_ext/i_function_info.rb +1 -1
  115. data/lib/gir_ffi/info_ext/i_property_info.rb +2 -2
  116. data/lib/gir_ffi/info_ext/i_registered_type_info.rb +4 -5
  117. data/lib/gir_ffi/info_ext/i_signal_info.rb +7 -3
  118. data/lib/gir_ffi/info_ext/i_type_info.rb +48 -26
  119. data/lib/gir_ffi/info_ext/i_unresolved_info.rb +1 -1
  120. data/lib/gir_ffi/info_ext/i_value_info.rb +25 -0
  121. data/lib/gir_ffi/info_ext/i_vfunc_info.rb +2 -2
  122. data/lib/gir_ffi/info_ext/safe_constant_name.rb +8 -8
  123. data/lib/gir_ffi/info_ext/safe_function_name.rb +2 -2
  124. data/lib/gir_ffi/interface_base.rb +3 -3
  125. data/lib/gir_ffi/lib_c.rb +1 -1
  126. data/lib/gir_ffi/method_stubber.rb +1 -1
  127. data/lib/gir_ffi/module_base.rb +1 -1
  128. data/lib/gir_ffi/object_base.rb +3 -4
  129. data/lib/gir_ffi/receiver_argument_info.rb +1 -1
  130. data/lib/gir_ffi/receiver_type_info.rb +2 -2
  131. data/lib/gir_ffi/registered_type_base.rb +1 -1
  132. data/lib/gir_ffi/sized_array.rb +4 -2
  133. data/lib/gir_ffi/struct.rb +1 -1
  134. data/lib/gir_ffi/struct_base.rb +1 -1
  135. data/lib/gir_ffi/type_map.rb +2 -23
  136. data/lib/gir_ffi/unintrospectable_boxed_info.rb +2 -2
  137. data/lib/gir_ffi/unintrospectable_type_info.rb +5 -1
  138. data/lib/gir_ffi/union.rb +1 -1
  139. data/lib/gir_ffi/union_base.rb +1 -1
  140. data/lib/gir_ffi/user_defined_object_info.rb +6 -2
  141. data/lib/gir_ffi/user_defined_property_info.rb +33 -33
  142. data/lib/gir_ffi/version.rb +1 -1
  143. data/tasks/test.rake +3 -2
  144. data/test/base_test_helper.rb +16 -9
  145. data/test/ffi-glib/array_test.rb +71 -56
  146. data/test/ffi-glib/byte_array_test.rb +13 -7
  147. data/test/ffi-glib/bytes_test.rb +24 -19
  148. data/test/ffi-glib/closure_test.rb +11 -11
  149. data/test/ffi-glib/destroy_notify_test.rb +6 -6
  150. data/test/ffi-glib/hash_table_test.rb +27 -27
  151. data/test/ffi-glib/list_test.rb +22 -22
  152. data/test/ffi-glib/main_loop_test.rb +12 -12
  153. data/test/ffi-glib/ptr_array_test.rb +39 -39
  154. data/test/ffi-glib/ruby_closure_test.rb +10 -10
  155. data/test/ffi-glib/s_list_test.rb +20 -20
  156. data/test/ffi-glib/strv_test.rb +19 -19
  157. data/test/ffi-glib/variant_test.rb +5 -5
  158. data/test/ffi-gobject/gobject_test.rb +48 -44
  159. data/test/ffi-gobject/object_class_test.rb +8 -8
  160. data/test/ffi-gobject/object_test.rb +51 -68
  161. data/test/ffi-gobject/param_spec_test.rb +12 -12
  162. data/test/ffi-gobject/value_test.rb +145 -125
  163. data/test/ffi-gobject_introspection/gobject_type_init_test.rb +9 -9
  164. data/test/ffi-gobject_introspection/i_base_info_test.rb +15 -16
  165. data/test/ffi-gobject_introspection/i_constant_info_test.rb +9 -13
  166. data/test/ffi-gobject_introspection/i_enum_info_test.rb +7 -7
  167. data/test/ffi-gobject_introspection/i_function_info_test.rb +1 -1
  168. data/test/ffi-gobject_introspection/i_interface_info_test.rb +10 -10
  169. data/test/ffi-gobject_introspection/i_object_info_test.rb +23 -23
  170. data/test/ffi-gobject_introspection/i_property_info_test.rb +19 -19
  171. data/test/ffi-gobject_introspection/i_registered_type_info_test.rb +10 -10
  172. data/test/ffi-gobject_introspection/i_repository_test.rb +34 -34
  173. data/test/ffi-gobject_introspection/i_struct_info_test.rb +10 -10
  174. data/test/ffi-gobject_introspection/i_type_info_test.rb +12 -15
  175. data/test/ffi-gobject_introspection/i_union_info_test.rb +7 -7
  176. data/test/ffi-gobject_introspection/i_vfunc_info_test.rb +16 -16
  177. data/test/ffi-gobject_introspection/lib_test.rb +3 -3
  178. data/test/ffi-gobject_introspection/strv_test.rb +9 -9
  179. data/test/ffi-gobject_test.rb +47 -45
  180. data/test/gir_ffi/allocation_helper_test.rb +13 -13
  181. data/test/gir_ffi/arg_helper_test.rb +71 -65
  182. data/test/gir_ffi/boolean_test.rb +20 -20
  183. data/test/gir_ffi/boxed_base_test.rb +18 -18
  184. data/test/gir_ffi/builder_test.rb +81 -213
  185. data/test/gir_ffi/builders/argument_builder_test.rb +321 -287
  186. data/test/gir_ffi/builders/base_argument_builder_test.rb +1 -1
  187. data/test/gir_ffi/builders/callback_argument_builder_test.rb +57 -56
  188. data/test/gir_ffi/builders/callback_builder_test.rb +71 -72
  189. data/test/gir_ffi/builders/callback_return_value_builder_test.rb +40 -41
  190. data/test/gir_ffi/builders/constant_builder_test.rb +1 -1
  191. data/test/gir_ffi/builders/constructor_builder_test.rb +12 -10
  192. data/test/gir_ffi/builders/enum_builder_test.rb +12 -11
  193. data/test/gir_ffi/builders/field_builder_test.rb +48 -42
  194. data/test/gir_ffi/builders/function_builder_test.rb +256 -224
  195. data/test/gir_ffi/builders/initializer_builder_test.rb +16 -14
  196. data/test/gir_ffi/builders/interface_builder_test.rb +9 -9
  197. data/test/gir_ffi/builders/module_builder_test.rb +18 -18
  198. data/test/gir_ffi/builders/object_builder_test.rb +41 -41
  199. data/test/gir_ffi/builders/property_builder_test.rb +94 -94
  200. data/test/gir_ffi/builders/registered_type_builder_test.rb +35 -11
  201. data/test/gir_ffi/builders/return_value_builder_test.rb +227 -223
  202. data/test/gir_ffi/builders/signal_closure_builder_test.rb +124 -113
  203. data/test/gir_ffi/builders/struct_builder_test.rb +38 -35
  204. data/test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb +8 -14
  205. data/test/gir_ffi/builders/unintrospectable_builder_test.rb +34 -23
  206. data/test/gir_ffi/builders/union_builder_test.rb +12 -15
  207. data/test/gir_ffi/builders/user_defined_builder_test.rb +152 -148
  208. data/test/gir_ffi/builders/vfunc_argument_builder_test.rb +46 -40
  209. data/test/gir_ffi/builders/vfunc_builder_test.rb +149 -157
  210. data/test/gir_ffi/callback_base_test.rb +9 -9
  211. data/test/gir_ffi/class_base_test.rb +56 -53
  212. data/test/gir_ffi/core_test.rb +36 -35
  213. data/test/gir_ffi/enum_base_test.rb +19 -19
  214. data/test/gir_ffi/error_type_info_test.rb +23 -23
  215. data/test/gir_ffi/ffi_ext/pointer_test.rb +9 -7
  216. data/test/gir_ffi/g_type_test.rb +11 -11
  217. data/test/gir_ffi/in_pointer_test.rb +70 -50
  218. data/test/gir_ffi/info_ext/i_callable_info_test.rb +5 -5
  219. data/test/gir_ffi/info_ext/i_callback_info_test.rb +6 -5
  220. data/test/gir_ffi/info_ext/i_field_info_test.rb +6 -6
  221. data/test/gir_ffi/info_ext/i_function_info_test.rb +17 -17
  222. data/test/gir_ffi/info_ext/i_signal_info_test.rb +8 -8
  223. data/test/gir_ffi/info_ext/i_type_info_test.rb +231 -216
  224. data/test/gir_ffi/info_ext/i_unresolved_info_test.rb +4 -4
  225. data/test/gir_ffi/info_ext/safe_constant_name_test.rb +8 -8
  226. data/test/gir_ffi/info_ext/safe_function_name_test.rb +8 -8
  227. data/test/gir_ffi/interface_base_test.rb +8 -8
  228. data/test/gir_ffi/method_stubber_test.rb +21 -19
  229. data/test/gir_ffi/object_base_test.rb +23 -23
  230. data/test/gir_ffi/object_store_test.rb +13 -13
  231. data/test/gir_ffi/receiver_argument_info_test.rb +15 -15
  232. data/test/gir_ffi/sized_array_test.rb +68 -68
  233. data/test/gir_ffi/struct_base_test.rb +8 -8
  234. data/test/gir_ffi/struct_like_base_test.rb +64 -64
  235. data/test/gir_ffi/type_map_test.rb +8 -8
  236. data/test/gir_ffi/unintrospectable_type_info_test.rb +33 -33
  237. data/test/gir_ffi/union_base_test.rb +8 -8
  238. data/test/gir_ffi/user_defined_object_info_test.rb +34 -34
  239. data/test/gir_ffi/user_defined_property_info_test.rb +16 -16
  240. data/test/gir_ffi/variable_name_generator_test.rb +8 -8
  241. data/test/gir_ffi/version_test.rb +4 -4
  242. data/test/gir_ffi/zero_terminated_test.rb +34 -34
  243. data/test/gir_ffi_test_helper.rb +3 -3
  244. data/test/integration/callback_exceptions_test.rb +17 -21
  245. data/test/integration/derived_classes_test.rb +14 -13
  246. data/test/integration/generated_everything_test.rb +225 -224
  247. data/test/integration/generated_gimarshallingtests_test.rb +1174 -1060
  248. data/test/integration/generated_gio_test.rb +36 -36
  249. data/test/integration/generated_glib_test.rb +4 -6
  250. data/test/integration/generated_gobject_test.rb +43 -35
  251. data/test/integration/generated_gst_test.rb +20 -16
  252. data/test/integration/generated_gtk_source_test.rb +9 -15
  253. data/test/integration/generated_gtop_test.rb +8 -15
  254. data/test/integration/generated_pango_ft2_test.rb +2 -2
  255. data/test/integration/generated_pango_test.rb +4 -4
  256. data/test/integration/generated_regress_test.rb +1858 -1632
  257. data/test/integration/generated_secret_test.rb +8 -11
  258. data/test/integration/generated_utility_test.rb +81 -81
  259. data/test/integration/generated_warnlib_test.rb +17 -21
  260. data/test/integration/method_lookup_test.rb +6 -6
  261. data/test/introspection_test_helper.rb +49 -7
  262. data/test/minitest/stats_plugin.rb +1 -1
  263. metadata +21 -23
  264. data/lib/ffi-glib/array_methods.rb +0 -16
  265. data/test/gir_ffi/in_out_pointer_test.rb +0 -56
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'gir_ffi_test_helper'
3
+ require "gir_ffi_test_helper"
4
4
 
5
- require 'gir_ffi'
5
+ require "gir_ffi"
6
6
 
7
7
  GirFFI.setup :GIMarshallingTests
8
8
 
@@ -20,205 +20,203 @@ describe GIMarshallingTests do
20
20
  derived_klass.new
21
21
  end
22
22
 
23
- describe 'GIMarshallingTests::BoxedStruct' do
23
+ describe "GIMarshallingTests::BoxedStruct" do
24
24
  let(:instance) { GIMarshallingTests::BoxedStruct.new }
25
25
 
26
- it 'has a writable field long_' do
26
+ it "has a writable field long_" do
27
27
  instance.long_ = 42
28
28
  assert_equal 42, instance.long_
29
29
  instance.long_ = 43
30
30
  assert_equal 43, instance.long_
31
31
  end
32
32
 
33
- it 'has a writable field string_' do
34
- skip unless get_field_introspection_data('GIMarshallingTests', 'BoxedStruct', 'string_')
35
- instance.string_ = 'foobar'
36
- instance.string_.must_equal 'foobar'
33
+ it "has a writable field string_" do
34
+ instance.string_ = "foobar"
35
+ _(instance.string_).must_equal "foobar"
37
36
  end
38
37
 
39
- it 'has a writable field g_strv' do
40
- instance.g_strv.must_be :==, []
38
+ it "has a writable field g_strv" do
39
+ _(instance.g_strv).must_be :==, []
41
40
  instance.g_strv = %w(foo bar)
42
- instance.g_strv.must_be :==, %w(foo bar)
41
+ _(instance.g_strv).must_be :==, %w(foo bar)
43
42
  end
44
43
 
45
- it 'creates an instance using #new' do
44
+ it "creates an instance using #new" do
46
45
  bx = GIMarshallingTests::BoxedStruct.new
47
46
  assert_instance_of GIMarshallingTests::BoxedStruct, bx
48
- bx.struct.must_be :owned?
47
+ _(bx.struct).must_be :owned?
49
48
  end
50
49
 
51
- it 'has a working method #inv' do
50
+ it "has a working method #inv" do
52
51
  instance.long_ = 42
53
52
  instance.inv
54
53
  pass
55
54
  end
56
55
 
57
- it 'has a working function #inout' do
56
+ it "has a working function #inout" do
58
57
  bx = GIMarshallingTests::BoxedStruct.new
59
58
  bx.long_ = 42
60
- bx.struct.must_be :owned?
59
+ _(bx.struct).must_be :owned?
61
60
 
62
61
  res = GIMarshallingTests::BoxedStruct.inout bx
63
- bx.struct.must_be :owned?
64
- res.struct.must_be :owned?
62
+ _(bx.struct).must_be :owned?
63
+ _(res.struct).must_be :owned?
65
64
 
66
65
  assert_equal 0, res.long_
67
66
  end
68
67
 
69
- it 'has a working function #out' do
68
+ it "has a working function #out" do
70
69
  res = GIMarshallingTests::BoxedStruct.out
71
- res.struct.must_be :owned?
70
+ _(res.struct).must_be :owned?
72
71
  assert_equal 42, res.long_
73
72
  end
74
73
 
75
- it 'has a working function #returnv' do
74
+ it "has a working function #returnv" do
76
75
  res = GIMarshallingTests::BoxedStruct.returnv
77
- res.struct.must_be :owned?
76
+ _(res.struct).must_be :owned?
78
77
  assert_equal 42, res.long_
79
- res.g_strv.must_be :==, %w(0 1 2)
78
+ _(res.g_strv).must_be :==, %w(0 1 2)
80
79
  end
81
80
  end
82
81
 
83
- it 'has the constant CONSTANT_GERROR_CODE' do
82
+ it "has the constant CONSTANT_GERROR_CODE" do
84
83
  assert_equal 5, GIMarshallingTests::CONSTANT_GERROR_CODE
85
84
  end
86
85
 
87
- it 'has the constant CONSTANT_GERROR_DEBUG_MESSAGE' do
88
- GIMarshallingTests::CONSTANT_GERROR_DEBUG_MESSAGE.must_equal(
89
- 'we got an error, life is shit')
86
+ it "has the constant CONSTANT_GERROR_DEBUG_MESSAGE" do
87
+ _(GIMarshallingTests::CONSTANT_GERROR_DEBUG_MESSAGE).must_equal(
88
+ "we got an error, life is shit")
90
89
  end
91
90
 
92
- it 'has the constant CONSTANT_GERROR_DOMAIN' do
93
- assert_equal 'gi-marshalling-tests-gerror-domain',
91
+ it "has the constant CONSTANT_GERROR_DOMAIN" do
92
+ assert_equal "gi-marshalling-tests-gerror-domain",
94
93
  GIMarshallingTests::CONSTANT_GERROR_DOMAIN
95
94
  end
96
95
 
97
- it 'has the constant CONSTANT_GERROR_MESSAGE' do
98
- assert_equal 'gi-marshalling-tests-gerror-message',
96
+ it "has the constant CONSTANT_GERROR_MESSAGE" do
97
+ assert_equal "gi-marshalling-tests-gerror-message",
99
98
  GIMarshallingTests::CONSTANT_GERROR_MESSAGE
100
99
  end
101
100
 
102
- it 'has the constant CONSTANT_NUMBER' do
101
+ it "has the constant CONSTANT_NUMBER" do
103
102
  assert_equal 42, GIMarshallingTests::CONSTANT_NUMBER
104
103
  end
105
104
 
106
- it 'has the constant CONSTANT_UTF8' do
107
- assert_equal 'const ♥ utf8', GIMarshallingTests::CONSTANT_UTF8
105
+ it "has the constant CONSTANT_UTF8" do
106
+ assert_equal "const ♥ utf8", GIMarshallingTests::CONSTANT_UTF8
108
107
  end
109
108
 
110
- describe 'GIMarshallingTests::Enum' do
111
- it 'has the member :value1' do
109
+ describe "GIMarshallingTests::Enum" do
110
+ it "has the member :value1" do
112
111
  assert_equal 0, GIMarshallingTests::Enum[:value1]
113
112
  end
114
113
 
115
- it 'has the member :value2' do
114
+ it "has the member :value2" do
116
115
  assert_equal 1, GIMarshallingTests::Enum[:value2]
117
116
  end
118
117
 
119
- it 'has the member :value3' do
118
+ it "has the member :value3" do
120
119
  assert_equal 42, GIMarshallingTests::Enum[:value3]
121
120
  end
122
121
  end
123
122
 
124
- describe 'GIMarshallingTests::Flags' do
125
- it 'has the member :value1' do
123
+ describe "GIMarshallingTests::Flags" do
124
+ it "has the member :value1" do
126
125
  assert_equal 1, GIMarshallingTests::Flags[:value1]
127
126
  end
128
127
 
129
- it 'has the member :value2' do
128
+ it "has the member :value2" do
130
129
  assert_equal 2, GIMarshallingTests::Flags[:value2]
131
130
  end
132
131
 
133
- it 'has the member :value3' do
132
+ it "has the member :value3" do
134
133
  assert_equal 4, GIMarshallingTests::Flags[:value3]
135
134
  end
136
135
 
137
- it 'has the member :mask' do
136
+ it "has the member :mask" do
138
137
  assert_equal 3, GIMarshallingTests::Flags[:mask]
139
138
  end
140
139
 
141
- it 'has the member :mask2' do
140
+ it "has the member :mask2" do
142
141
  assert_equal 3, GIMarshallingTests::Flags[:mask2]
143
142
  end
144
143
 
145
- it 'has a working function #in' do
144
+ it "has a working function #in" do
146
145
  GIMarshallingTests::Flags.in value2: true
147
146
  end
148
147
 
149
- it 'has a working function #in_zero' do
148
+ it "has a working function #in_zero" do
150
149
  GIMarshallingTests::Flags.in_zero 0
151
150
  end
152
151
 
153
- it 'has a working function #inout' do
152
+ it "has a working function #inout" do
154
153
  result = GIMarshallingTests::Flags.inout value2: true
155
- result.must_equal(value1: true)
154
+ _(result).must_equal(value1: true)
156
155
  end
157
156
 
158
- it 'has a working function #out' do
157
+ it "has a working function #out" do
159
158
  result = GIMarshallingTests::Flags.out
160
- result.must_equal(value2: true)
159
+ _(result).must_equal(value2: true)
161
160
  end
162
161
 
163
- it 'has a working function #returnv' do
162
+ it "has a working function #returnv" do
164
163
  result = GIMarshallingTests::Flags.returnv
165
- result.must_equal(value2: true)
164
+ _(result).must_equal(value2: true)
166
165
  end
167
166
  end
168
167
 
169
- describe 'GIMarshallingTests::GEnum' do
170
- it 'has the member :value1' do
168
+ describe "GIMarshallingTests::GEnum" do
169
+ it "has the member :value1" do
171
170
  assert_equal 0, GIMarshallingTests::GEnum[:value1]
172
171
  end
173
172
 
174
- it 'has the member :value2' do
173
+ it "has the member :value2" do
175
174
  assert_equal 1, GIMarshallingTests::GEnum[:value2]
176
175
  end
177
176
 
178
- it 'has the member :value3' do
177
+ it "has the member :value3" do
179
178
  assert_equal 42, GIMarshallingTests::GEnum[:value3]
180
179
  end
181
180
 
182
- it 'has a working function #in' do
181
+ it "has a working function #in" do
183
182
  GIMarshallingTests::GEnum.in :value3
184
183
  end
185
184
 
186
- it 'has a working function #inout' do
185
+ it "has a working function #inout" do
187
186
  result = GIMarshallingTests::GEnum.inout :value3
188
- result.must_equal :value1
187
+ _(result).must_equal :value1
189
188
  end
190
189
 
191
- it 'has a working function #out' do
190
+ it "has a working function #out" do
192
191
  result = GIMarshallingTests::GEnum.out
193
- result.must_equal :value3
192
+ _(result).must_equal :value3
194
193
  end
195
194
 
196
- it 'has a working function #returnv' do
195
+ it "has a working function #returnv" do
197
196
  result = GIMarshallingTests::GEnum.returnv
198
- result.must_equal :value3
197
+ _(result).must_equal :value3
199
198
  end
200
199
  end
201
200
 
202
- describe 'GIMarshallingTests::Interface' do
203
- it 'has a working method #test_int8_in' do
201
+ describe "GIMarshallingTests::Interface" do
202
+ it "has a working method #test_int8_in" do
204
203
  derived_klass.class_eval { include GIMarshallingTests::Interface }
205
204
  derived_instance = make_derived_instance do |info|
206
205
  info.install_vfunc_implementation :test_int8_in, proc { |obj, in_| obj.int = in_ }
207
206
  end
208
207
  derived_instance.test_int8_in 8
209
- derived_instance.int.must_equal 8
208
+ _(derived_instance.int).must_equal 8
210
209
  end
211
210
  end
212
211
 
213
- describe 'GIMarshallingTests::Interface2' do
214
- it 'must be tested for clashes with Interface' do
215
- skip 'Needs more work to determine desired behavior'
212
+ describe "GIMarshallingTests::Interface2" do
213
+ it "must be tested for clashes with Interface" do
214
+ skip "Needs more work to determine desired behavior"
216
215
  end
217
216
  end
218
217
 
219
- describe 'GIMarshallingTests::Interface3' do
220
- it 'has a working method #test_variant_array_in' do
221
- skip unless get_introspection_data 'GIMarshallingTests', 'Interface3'
218
+ describe "GIMarshallingTests::Interface3" do
219
+ it "has a working method #test_variant_array_in" do
222
220
  derived_klass.class_eval { include GIMarshallingTests::Interface3 }
223
221
  derived_instance = make_derived_instance do |info|
224
222
  info.install_vfunc_implementation :test_variant_array_in, proc { |obj, in_|
@@ -226,199 +224,192 @@ describe GIMarshallingTests do
226
224
  }
227
225
  end
228
226
  derived_instance.test_variant_array_in [GLib::Variant.new_byte(42)]
229
- derived_instance.int.must_equal 42
227
+ _(derived_instance.int).must_equal 42
230
228
  end
231
229
  end
232
230
 
233
- describe 'GIMarshallingTests::InterfaceImpl' do
234
- before do
235
- skip unless get_introspection_data 'GIMarshallingTests', 'InterfaceImpl'
236
- end
237
-
238
- it 'has a working method #get_as_interface' do
231
+ describe "GIMarshallingTests::InterfaceImpl" do
232
+ it "has a working method #get_as_interface" do
239
233
  obj = GIMarshallingTests::InterfaceImpl.new []
240
234
  result = obj.get_as_interface
241
- result.must_be_kind_of GIMarshallingTests::Interface
235
+ _(result).must_be_kind_of GIMarshallingTests::Interface
242
236
  end
243
237
  end
244
238
 
245
- describe 'GIMarshallingTests::NestedStruct' do
239
+ describe "GIMarshallingTests::NestedStruct" do
246
240
  let(:instance) { GIMarshallingTests::NestedStruct.new }
247
- it 'has a writable field simple_struct' do
241
+ it "has a writable field simple_struct" do
248
242
  assert_instance_of GIMarshallingTests::SimpleStruct,
249
243
  instance.simple_struct
250
244
  new_struct = GIMarshallingTests::SimpleStruct.new
251
245
  new_struct.int8 = 42
252
246
  instance.simple_struct = new_struct
253
- instance.simple_struct.int8.must_equal 42
247
+ _(instance.simple_struct.int8).must_equal 42
254
248
  end
255
249
  end
256
250
 
257
- describe 'GIMarshallingTests::NoTypeFlags' do
258
- it 'has the member :value1' do
251
+ describe "GIMarshallingTests::NoTypeFlags" do
252
+ it "has the member :value1" do
259
253
  assert_equal 1, GIMarshallingTests::NoTypeFlags[:value1]
260
254
  end
261
- it 'has the member :value2' do
255
+ it "has the member :value2" do
262
256
  assert_equal 2, GIMarshallingTests::NoTypeFlags[:value2]
263
257
  end
264
- it 'has the member :value3' do
258
+ it "has the member :value3" do
265
259
  assert_equal 4, GIMarshallingTests::NoTypeFlags[:value3]
266
260
  end
267
- it 'has the member :mask' do
261
+ it "has the member :mask" do
268
262
  assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask]
269
263
  end
270
- it 'has the member :mask2' do
264
+ it "has the member :mask2" do
271
265
  assert_equal 3, GIMarshallingTests::NoTypeFlags[:mask2]
272
266
  end
273
267
  end
274
268
 
275
- describe 'GIMarshallingTests::NotSimpleStruct' do
269
+ describe "GIMarshallingTests::NotSimpleStruct" do
276
270
  let(:instance) { GIMarshallingTests::NotSimpleStruct.new }
277
271
 
278
- it 'has a writable field pointer' do
279
- instance.pointer.must_be_nil
272
+ it "has a writable field pointer" do
273
+ _(instance.pointer).must_be_nil
280
274
  nested = GIMarshallingTests::NestedStruct.new
281
275
  nested.simple_struct.int8 = 23
282
276
  instance.pointer = nested
283
- instance.pointer.simple_struct.int8.must_equal 23
277
+ _(instance.pointer.simple_struct.int8).must_equal 23
284
278
  end
285
279
  end
286
280
 
287
- it 'has the constant OVERRIDES_CONSTANT' do
281
+ it "has the constant OVERRIDES_CONSTANT" do
288
282
  assert_equal 42, GIMarshallingTests::OVERRIDES_CONSTANT
289
283
  end
290
284
 
291
- describe 'GIMarshallingTests::Object' do
292
- it 'creates an instance using #new' do
285
+ describe "GIMarshallingTests::Object" do
286
+ it "creates an instance using #new" do
293
287
  ob = GIMarshallingTests::Object.new 42
294
288
  assert_instance_of GIMarshallingTests::Object, ob
295
289
  assert_equal 42, ob.int
296
290
  end
297
291
 
298
- it 'fails to create an instance using #new_fail' do
299
- skip unless get_method_introspection_data('GIMarshallingTests', 'Object', 'new_fail')
300
- proc { GIMarshallingTests::Object.new_fail 42 }.must_raise GirFFI::GLibError
292
+ it "fails to create an instance using #new_fail" do
293
+ _(proc { GIMarshallingTests::Object.new_fail 42 }).must_raise GirFFI::GLibError
301
294
  end
302
295
 
303
- it 'has a working function #full_inout' do
296
+ it "has a working function #full_inout" do
304
297
  ob = GIMarshallingTests::Object.new 42
305
- object_ref_count(ob).must_equal 1
298
+ _(object_ref_count(ob)).must_equal 1
306
299
 
307
300
  res = GIMarshallingTests::Object.full_inout ob
308
301
 
309
- object_ref_count(ob).must_equal 1
310
- object_ref_count(res).must_equal 1
302
+ _(object_ref_count(ob)).must_equal 1
303
+ _(object_ref_count(res)).must_equal 1
311
304
 
312
- res.must_be_instance_of GIMarshallingTests::Object
313
- res.int.must_equal 0
305
+ _(res).must_be_instance_of GIMarshallingTests::Object
306
+ _(res.int).must_equal 0
314
307
  end
315
308
 
316
- it 'has a working function #full_out' do
309
+ it "has a working function #full_out" do
317
310
  res = GIMarshallingTests::Object.full_out
318
- res.must_be_instance_of GIMarshallingTests::Object
319
- object_ref_count(res).must_equal 1
311
+ _(res).must_be_instance_of GIMarshallingTests::Object
312
+ _(object_ref_count(res)).must_equal 1
320
313
  end
321
314
 
322
- it 'has a working function #full_return' do
315
+ it "has a working function #full_return" do
323
316
  res = GIMarshallingTests::Object.full_return
324
- res.must_be_instance_of GIMarshallingTests::Object
325
- object_ref_count(res).must_equal 1
317
+ _(res).must_be_instance_of GIMarshallingTests::Object
318
+ _(object_ref_count(res)).must_equal 1
326
319
  end
327
320
 
328
- it 'has a working function #none_inout' do
321
+ it "has a working function #none_inout" do
329
322
  ob = GIMarshallingTests::Object.new 42
330
- object_ref_count(ob).must_equal 1
323
+ _(object_ref_count(ob)).must_equal 1
331
324
 
332
325
  res = GIMarshallingTests::Object.none_inout ob
333
326
 
334
- object_ref_count(ob).must_equal 1
335
- object_ref_count(res).must_equal 2
327
+ _(object_ref_count(ob)).must_equal 1
328
+ _(object_ref_count(res)).must_equal 2
336
329
 
337
- res.must_be_instance_of GIMarshallingTests::Object
338
- ob.int.must_equal 42
339
- res.int.must_equal 0
330
+ _(res).must_be_instance_of GIMarshallingTests::Object
331
+ _(ob.int).must_equal 42
332
+ _(res.int).must_equal 0
340
333
  end
341
334
 
342
- it 'has a working function #none_out' do
335
+ it "has a working function #none_out" do
343
336
  res = GIMarshallingTests::Object.none_out
344
- res.must_be_instance_of GIMarshallingTests::Object
345
- object_ref_count(res).must_equal 2
337
+ _(res).must_be_instance_of GIMarshallingTests::Object
338
+ _(object_ref_count(res)).must_equal 2
346
339
  end
347
340
 
348
- it 'has a working function #none_return' do
341
+ it "has a working function #none_return" do
349
342
  res = GIMarshallingTests::Object.none_return
350
- res.must_be_instance_of GIMarshallingTests::Object
351
- object_ref_count(res).must_equal 2
343
+ _(res).must_be_instance_of GIMarshallingTests::Object
344
+ _(object_ref_count(res)).must_equal 2
352
345
  end
353
346
 
354
- it 'has a working function #static_method' do
347
+ it "has a working function #static_method" do
355
348
  GIMarshallingTests::Object.static_method
356
349
  pass
357
350
  end
358
351
 
359
352
  let(:instance) { GIMarshallingTests::Object.new 42 }
360
353
 
361
- it 'has a working method #call_vfunc_with_callback' do
362
- skip unless get_method_introspection_data('GIMarshallingTests', 'Object',
363
- 'call_vfunc_with_callback')
354
+ it "has a working method #call_vfunc_with_callback" do
364
355
  cb = nil
365
356
  user_data = nil
366
357
  result = nil
367
358
 
368
359
  derived_instance = make_derived_instance do |info|
369
- info.install_vfunc_implementation :vfunc_with_callback, proc { |_obj, callback, callback_data|
370
- cb = callback
371
- user_data = callback_data.address
372
- result = callback.call(42, callback_data)
373
- }
360
+ info.install_vfunc_implementation(
361
+ :vfunc_with_callback,
362
+ proc { |_obj, callback, callback_data|
363
+ cb = callback
364
+ user_data = callback_data.address
365
+ result = callback.call(42, callback_data)
366
+ })
374
367
  end
375
368
  derived_instance.call_vfunc_with_callback
376
369
 
377
- user_data.must_equal 0xdeadbeef
370
+ _(user_data).must_equal 0xdeadbeef
378
371
  # TODO: Change implementation of CallbackBase so that this becomes an
379
372
  # instance of GIMarshallingTests::CallbackIntInt
380
- cb.must_be_instance_of FFI::Function
381
- result.must_equal 42
373
+ _(cb).must_be_instance_of FFI::Function
374
+ _(result).must_equal 42
382
375
  end
383
376
 
384
- it 'has a working method #full_in' do
385
- skip 'This function is defined in the header but not implemented'
377
+ it "has a working method #full_in" do
378
+ skip "This function is defined in the header but not implemented"
386
379
  end
387
380
 
388
- it 'has a working method #get_ref_info_for_vfunc_in_object_transfer_full' do
389
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
390
- 'vfunc_in_object_transfer_full')
381
+ it "has a working method #get_ref_info_for_vfunc_in_object_transfer_full" do
391
382
  obj = nil
392
383
  derived_instance = make_derived_instance do |info|
393
- info.install_vfunc_implementation :vfunc_in_object_transfer_full, proc { |_this, object|
394
- obj = object
395
- }
384
+ info.install_vfunc_implementation(
385
+ :vfunc_in_object_transfer_full,
386
+ proc { |_this, object|
387
+ obj = object
388
+ })
396
389
  end
397
- result = derived_instance.
398
- get_ref_info_for_vfunc_in_object_transfer_full GIMarshallingTests::Object.gtype
399
- result.must_equal [1, false]
400
- obj.must_be_instance_of GIMarshallingTests::Object
390
+ result = derived_instance
391
+ .get_ref_info_for_vfunc_in_object_transfer_full GIMarshallingTests::Object.gtype
392
+ _(result).must_equal [1, false]
393
+ _(obj).must_be_instance_of GIMarshallingTests::Object
401
394
  end
402
395
 
403
- it 'has a working method #get_ref_info_for_vfunc_in_object_transfer_none' do
404
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
405
- 'vfunc_in_object_transfer_none')
396
+ it "has a working method #get_ref_info_for_vfunc_in_object_transfer_none" do
406
397
  obj = nil
407
398
  derived_instance = make_derived_instance do |info|
408
- info.install_vfunc_implementation :vfunc_in_object_transfer_none, proc { |_this, object|
409
- obj = object
410
- }
399
+ info.install_vfunc_implementation(
400
+ :vfunc_in_object_transfer_none,
401
+ proc { |_this, object|
402
+ obj = object
403
+ })
411
404
  end
412
- result = derived_instance.
413
- get_ref_info_for_vfunc_in_object_transfer_none GIMarshallingTests::Object.gtype
414
- object_ref_count(obj).must_be :>, 0
415
- result.must_equal [2, false]
416
- obj.must_be_instance_of GIMarshallingTests::Object
405
+ result = derived_instance
406
+ .get_ref_info_for_vfunc_in_object_transfer_none GIMarshallingTests::Object.gtype
407
+ _(object_ref_count(obj)).must_be :>, 0
408
+ _(result).must_equal [2, false]
409
+ _(obj).must_be_instance_of GIMarshallingTests::Object
417
410
  end
418
411
 
419
- it 'has a working method #get_ref_info_for_vfunc_out_object_transfer_full' do
420
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
421
- 'vfunc_out_object_transfer_full')
412
+ it "has a working method #get_ref_info_for_vfunc_out_object_transfer_full" do
422
413
  obj = nil
423
414
  derived_instance = make_derived_instance do |info|
424
415
  info.install_vfunc_implementation :vfunc_out_object_transfer_full, proc { |_obj|
@@ -426,162 +417,150 @@ describe GIMarshallingTests do
426
417
  }
427
418
  end
428
419
  result = derived_instance.get_ref_info_for_vfunc_out_object_transfer_full
429
- object_ref_count(obj).must_be :>, 0
420
+ _(object_ref_count(obj)).must_be :>, 0
430
421
  # TODO: Check desired result
431
- result.must_equal [2, false]
422
+ _(result).must_equal [2, false]
432
423
  end
433
424
 
434
- it 'has a working method #get_ref_info_for_vfunc_out_object_transfer_none' do
435
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
436
- 'vfunc_out_object_transfer_none')
425
+ it "has a working method #get_ref_info_for_vfunc_out_object_transfer_none" do
437
426
  derived_instance = make_derived_instance do |info|
438
427
  info.install_vfunc_implementation :vfunc_out_object_transfer_none, proc { |_obj|
439
428
  GIMarshallingTests::Object.new 42
440
429
  }
441
430
  end
442
431
  result = derived_instance.get_ref_info_for_vfunc_out_object_transfer_none
443
- result.must_equal [1, false]
432
+ _(result).must_equal [1, false]
444
433
  end
445
434
 
446
- it 'has a working method #get_ref_info_for_vfunc_return_object_transfer_full' do
447
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
448
- 'vfunc_return_object_transfer_full')
435
+ it "has a working method #get_ref_info_for_vfunc_return_object_transfer_full" do
449
436
  derived_instance = make_derived_instance do |info|
450
437
  info.install_vfunc_implementation :vfunc_return_object_transfer_full, proc { |_obj|
451
438
  GIMarshallingTests::Object.new 42
452
439
  }
453
440
  end
454
441
  result = derived_instance.get_ref_info_for_vfunc_return_object_transfer_full
455
- result.must_equal [2, false]
442
+ _(result).must_equal [2, false]
456
443
  end
457
444
 
458
- it 'has a working method #get_ref_info_for_vfunc_return_object_transfer_none' do
459
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
460
- 'vfunc_return_object_transfer_none')
445
+ it "has a working method #get_ref_info_for_vfunc_return_object_transfer_none" do
461
446
  derived_instance = make_derived_instance do |info|
462
447
  info.install_vfunc_implementation :vfunc_return_object_transfer_none, proc { |_obj|
463
448
  GIMarshallingTests::Object.new 42
464
449
  }
465
450
  end
466
451
  result = derived_instance.get_ref_info_for_vfunc_return_object_transfer_none
467
- result.must_equal [1, false]
452
+ _(result).must_equal [1, false]
468
453
  end
469
454
 
470
- it 'has a working method #int8_in' do
455
+ it "has a working method #int8_in" do
471
456
  derived_instance = make_derived_instance do |info|
472
457
  info.install_vfunc_implementation :method_int8_in, proc { |obj, in_| obj.int = in_ }
473
458
  end
474
459
  derived_instance.int8_in 23
475
- derived_instance.int.must_equal 23
460
+ _(derived_instance.int).must_equal 23
476
461
  end
477
462
 
478
- it 'has a working method #int8_out' do
479
- # GLib minor version and GObjectIntrospection minor version should be in sync
480
- skip 'Introspection data is not generated correctly' if GLib::MINOR_VERSION < 42
481
-
463
+ it "has a working method #int8_out" do
482
464
  derived_instance = make_derived_instance do |info|
483
465
  info.install_vfunc_implementation :method_int8_out, proc { |_obj| 42 }
484
466
  end
485
467
 
486
- derived_instance.int8_out.must_equal 42
468
+ _(derived_instance.int8_out).must_equal 42
487
469
  end
488
470
 
489
- it 'has a working method #method' do
471
+ it "has a working method #method" do
490
472
  instance.method
491
473
  pass
492
474
  end
493
475
 
494
- it 'has a working method #method_array_in' do
476
+ it "has a working method #method_array_in" do
495
477
  instance.method_array_in [-1, 0, 1, 2]
496
478
  pass
497
479
  end
498
480
 
499
- it 'has a working method #method_array_inout' do
481
+ it "has a working method #method_array_inout" do
500
482
  res = instance.method_array_inout [-1, 0, 1, 2]
501
- res.must_be :==, [-2, -1, 0, 1, 2]
483
+ _(res).must_be :==, [-2, -1, 0, 1, 2]
502
484
  end
503
485
 
504
- it 'has a working method #method_array_out' do
486
+ it "has a working method #method_array_out" do
505
487
  res = instance.method_array_out
506
- res.must_be :==, [-1, 0, 1, 2]
488
+ _(res).must_be :==, [-1, 0, 1, 2]
507
489
  end
508
490
 
509
- it 'has a working method #method_array_return' do
491
+ it "has a working method #method_array_return" do
510
492
  res = instance.method_array_return
511
- res.must_be :==, [-1, 0, 1, 2]
493
+ _(res).must_be :==, [-1, 0, 1, 2]
512
494
  end
513
495
 
514
- it 'has a working method #method_int8_arg_and_out_callee' do
515
- skip unless get_method_introspection_data('GIMarshallingTests', 'Object',
516
- 'method_int8_arg_and_out_callee')
496
+ it "has a working method #method_int8_arg_and_out_callee" do
517
497
  derived_instance = make_derived_instance do |info|
518
- info.install_vfunc_implementation :method_int8_arg_and_out_callee, proc { |_obj, arg|
519
- 2 * arg
520
- }
498
+ info.install_vfunc_implementation(
499
+ :method_int8_arg_and_out_callee,
500
+ proc { |_obj, arg|
501
+ 2 * arg
502
+ })
521
503
  end
522
504
  result = derived_instance.method_int8_arg_and_out_callee 32
523
- result.must_equal 64
505
+ _(result).must_equal 64
524
506
  end
525
507
 
526
- it 'has a working method #method_int8_arg_and_out_caller' do
527
- skip unless get_method_introspection_data('GIMarshallingTests', 'Object',
528
- 'method_int8_arg_and_out_caller')
508
+ it "has a working method #method_int8_arg_and_out_caller" do
529
509
  derived_instance = make_derived_instance do |info|
530
- info.install_vfunc_implementation :method_int8_arg_and_out_caller, proc { |_obj, arg|
531
- 2 * arg
532
- }
510
+ info.install_vfunc_implementation(
511
+ :method_int8_arg_and_out_caller,
512
+ proc { |_obj, arg|
513
+ 2 * arg
514
+ })
533
515
  end
534
516
  result = derived_instance.method_int8_arg_and_out_caller 32
535
- result.must_equal 64
517
+ _(result).must_equal 64
536
518
  end
537
519
 
538
- it 'has a working method #method_int8_in' do
520
+ it "has a working method #method_int8_in" do
539
521
  derived_instance = make_derived_instance do |info|
540
522
  info.install_vfunc_implementation :method_int8_in, proc { |obj, in_| obj.int = in_ }
541
523
  end
542
524
  derived_instance.method_int8_in 108
543
- derived_instance.int.must_equal 108
525
+ _(derived_instance.int).must_equal 108
544
526
  end
545
527
 
546
- it 'has a working method #method_int8_out' do
528
+ it "has a working method #method_int8_out" do
547
529
  derived_instance = make_derived_instance do |info|
548
530
  info.install_vfunc_implementation :method_int8_out, proc { |_obj| 42 }
549
531
  end
550
- derived_instance.method_int8_out.must_equal 42
532
+ _(derived_instance.method_int8_out).must_equal 42
551
533
  end
552
534
 
553
- it 'has a working method #method_str_arg_out_ret' do
554
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
555
- 'method_str_arg_out_ret')
535
+ it "has a working method #method_str_arg_out_ret" do
556
536
  derived_instance = make_derived_instance do |info|
557
- info.install_vfunc_implementation :method_str_arg_out_ret, proc { |_obj, arg| [arg, 42] }
537
+ info.install_vfunc_implementation(:method_str_arg_out_ret,
538
+ proc { |_obj, arg| [arg, 42] })
558
539
  end
559
- derived_instance.method_str_arg_out_ret('foo').must_equal ['foo', 42]
540
+ _(derived_instance.method_str_arg_out_ret("foo")).must_equal ["foo", 42]
560
541
  end
561
542
 
562
- it 'has a working method #method_variant_array_in' do
563
- skip 'This function is defined in the header but not implemented'
543
+ it "has a working method #method_variant_array_in" do
544
+ skip "This function is defined in the header but not implemented"
564
545
  end
565
546
 
566
- it 'has a working method #method_with_default_implementation' do
547
+ it "has a working method #method_with_default_implementation" do
567
548
  instance.method_with_default_implementation 104
568
549
  assert_equal 104, instance.int
569
550
  end
570
551
 
571
- it 'has a working method #none_in' do
552
+ it "has a working method #none_in" do
572
553
  instance.none_in
573
554
  pass
574
555
  end
575
556
 
576
- it 'has a working method #overridden_method' do
577
- instance.set_property('int', 0)
557
+ it "has a working method #overridden_method" do
558
+ instance.set_property("int", 0)
578
559
  instance.overridden_method
579
560
  pass
580
561
  end
581
562
 
582
- it 'has a working method #vfunc_array_out_parameter' do
583
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
584
- 'vfunc_array_out_parameter')
563
+ it "has a working method #vfunc_array_out_parameter" do
585
564
  derived_instance = make_derived_instance do |info|
586
565
  info.install_vfunc_implementation :vfunc_array_out_parameter, proc { |_obj|
587
566
  [1.1, 2.2, 3.3]
@@ -589,222 +568,218 @@ describe GIMarshallingTests do
589
568
  end
590
569
  result = derived_instance.vfunc_array_out_parameter
591
570
  arr = result.to_a
592
- arr.length.must_equal 3
593
- arr[0].must_be_close_to 1.1
594
- arr[1].must_be_close_to 2.2
595
- arr[2].must_be_close_to 3.3
571
+ _(arr.length).must_equal 3
572
+ _(arr[0]).must_be_close_to 1.1
573
+ _(arr[1]).must_be_close_to 2.2
574
+ _(arr[2]).must_be_close_to 3.3
596
575
  end
597
576
 
598
- it 'has a working method #vfunc_caller_allocated_out_parameter' do
599
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
600
- 'vfunc_caller_allocated_out_parameter')
577
+ it "has a working method #vfunc_caller_allocated_out_parameter" do
601
578
  derived_instance = make_derived_instance do |info|
602
- info.install_vfunc_implementation :vfunc_caller_allocated_out_parameter, proc { |_obj|
603
- 'Hello!'
604
- }
579
+ info.install_vfunc_implementation(
580
+ :vfunc_caller_allocated_out_parameter,
581
+ proc { |_obj|
582
+ "Hello!"
583
+ })
605
584
  end
606
585
  result = derived_instance.vfunc_caller_allocated_out_parameter
607
- result.must_equal 'Hello!'
586
+ _(result).must_equal "Hello!"
608
587
  end
609
588
 
610
- it 'has a working method #vfunc_meth_with_error' do
589
+ it "has a working method #vfunc_meth_with_error" do
611
590
  derived_instance = make_derived_instance do |info|
612
591
  info.install_vfunc_implementation :vfunc_meth_with_err, proc { |_object, x|
613
- raise 'This is not the answer!' unless x == 42
592
+ raise "This is not the answer!" unless x == 42
614
593
 
615
594
  true
616
595
  }
617
596
  end
618
597
  result = derived_instance.vfunc_meth_with_error 42
619
- result.must_equal true
598
+ _(result).must_equal true
620
599
 
621
- err = proc { derived_instance.vfunc_meth_with_error(21) }.
622
- must_raise GirFFI::GLibError
623
- err.message.must_equal 'This is not the answer!'
624
- err.domain.must_equal 'gir_ffi'
625
- err.code.must_equal 0
600
+ err = _(proc { derived_instance.vfunc_meth_with_error(21) })
601
+ .must_raise GirFFI::GLibError
602
+ _(err.message).must_equal "This is not the answer!"
603
+ _(err.domain).must_equal "gir_ffi"
604
+ _(err.code).must_equal 0
626
605
  end
627
606
 
628
- it 'has a working method #vfunc_multiple_out_parameters' do
607
+ it "has a working method #vfunc_multiple_out_parameters" do
629
608
  derived_instance = make_derived_instance do |info|
630
609
  info.install_vfunc_implementation(
631
610
  :vfunc_multiple_out_parameters,
632
611
  proc { |*_args| [42.1, -142.3] })
633
612
  end
634
613
  result = derived_instance.vfunc_multiple_out_parameters
635
- result[0].must_be_close_to 42.1
636
- result[1].must_be_close_to(-142.3)
614
+ _(result[0]).must_be_close_to 42.1
615
+ _(result[1]).must_be_close_to(-142.3)
637
616
  end
638
617
 
639
- it 'has a working method #vfunc_one_out_parameter' do
618
+ it "has a working method #vfunc_one_out_parameter" do
640
619
  derived_instance = make_derived_instance do |info|
641
620
  info.install_vfunc_implementation(
642
621
  :vfunc_one_out_parameter,
643
622
  proc { |*_args| 23.4 })
644
623
  end
645
- derived_instance.vfunc_one_out_parameter.
646
- must_be_within_epsilon 23.4
624
+ _(derived_instance.vfunc_one_out_parameter)
625
+ .must_be_within_epsilon 23.4
647
626
  end
648
627
 
649
- it 'has a working method #vfunc_out_enum' do
650
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
651
- 'vfunc_out_enum')
628
+ it "has a working method #vfunc_out_enum" do
652
629
  derived_instance = make_derived_instance do |info|
653
630
  info.install_vfunc_implementation :vfunc_out_enum, proc { |_obj| :value2 }
654
631
  end
655
- derived_instance.vfunc_out_enum.must_equal :value2
632
+ _(derived_instance.vfunc_out_enum).must_equal :value2
656
633
  end
657
634
 
658
- it 'has a working method #vfunc_return_enum' do
659
- skip unless get_vfunc_introspection_data('GIMarshallingTests', 'Object',
660
- 'vfunc_return_enum')
635
+ it "has a working method #vfunc_return_enum" do
661
636
  derived_instance = make_derived_instance do |info|
662
637
  info.install_vfunc_implementation :vfunc_return_enum, proc { |_obj| :value2 }
663
638
  end
664
- derived_instance.vfunc_return_enum.must_equal :value2
639
+ _(derived_instance.vfunc_return_enum).must_equal :value2
665
640
  end
666
641
 
667
- it 'has a working method #vfunc_return_value_and_multiple_out_parameters' do
642
+ it "has a working method #vfunc_return_value_and_multiple_out_parameters" do
668
643
  derived_instance = make_derived_instance do |info|
669
644
  info.install_vfunc_implementation(
670
645
  :vfunc_return_value_and_multiple_out_parameters,
671
646
  proc { |*_args| [42, -142, 3] })
672
647
  end
673
- derived_instance.vfunc_return_value_and_multiple_out_parameters.
674
- must_equal [42, -142, 3]
648
+ _(derived_instance.vfunc_return_value_and_multiple_out_parameters)
649
+ .must_equal [42, -142, 3]
675
650
  end
676
651
 
677
- it 'has a working method #vfunc_return_value_and_one_out_parameter' do
652
+ it "has a working method #vfunc_return_value_and_one_out_parameter" do
678
653
  derived_instance = make_derived_instance do |info|
679
654
  info.install_vfunc_implementation(
680
655
  :vfunc_return_value_and_one_out_parameter,
681
656
  proc { |*_args| [42, -142] })
682
657
  end
683
- derived_instance.vfunc_return_value_and_one_out_parameter.
684
- must_equal [42, -142]
658
+ _(derived_instance.vfunc_return_value_and_one_out_parameter)
659
+ .must_equal [42, -142]
685
660
  end
686
661
 
687
- it 'has a working method #vfunc_return_value_only' do
662
+ it "has a working method #vfunc_return_value_only" do
688
663
  derived_instance = make_derived_instance do |info|
689
- info.install_vfunc_implementation :vfunc_return_value_only, proc { |_obj| 0x1234_5678 }
664
+ info.install_vfunc_implementation(:vfunc_return_value_only,
665
+ proc { |_obj| 0x1234_5678 })
690
666
  end
691
667
  result = derived_instance.vfunc_return_value_only
692
- result.must_equal 0x1234_5678
668
+ _(result).must_equal 0x1234_5678
693
669
  end
694
670
 
695
- it 'has a working method #vfunc_with_callback' do
696
- skip unless get_method_introspection_data('GIMarshallingTests', 'Object',
697
- 'vfunc_with_callback')
698
-
671
+ it "has a working method #vfunc_with_callback" do
699
672
  result = 1
700
673
 
701
674
  derived_instance = make_derived_instance do |info|
702
- info.install_vfunc_implementation :vfunc_with_callback, proc { |_obj, callback, callback_data|
703
- callback.call(42, callback_data)
704
- }
675
+ info.install_vfunc_implementation(
676
+ :vfunc_with_callback,
677
+ proc { |_obj, callback, callback_data|
678
+ callback.call(42, callback_data)
679
+ })
705
680
  end
706
681
 
707
682
  derived_instance.vfunc_with_callback { |val, user_data| result = val + user_data }
708
683
 
709
684
  # The current implementation of the vfunc_with_callback method currently
710
685
  # doesn't actually call the virtual function vfunc_with_callback.
711
- result.must_equal 1
712
- result.wont_equal 42 + 23
686
+ _(result).must_equal 1
687
+ _(result).wont_equal 42 + 23
713
688
  end
714
689
 
715
690
  describe "its 'int' property" do
716
- it 'can be retrieved with #get_property' do
717
- assert_equal 42, instance.get_property('int')
691
+ it "can be retrieved with #get_property" do
692
+ assert_equal 42, instance.get_property("int")
718
693
  end
719
- it 'can be retrieved with #int' do
694
+ it "can be retrieved with #int" do
720
695
  assert_equal 42, instance.int
721
696
  end
722
- it 'can be set with #set_property' do
723
- instance.set_property('int', 13)
724
- assert_equal 13, instance.get_property('int')
697
+ it "can be set with #set_property" do
698
+ instance.set_property("int", 13)
699
+ assert_equal 13, instance.get_property("int")
725
700
  end
726
- it 'can be set with #int=' do
701
+ it "can be set with #int=" do
727
702
  instance.int = 1
728
703
  assert_equal 1, instance.int
729
704
  end
730
705
  end
731
706
  end
732
707
 
733
- describe 'GIMarshallingTests::OverridesObject' do
734
- it 'creates an instance using #new' do
708
+ describe "GIMarshallingTests::OverridesObject" do
709
+ it "creates an instance using #new" do
735
710
  ob = GIMarshallingTests::OverridesObject.new
736
711
  assert_instance_of GIMarshallingTests::OverridesObject, ob
737
712
  end
738
713
 
739
- it 'has a working function #returnv' do
714
+ it "has a working function #returnv" do
740
715
  ob = GIMarshallingTests::OverridesObject.returnv
741
716
  assert_instance_of GIMarshallingTests::OverridesObject, ob
742
717
  end
743
718
 
744
719
  let(:instance) { GIMarshallingTests::OverridesObject.new }
745
720
 
746
- it 'has a working method #method' do
721
+ it "has a working method #method" do
747
722
  result = instance.method
748
- result.must_equal 42
723
+ _(result).must_equal 42
749
724
  end
750
725
 
751
- it 'does not have accessors for its parent instance' do
752
- instance.wont_respond_to :parent_instance
753
- instance.wont_respond_to :parent_instance=
726
+ it "does not have accessors for its parent instance" do
727
+ _(instance).wont_respond_to :parent_instance
728
+ _(instance).wont_respond_to :parent_instance=
754
729
  end
755
730
  end
756
731
 
757
- describe 'GIMarshallingTests::OverridesStruct' do
732
+ describe "GIMarshallingTests::OverridesStruct" do
758
733
  let(:instance) { GIMarshallingTests::OverridesStruct.new }
759
734
 
760
- it 'has a writable field long_' do
735
+ it "has a writable field long_" do
761
736
  instance.long_ = 43
762
- instance.long_.must_equal 43
737
+ _(instance.long_).must_equal 43
763
738
  end
764
739
 
765
- it 'creates an instance using #new' do
740
+ it "creates an instance using #new" do
766
741
  ob = GIMarshallingTests::OverridesStruct.new
767
742
  assert_instance_of GIMarshallingTests::OverridesStruct, ob
768
743
  end
769
744
 
770
- it 'has a working method #method' do
771
- instance.method.must_equal 42
745
+ it "has a working method #method" do
746
+ _(instance.method).must_equal 42
772
747
  end
773
748
 
774
- it 'has a working function #returnv' do
749
+ it "has a working function #returnv" do
775
750
  ob = GIMarshallingTests::OverridesStruct.returnv
776
751
  assert_instance_of GIMarshallingTests::OverridesStruct, ob
777
752
  end
778
753
  end
779
754
 
780
- describe 'GIMarshallingTests::PointerStruct' do
781
- it 'creates an instance using #new' do
755
+ describe "GIMarshallingTests::PointerStruct" do
756
+ it "creates an instance using #new" do
782
757
  ps = GIMarshallingTests::PointerStruct.new
783
758
  assert_instance_of GIMarshallingTests::PointerStruct, ps
784
759
  end
785
760
 
786
761
  let(:instance) { GIMarshallingTests::PointerStruct.new }
787
762
 
788
- it 'has a writable field long_' do
763
+ it "has a writable field long_" do
789
764
  assert_equal 0, instance.long_
790
765
  instance.long_ = 1056
791
766
  assert_equal 1056, instance.long_
792
767
  end
793
768
 
794
- it 'has a working method #inv' do
769
+ it "has a working method #inv" do
795
770
  instance.long_ = 42
796
771
  instance.inv
797
772
  pass
798
773
  end
799
774
 
800
- it 'has a working function #returnv' do
775
+ it "has a working function #returnv" do
801
776
  ob = GIMarshallingTests::PointerStruct.returnv
802
777
  assert_instance_of GIMarshallingTests::PointerStruct, ob
803
778
  end
804
779
  end
805
780
 
806
- describe 'GIMarshallingTests::PropertiesObject' do
807
- it 'creates an instance using #new' do
781
+ describe "GIMarshallingTests::PropertiesObject" do
782
+ it "creates an instance using #new" do
808
783
  ob = GIMarshallingTests::PropertiesObject.new
809
784
  assert_instance_of GIMarshallingTests::PropertiesObject, ob
810
785
  end
@@ -812,781 +787,897 @@ describe GIMarshallingTests do
812
787
  let(:instance) { GIMarshallingTests::PropertiesObject.new }
813
788
 
814
789
  describe "its 'some-boolean' property" do
815
- it 'can be retrieved with #get_property' do
816
- instance.get_property('some-boolean').must_equal false
790
+ it "can be retrieved with #get_property" do
791
+ _(instance.get_property("some-boolean")).must_equal false
817
792
  end
818
793
 
819
- it 'can be retrieved with #some_boolean' do
820
- instance.some_boolean.must_equal false
794
+ it "can be retrieved with #some_boolean" do
795
+ _(instance.some_boolean).must_equal false
821
796
  end
822
797
 
823
- it 'can be set with #set_property' do
824
- instance.set_property('some-boolean', true)
825
- instance.get_property('some-boolean').must_equal true
798
+ it "can be set with #set_property" do
799
+ instance.set_property("some-boolean", true)
800
+ _(instance.get_property("some-boolean")).must_equal true
826
801
  end
827
802
 
828
- it 'can be set with #some_boolean=' do
803
+ it "can be set with #some_boolean=" do
829
804
  instance.some_boolean = true
830
- instance.get_property('some-boolean').must_equal true
805
+ _(instance.get_property("some-boolean")).must_equal true
831
806
  end
832
807
  end
833
808
 
834
809
  describe "its 'some-boxed-glist' property" do
835
- before do
836
- skip unless get_property_introspection_data('GIMarshallingTests',
837
- 'PropertiesObject',
838
- 'some-boxed-glist')
810
+ it "can be retrieved with #get_property" do
811
+ _(instance.get_property("some-boxed-glist")).must_be_nil
839
812
  end
840
813
 
841
- it 'can be retrieved with #get_property' do
842
- instance.get_property('some-boxed-glist').must_be_nil
814
+ it "can be retrieved with #some_boxed_glist" do
815
+ _(instance.some_boxed_glist).must_be_nil
843
816
  end
844
817
 
845
- it 'can be retrieved with #some_boxed_glist' do
846
- instance.some_boxed_glist.must_be_nil
818
+ it "can be set with #set_property" do
819
+ instance.set_property("some-boxed-glist", [1, 2, 3])
820
+ _(instance.some_boxed_glist.to_a).must_equal [1, 2, 3]
847
821
  end
848
822
 
849
- it 'can be set with #set_property_extended' do
850
- instance.set_property_extended('some-boxed-glist', [1, 2, 3])
851
- instance.some_boxed_glist.to_a.must_equal [1, 2, 3]
852
- end
853
-
854
- it 'can be set with #some_boxed_glist=' do
823
+ it "can be set with #some_boxed_glist=" do
855
824
  instance.some_boxed_glist = [1, 2, 3]
856
- instance.some_boxed_glist.to_a.must_equal [1, 2, 3]
857
- instance.get_property_extended('some-boxed-glist').to_a.must_equal [1, 2, 3]
825
+ _(instance.some_boxed_glist.to_a).must_equal [1, 2, 3]
826
+ _(instance.get_property("some-boxed-glist").to_a).must_equal [1, 2, 3]
858
827
  end
859
828
  end
860
829
 
861
830
  describe "its 'some-boxed-struct' property" do
862
- before do
863
- skip unless get_property_introspection_data('GIMarshallingTests',
864
- 'PropertiesObject',
865
- 'some-boxed-struct')
831
+ it "can be retrieved with #get_property" do
832
+ _(instance.get_property("some-boxed-struct")).must_be_nil
866
833
  end
867
834
 
868
- it 'can be retrieved with #get_property' do
869
- instance.get_property('some-boxed-struct').must_be_nil
835
+ it "can be retrieved with #some_boxed_struct" do
836
+ _(instance.some_boxed_struct).must_be_nil
870
837
  end
871
838
 
872
- it 'can be retrieved with #some_boxed_struct' do
873
- instance.some_boxed_struct.must_be_nil
874
- end
875
-
876
- it 'can be set with #set_property' do
839
+ it "can be set with #set_property" do
877
840
  boxed = GIMarshallingTests::BoxedStruct.new
878
841
  boxed.long_ = 42
879
- instance.set_property('some-boxed-struct', boxed)
880
- instance.get_property('some-boxed-struct').long_.must_equal 42
842
+ instance.set_property("some-boxed-struct", boxed)
843
+ _(instance.get_property("some-boxed-struct").long_).must_equal 42
881
844
  end
882
845
 
883
- it 'can be set with #some_boxed_struct=' do
846
+ it "can be set with #some_boxed_struct=" do
884
847
  boxed = GIMarshallingTests::BoxedStruct.new
885
848
  boxed.long_ = 43
886
849
  instance.some_boxed_struct = boxed
887
- instance.some_boxed_struct.long_.must_equal 43
850
+ _(instance.some_boxed_struct.long_).must_equal 43
851
+ end
852
+ end
853
+
854
+ describe "its 'some-byte-array' property" do
855
+ before { skip_below("1.57.2") }
856
+
857
+ it "can be retrieved with #get_property" do
858
+ _(instance.get_property("some-byte-array")).must_be_nil
859
+ end
860
+
861
+ it "can be retrieved with #some_byte_array" do
862
+ _(instance.some_byte_array).must_be_nil
863
+ end
864
+
865
+ it "can be set with #set_property" do
866
+ instance.set_property "some-byte-array", "some bytes"
867
+ _(instance.get_property("some-byte-array").to_string).must_equal "some bytes"
868
+ end
869
+
870
+ it "can be set with #some_byte_array=" do
871
+ instance.some_byte_array = "some bytes"
872
+ _(instance.some_byte_array.to_string).must_equal "some bytes"
888
873
  end
889
874
  end
890
875
 
891
876
  describe "its 'some-char' property" do
892
- it 'can be retrieved with #get_property' do
893
- instance.get_property('some-char').must_equal 0
877
+ it "can be retrieved with #get_property" do
878
+ _(instance.get_property("some-char")).must_equal 0
894
879
  end
895
880
 
896
- it 'can be retrieved with #some_char' do
897
- instance.some_char.must_equal 0
881
+ it "can be retrieved with #some_char" do
882
+ _(instance.some_char).must_equal 0
898
883
  end
899
884
 
900
- it 'can be set with #set_property' do
901
- instance.set_property 'some-char', 42
902
- instance.get_property('some-char').must_equal 42
885
+ it "can be set with #set_property" do
886
+ instance.set_property "some-char", 42
887
+ _(instance.get_property("some-char")).must_equal 42
903
888
  end
904
889
 
905
- it 'can be set with #some_char=' do
890
+ it "can be set with #some_char=" do
906
891
  instance.some_char = 43
907
- instance.some_char.must_equal 43
892
+ _(instance.some_char).must_equal 43
908
893
  end
909
894
  end
910
895
 
911
896
  describe "its 'some-double' property" do
912
- it 'can be retrieved with #get_property' do
913
- instance.get_property('some-double').must_equal 0.0
897
+ it "can be retrieved with #get_property" do
898
+ _(instance.get_property("some-double")).must_equal 0.0
914
899
  end
915
900
 
916
- it 'can be retrieved with #some_double' do
917
- instance.some_double.must_equal 0.0
901
+ it "can be retrieved with #some_double" do
902
+ _(instance.some_double).must_equal 0.0
918
903
  end
919
904
 
920
- it 'can be set with #set_property' do
921
- instance.set_property('some-double', 3.14)
922
- instance.get_property('some-double').must_equal 3.14
905
+ it "can be set with #set_property" do
906
+ instance.set_property("some-double", 3.14)
907
+ _(instance.get_property("some-double")).must_equal 3.14
923
908
  end
924
909
 
925
- it 'can be set with #some_double=' do
910
+ it "can be set with #some_double=" do
926
911
  instance.some_double = 3.14
927
- instance.some_double.must_equal 3.14
912
+ _(instance.some_double).must_equal 3.14
913
+ end
914
+ end
915
+
916
+ describe "its 'some-enum' property" do
917
+ before { skip_below("1.52.1") }
918
+
919
+ it "can be retrieved with #get_property" do
920
+ _(instance.get_property("some-enum")).must_equal :value1
921
+ end
922
+
923
+ it "can be retrieved with #some_enum" do
924
+ _(instance.some_enum).must_equal :value1
925
+ end
926
+
927
+ it "can be set with #set_property" do
928
+ instance.set_property("some-enum", :value3)
929
+ _(instance.get_property("some-enum")).must_equal :value3
930
+ end
931
+
932
+ it "can be set with #some_enum=" do
933
+ instance.some_enum = :value3
934
+ _(instance.some_enum).must_equal :value3
935
+ _(instance.get_property("some-enum")).must_equal :value3
936
+ end
937
+ end
938
+
939
+ describe "its 'some-flags' property" do
940
+ before { skip_below("1.52.1") }
941
+
942
+ it "can be retrieved with #get_property" do
943
+ _(instance.get_property("some-flags")).must_equal value1: true
944
+ end
945
+
946
+ it "can be retrieved with #some_flags" do
947
+ _(instance.some_flags).must_equal value1: true
948
+ end
949
+
950
+ it "can be set with #set_property" do
951
+ instance.set_property("some-flags", value3: true)
952
+ _(instance.get_property("some-flags")).must_equal value3: true
953
+ end
954
+
955
+ it "can be set with #some_flags=" do
956
+ instance.some_flags = :value3
957
+ _(instance.some_flags).must_equal(value3: true)
958
+ _(instance.get_property("some-flags")).must_equal(value3: true)
928
959
  end
929
960
  end
930
961
 
931
962
  describe "its 'some-float' property" do
932
- it 'can be retrieved with #get_property' do
933
- instance.get_property('some-float').must_equal 0.0
963
+ it "can be retrieved with #get_property" do
964
+ _(instance.get_property("some-float")).must_equal 0.0
934
965
  end
935
966
 
936
- it 'can be retrieved with #some_float' do
937
- instance.some_float.must_equal 0.0
967
+ it "can be retrieved with #some_float" do
968
+ _(instance.some_float).must_equal 0.0
938
969
  end
939
970
 
940
- it 'can be set with #set_property' do
941
- instance.set_property('some-float', 3.14)
942
- instance.get_property('some-float').must_be_close_to 3.14
971
+ it "can be set with #set_property" do
972
+ instance.set_property("some-float", 3.14)
973
+ _(instance.get_property("some-float")).must_be_close_to 3.14
943
974
  end
944
975
 
945
- it 'can be set with #some_float=' do
976
+ it "can be set with #some_float=" do
946
977
  instance.some_float = 3.14
947
- instance.some_float.must_be_close_to 3.14
978
+ _(instance.some_float).must_be_close_to 3.14
979
+ end
980
+ end
981
+
982
+ describe "its 'some-gvalue' property" do
983
+ before { skip_below "1.52.1" }
984
+
985
+ it "can be retrieved with #get_property" do
986
+ _(instance.get_property("some-gvalue")).must_be_nil
987
+ end
988
+
989
+ it "can be retrieved with #some_gvalue" do
990
+ _(instance.some_gvalue).must_be_nil
991
+ end
992
+
993
+ it "can be set with #set_property" do
994
+ value = GObject::Value.from 42
995
+ instance.set_property("some-gvalue", value)
996
+ _(instance.get_property("some-gvalue").get_value).must_equal 42
997
+ end
998
+
999
+ it "can be set with #some_gvalue=" do
1000
+ value = GObject::Value.from 42
1001
+ instance.some_gvalue = value
1002
+ _(instance.some_gvalue.get_value).must_equal 42
1003
+ _(instance.get_property("some-gvalue").get_value).must_equal 42
948
1004
  end
949
1005
  end
950
1006
 
951
1007
  describe "its 'some-int' property" do
952
- it 'can be retrieved with #get_property' do
953
- instance.get_property('some-int').must_equal 0
1008
+ it "can be retrieved with #get_property" do
1009
+ _(instance.get_property("some-int")).must_equal 0
954
1010
  end
955
1011
 
956
- it 'can be retrieved with #some_int' do
957
- instance.some_int.must_equal 0
1012
+ it "can be retrieved with #some_int" do
1013
+ _(instance.some_int).must_equal 0
958
1014
  end
959
1015
 
960
- it 'can be set with #set_property' do
961
- instance.set_property 'some-int', 4242
962
- instance.get_property('some-int').must_equal 4242
1016
+ it "can be set with #set_property" do
1017
+ instance.set_property "some-int", 4242
1018
+ _(instance.get_property("some-int")).must_equal 4242
963
1019
  end
964
1020
 
965
- it 'can be set with #some_int=' do
1021
+ it "can be set with #some_int=" do
966
1022
  instance.some_int = 4243
967
- instance.some_int.must_equal 4243
1023
+ _(instance.some_int).must_equal 4243
968
1024
  end
969
1025
  end
970
1026
 
971
1027
  describe "its 'some-int64' property" do
972
- it 'can be retrieved with #get_property' do
973
- instance.get_property('some-int64').must_equal 0
1028
+ it "can be retrieved with #get_property" do
1029
+ _(instance.get_property("some-int64")).must_equal 0
974
1030
  end
975
1031
 
976
- it 'can be retrieved with #some_int64' do
977
- instance.some_int64.must_equal 0
1032
+ it "can be retrieved with #some_int64" do
1033
+ _(instance.some_int64).must_equal 0
978
1034
  end
979
1035
 
980
- it 'can be set with #set_property' do
981
- instance.set_property 'some-int64', 42_000_000_000_000
982
- instance.get_property('some-int64').must_equal 42_000_000_000_000
1036
+ it "can be set with #set_property" do
1037
+ instance.set_property "some-int64", 42_000_000_000_000
1038
+ _(instance.get_property("some-int64")).must_equal 42_000_000_000_000
983
1039
  end
984
1040
 
985
- it 'can be set with #some_int64=' do
1041
+ it "can be set with #some_int64=" do
986
1042
  instance.some_int64 = 43_000_000_000_000
987
- instance.some_int64.must_equal 43_000_000_000_000
1043
+ _(instance.some_int64).must_equal 43_000_000_000_000
988
1044
  end
989
1045
  end
990
1046
 
991
1047
  describe "its 'some-long' property" do
992
- it 'can be retrieved with #get_property' do
993
- instance.get_property('some-long').must_equal 0
1048
+ it "can be retrieved with #get_property" do
1049
+ _(instance.get_property("some-long")).must_equal 0
994
1050
  end
995
1051
 
996
- it 'can be retrieved with #some_long' do
997
- instance.some_long.must_equal 0
1052
+ it "can be retrieved with #some_long" do
1053
+ _(instance.some_long).must_equal 0
998
1054
  end
999
1055
 
1000
- it 'can be set with #set_property' do
1001
- instance.set_property 'some-long', 4242
1002
- instance.get_property('some-long').must_equal 4242
1056
+ it "can be set with #set_property" do
1057
+ instance.set_property "some-long", 4242
1058
+ _(instance.get_property("some-long")).must_equal 4242
1003
1059
  end
1004
1060
 
1005
- it 'can be set with #some_long=' do
1061
+ it "can be set with #some_long=" do
1006
1062
  instance.some_long = 4243
1007
- instance.some_long.must_equal 4243
1063
+ _(instance.some_long).must_equal 4243
1008
1064
  end
1009
1065
  end
1010
1066
 
1011
1067
  describe "its 'some-object' property" do
1012
- before do
1013
- skip unless get_property_introspection_data('GIMarshallingTests',
1014
- 'PropertiesObject',
1015
- 'some-object')
1016
- end
1017
-
1018
- it 'can be retrieved with #get_property' do
1019
- instance.get_property('some-object').must_be_nil
1068
+ it "can be retrieved with #get_property" do
1069
+ _(instance.get_property("some-object")).must_be_nil
1020
1070
  end
1021
1071
 
1022
- it 'can be retrieved with #some_object' do
1023
- instance.some_object.must_be_nil
1072
+ it "can be retrieved with #some_object" do
1073
+ _(instance.some_object).must_be_nil
1024
1074
  end
1025
1075
 
1026
- it 'can be set with #set_property' do
1076
+ it "can be set with #set_property" do
1027
1077
  ob = GIMarshallingTests::Object.new 42
1028
- instance.set_property 'some-object', ob
1029
- instance.get_property('some-object').must_equal ob
1078
+ instance.set_property "some-object", ob
1079
+ _(instance.get_property("some-object")).must_equal ob
1030
1080
  end
1031
1081
 
1032
- it 'can be set with #some_object=' do
1082
+ it "can be set with #some_object=" do
1033
1083
  ob = GIMarshallingTests::Object.new 42
1034
1084
  instance.some_object = ob
1035
- instance.some_object.must_equal ob
1085
+ _(instance.some_object).must_equal ob
1036
1086
  end
1037
1087
  end
1038
1088
 
1039
- describe "its 'some-strv' property" do
1040
- before do
1041
- skip unless get_property_introspection_data('GIMarshallingTests',
1042
- 'PropertiesObject',
1043
- 'some-strv')
1089
+ describe "its 'some-readonly' property" do
1090
+ before { skip_below("1.57.2") }
1091
+
1092
+ it "can be retrieved with #get_property" do
1093
+ _(instance.get_property("some-readonly")).must_equal 42
1044
1094
  end
1045
1095
 
1046
- it 'can be retrieved with #get_property' do
1047
- instance.get_property('some-strv').must_be :==, []
1096
+ it "can be retrieved with #some_readonly" do
1097
+ _(instance.some_readonly).must_equal 42
1048
1098
  end
1099
+ end
1049
1100
 
1050
- it 'can be retrieved with #some_strv' do
1051
- instance.some_strv.must_be :==, []
1101
+ describe "its 'some-strv' property" do
1102
+ it "can be retrieved with #get_property" do
1103
+ _(instance.get_property("some-strv")).must_be :==, []
1052
1104
  end
1053
1105
 
1054
- it 'can be set with #set_property_extended' do
1055
- instance.set_property_extended('some-strv', %w(foo bar))
1056
- instance.get_property('some-strv').must_be :==, %w(foo bar)
1106
+ it "can be retrieved with #some_strv" do
1107
+ _(instance.some_strv).must_be :==, []
1057
1108
  end
1058
1109
 
1059
- it 'can be set with #some_strv=' do
1110
+ it "can be set with #set_property" do
1111
+ instance.set_property("some-strv", %w(foo bar))
1112
+ _(instance.get_property("some-strv")).must_be :==, %w(foo bar)
1113
+ end
1114
+
1115
+ it "can be set with #some_strv=" do
1060
1116
  instance.some_strv = %w(foo bar)
1061
- instance.some_strv.must_be :==, %w(foo bar)
1117
+ _(instance.some_strv).must_be :==, %w(foo bar)
1062
1118
  end
1063
1119
  end
1064
1120
 
1065
1121
  describe "its 'some-uchar' property" do
1066
- it 'can be retrieved with #get_property' do
1067
- instance.get_property('some-uchar').must_equal 0
1122
+ it "can be retrieved with #get_property" do
1123
+ _(instance.get_property("some-uchar")).must_equal 0
1068
1124
  end
1069
1125
 
1070
- it 'can be retrieved with #some_uchar' do
1071
- instance.some_uchar.must_equal 0
1126
+ it "can be retrieved with #some_uchar" do
1127
+ _(instance.some_uchar).must_equal 0
1072
1128
  end
1073
1129
 
1074
- it 'can be set with #set_property' do
1075
- instance.set_property 'some-uchar', 42
1076
- instance.get_property('some-uchar').must_equal 42
1130
+ it "can be set with #set_property" do
1131
+ instance.set_property "some-uchar", 42
1132
+ _(instance.get_property("some-uchar")).must_equal 42
1077
1133
  end
1078
1134
 
1079
- it 'can be set with #some_uchar=' do
1135
+ it "can be set with #some_uchar=" do
1080
1136
  instance.some_uchar = 43
1081
- instance.some_uchar.must_equal 43
1137
+ _(instance.some_uchar).must_equal 43
1082
1138
  end
1083
1139
  end
1084
1140
 
1085
1141
  describe "its 'some-uint' property" do
1086
- it 'can be retrieved with #get_property' do
1087
- instance.get_property('some-uint').must_equal 0
1142
+ it "can be retrieved with #get_property" do
1143
+ _(instance.get_property("some-uint")).must_equal 0
1088
1144
  end
1089
1145
 
1090
- it 'can be retrieved with #some_uint' do
1091
- instance.some_uint.must_equal 0
1146
+ it "can be retrieved with #some_uint" do
1147
+ _(instance.some_uint).must_equal 0
1092
1148
  end
1093
1149
 
1094
- it 'can be set with #set_property' do
1095
- instance.set_property 'some-uint', 4242
1096
- instance.get_property('some-uint').must_equal 4242
1150
+ it "can be set with #set_property" do
1151
+ instance.set_property "some-uint", 4242
1152
+ _(instance.get_property("some-uint")).must_equal 4242
1097
1153
  end
1098
1154
 
1099
- it 'can be set with #some_uint=' do
1155
+ it "can be set with #some_uint=" do
1100
1156
  instance.some_uint = 4243
1101
- instance.some_uint.must_equal 4243
1157
+ _(instance.some_uint).must_equal 4243
1102
1158
  end
1103
1159
  end
1104
1160
 
1105
1161
  describe "its 'some-uint64' property" do
1106
- it 'can be retrieved with #get_property' do
1107
- instance.get_property('some-uint64').must_equal 0
1162
+ it "can be retrieved with #get_property" do
1163
+ _(instance.get_property("some-uint64")).must_equal 0
1108
1164
  end
1109
1165
 
1110
- it 'can be retrieved with #some_uint64' do
1111
- instance.some_uint64.must_equal 0
1166
+ it "can be retrieved with #some_uint64" do
1167
+ _(instance.some_uint64).must_equal 0
1112
1168
  end
1113
1169
 
1114
- it 'can be set with #set_property' do
1115
- instance.set_property 'some-uint64', 42_000_000_000_000
1116
- instance.get_property('some-uint64').must_equal 42_000_000_000_000
1170
+ it "can be set with #set_property" do
1171
+ instance.set_property "some-uint64", 42_000_000_000_000
1172
+ _(instance.get_property("some-uint64")).must_equal 42_000_000_000_000
1117
1173
  end
1118
1174
 
1119
- it 'can be set with #some_uint64=' do
1175
+ it "can be set with #some_uint64=" do
1120
1176
  instance.some_uint64 = 43_000_000_000_000
1121
- instance.some_uint64.must_equal 43_000_000_000_000
1177
+ _(instance.some_uint64).must_equal 43_000_000_000_000
1122
1178
  end
1123
1179
  end
1124
1180
 
1125
1181
  describe "its 'some-ulong' property" do
1126
- it 'can be retrieved with #get_property' do
1127
- instance.get_property('some-ulong').must_equal 0
1182
+ it "can be retrieved with #get_property" do
1183
+ _(instance.get_property("some-ulong")).must_equal 0
1128
1184
  end
1129
1185
 
1130
- it 'can be retrieved with #some_ulong' do
1131
- instance.some_ulong.must_equal 0
1186
+ it "can be retrieved with #some_ulong" do
1187
+ _(instance.some_ulong).must_equal 0
1132
1188
  end
1133
1189
 
1134
- it 'can be set with #set_property' do
1135
- instance.set_property 'some-ulong', 4242
1136
- instance.get_property('some-ulong').must_equal 4242
1190
+ it "can be set with #set_property" do
1191
+ instance.set_property "some-ulong", 4242
1192
+ _(instance.get_property("some-ulong")).must_equal 4242
1137
1193
  end
1138
1194
 
1139
- it 'can be set with #some_ulong=' do
1195
+ it "can be set with #some_ulong=" do
1140
1196
  instance.some_ulong = 4243
1141
- instance.some_ulong.must_equal 4243
1197
+ _(instance.some_ulong).must_equal 4243
1142
1198
  end
1143
1199
  end
1144
1200
 
1145
1201
  describe "its 'some-variant' property" do
1146
- before do
1147
- skip unless get_property_introspection_data('GIMarshallingTests',
1148
- 'PropertiesObject',
1149
- 'some-variant')
1150
- end
1151
-
1152
- it 'can be retrieved with #get_property' do
1153
- instance.get_property('some-variant').must_be_nil
1202
+ it "can be retrieved with #get_property" do
1203
+ _(instance.get_property("some-variant")).must_be_nil
1154
1204
  end
1155
1205
 
1156
- it 'can be retrieved with #some_variant' do
1157
- instance.some_variant.must_be_nil
1206
+ it "can be retrieved with #some_variant" do
1207
+ _(instance.some_variant).must_be_nil
1158
1208
  end
1159
1209
 
1160
- it 'can be set with #set_property' do
1161
- value = GLib::Variant.new_string('Foo')
1162
- instance.set_property 'some-variant', value
1163
- instance.get_property('some-variant').must_equal value
1210
+ it "can be set with #set_property" do
1211
+ value = GLib::Variant.new_string("Foo")
1212
+ instance.set_property "some-variant", value
1213
+ _(instance.get_property("some-variant")).must_equal value
1164
1214
  end
1165
1215
 
1166
- it 'can be set with #some_variant=' do
1167
- value = GLib::Variant.new_string('Foo')
1216
+ it "can be set with #some_variant=" do
1217
+ value = GLib::Variant.new_string("Foo")
1168
1218
  instance.some_variant = value
1169
- instance.some_variant.must_equal value
1219
+ _(instance.some_variant).must_equal value
1170
1220
  end
1171
1221
  end
1172
1222
  end
1173
1223
 
1174
- describe 'GIMarshallingTests::SecondEnum' do
1175
- it 'has the member :secondvalue1' do
1224
+ describe "GIMarshallingTests::SecondEnum" do
1225
+ it "has the member :secondvalue1" do
1176
1226
  assert_equal 0, GIMarshallingTests::SecondEnum[:secondvalue1]
1177
1227
  end
1178
- it 'has the member :secondvalue2' do
1228
+ it "has the member :secondvalue2" do
1179
1229
  assert_equal 1, GIMarshallingTests::SecondEnum[:secondvalue2]
1180
1230
  end
1181
1231
  end
1182
1232
 
1183
- describe 'GIMarshallingTests::SimpleStruct' do
1184
- it 'creates an instance using #new' do
1233
+ describe "GIMarshallingTests::SimpleStruct" do
1234
+ it "creates an instance using #new" do
1185
1235
  ss = GIMarshallingTests::SimpleStruct.new
1186
1236
  assert_instance_of GIMarshallingTests::SimpleStruct, ss
1187
1237
  end
1188
1238
 
1189
1239
  let(:instance) { GIMarshallingTests::SimpleStruct.new }
1190
1240
 
1191
- it 'has a writable field long_' do
1192
- instance.long_.must_equal 0
1241
+ it "has a writable field long_" do
1242
+ _(instance.long_).must_equal 0
1193
1243
  instance.long_ = 1056
1194
- instance.long_.must_equal 1056
1244
+ _(instance.long_).must_equal 1056
1195
1245
  end
1196
1246
 
1197
- it 'has a writable field int8' do
1198
- instance.int8.must_equal 0
1247
+ it "has a writable field int8" do
1248
+ _(instance.int8).must_equal 0
1199
1249
  instance.int8 = -43
1200
- instance.int8.must_equal(-43)
1250
+ _(instance.int8).must_equal(-43)
1201
1251
  end
1202
1252
 
1203
- it 'has a working method #inv' do
1253
+ it "has a working method #inv" do
1204
1254
  instance.long_ = 6
1205
1255
  instance.int8 = 7
1206
1256
  instance.inv
1207
1257
  pass
1208
1258
  end
1209
1259
 
1210
- it 'has a working method #method' do
1260
+ it "has a working method #method" do
1211
1261
  instance.long_ = 6
1212
1262
  instance.int8 = 7
1213
1263
  instance.method
1214
1264
  pass
1215
1265
  end
1216
1266
 
1217
- it 'has a working function #returnv' do
1267
+ it "has a working function #returnv" do
1218
1268
  ss = GIMarshallingTests::SimpleStruct.returnv
1219
1269
  assert_instance_of GIMarshallingTests::SimpleStruct, ss
1220
1270
  end
1221
1271
  end
1222
1272
 
1223
- describe 'GIMarshallingTests::SubObject' do
1224
- it 'creates an instance using #new' do
1273
+ describe "GIMarshallingTests::SubObject" do
1274
+ it "creates an instance using #new" do
1225
1275
  so = GIMarshallingTests::SubObject.new
1226
- so.must_be_instance_of GIMarshallingTests::SubObject
1227
- GObject.type_name_from_instance(so).
1228
- must_equal 'GIMarshallingTestsSubObject'
1276
+ _(so).must_be_instance_of GIMarshallingTests::SubObject
1277
+ _(GObject.type_name_from_instance(so))
1278
+ .must_equal "GIMarshallingTestsSubObject"
1229
1279
  end
1230
1280
 
1231
1281
  let(:instance) { GIMarshallingTests::SubObject.new }
1232
1282
 
1233
- it 'has a working method #overwritten_method' do
1283
+ it "has a working method #overwritten_method" do
1234
1284
  instance.overwritten_method
1235
1285
  pass
1236
1286
  end
1237
1287
 
1238
- it 'has a working method #sub_method' do
1288
+ it "has a working method #sub_method" do
1239
1289
  instance.sub_method
1240
1290
  pass
1241
1291
  end
1242
1292
 
1243
- it 'does not have accessors for its parent instance' do
1244
- instance.wont_respond_to :parent_instance
1245
- instance.wont_respond_to :parent_instance=
1293
+ it "does not have accessors for its parent instance" do
1294
+ _(instance).wont_respond_to :parent_instance
1295
+ _(instance).wont_respond_to :parent_instance=
1246
1296
  end
1247
1297
  end
1248
1298
 
1249
- describe 'GIMarshallingTests::SubSubObject' do
1250
- it 'creates an instance using #new' do
1299
+ describe "GIMarshallingTests::SubSubObject" do
1300
+ it "creates an instance using #new" do
1251
1301
  so = GIMarshallingTests::SubSubObject.new
1252
1302
  assert_instance_of GIMarshallingTests::SubSubObject, so
1253
- GObject.type_name_from_instance(so).
1254
- must_equal 'GIMarshallingTestsSubSubObject'
1303
+ _(GObject.type_name_from_instance(so))
1304
+ .must_equal "GIMarshallingTestsSubSubObject"
1255
1305
  end
1256
1306
 
1257
1307
  let(:instance) { GIMarshallingTests::SubSubObject.new }
1258
1308
 
1259
- it 'does not have accessors for its parent instance' do
1260
- instance.wont_respond_to :parent_instance
1261
- instance.wont_respond_to :parent_instance=
1309
+ it "does not have accessors for its parent instance" do
1310
+ _(instance).wont_respond_to :parent_instance
1311
+ _(instance).wont_respond_to :parent_instance=
1262
1312
  end
1263
1313
  end
1264
1314
 
1265
- describe 'GIMarshallingTests::Union' do
1266
- it 'creates an instance with #new' do
1315
+ describe "GIMarshallingTests::Union" do
1316
+ it "creates an instance with #new" do
1267
1317
  u = GIMarshallingTests::Union.new
1268
1318
  assert_instance_of GIMarshallingTests::Union, u
1269
1319
  end
1270
1320
 
1271
1321
  let(:instance) { GIMarshallingTests::Union.new }
1272
1322
 
1273
- it 'has a writable field long_' do
1323
+ it "has a writable field long_" do
1274
1324
  assert_equal 0, instance.long_
1275
1325
  instance.long_ = 1056
1276
1326
  assert_equal 1056, instance.long_
1277
1327
  end
1278
1328
 
1279
- it 'has a working method #inv' do
1329
+ it "has a working method #inv" do
1280
1330
  instance.long_ = 42
1281
1331
  instance.inv
1282
1332
  pass
1283
1333
  end
1284
1334
 
1285
- it 'has a working method #method' do
1335
+ it "has a working method #method" do
1286
1336
  instance.long_ = 42
1287
1337
  instance.method
1288
1338
  pass
1289
1339
  end
1290
1340
 
1291
- it 'has a working function #inout' do
1292
- skip 'This function is defined in the header but not implemented'
1341
+ it "has a working function #inout" do
1342
+ skip "This function is defined in the header but not implemented"
1293
1343
  end
1294
1344
 
1295
- it 'has a working function #out' do
1296
- skip 'This function is defined in the header but not implemented'
1345
+ it "has a working function #out" do
1346
+ skip "This function is defined in the header but not implemented"
1297
1347
  end
1298
1348
 
1299
- it 'has a working function #returnv' do
1349
+ it "has a working function #returnv" do
1300
1350
  u = GIMarshallingTests::Union.returnv
1301
1351
  assert_instance_of GIMarshallingTests::Union, u
1302
1352
  end
1303
1353
  end
1304
1354
 
1305
- it 'has a working function #array_enum_in' do
1355
+ it "has a working function #array_bool_in" do
1356
+ skip_below "1.51.1"
1357
+ GIMarshallingTests.array_bool_in [true, false, true, true]
1358
+ end
1359
+
1360
+ it "has a working function #array_bool_out" do
1361
+ skip_below "1.51.1"
1362
+ result = GIMarshallingTests.array_bool_out
1363
+ _(result.to_a).must_equal [true, false, true, true]
1364
+ end
1365
+
1366
+ it "has a working function #array_enum_in" do
1306
1367
  GIMarshallingTests.array_enum_in [:value1, :value2, :value3]
1307
1368
  end
1308
1369
 
1309
- it 'has a working function #array_fixed_inout' do
1370
+ it "has a working function #array_fixed_inout" do
1310
1371
  res = GIMarshallingTests.array_fixed_inout [-1, 0, 1, 2]
1311
- res.must_be :==, [2, 1, 0, -1]
1372
+ _(res).must_be :==, [2, 1, 0, -1]
1312
1373
  end
1313
1374
 
1314
- it 'has a working function #array_fixed_int_in' do
1375
+ it "has a working function #array_fixed_int_in" do
1315
1376
  GIMarshallingTests.array_fixed_int_in [-1, 0, 1, 2]
1316
1377
  pass
1317
1378
  end
1318
1379
 
1319
- it 'has a working function #array_fixed_int_return' do
1380
+ it "has a working function #array_fixed_int_return" do
1320
1381
  res = GIMarshallingTests.array_fixed_int_return
1321
- res.must_be :==, [-1, 0, 1, 2]
1382
+ _(res).must_be :==, [-1, 0, 1, 2]
1322
1383
  end
1323
1384
 
1324
- it 'has a working function #array_fixed_out' do
1385
+ it "has a working function #array_fixed_out" do
1325
1386
  res = GIMarshallingTests.array_fixed_out
1326
- res.must_be :==, [-1, 0, 1, 2]
1387
+ _(res).must_be :==, [-1, 0, 1, 2]
1327
1388
  end
1328
1389
 
1329
- it 'has a working function #array_fixed_out_struct' do
1390
+ it "has a working function #array_fixed_out_struct" do
1330
1391
  res = GIMarshallingTests.array_fixed_out_struct
1331
1392
  assert_equal [[7, 6], [6, 7]], res.map { |s| [s.long_, s.int8] }
1332
1393
  end
1333
1394
 
1334
- it 'has a working function #array_fixed_short_in' do
1395
+ it "has a working function #array_fixed_short_in" do
1335
1396
  GIMarshallingTests.array_fixed_short_in [-1, 0, 1, 2]
1336
1397
  pass
1337
1398
  end
1338
1399
 
1339
- it 'has a working function #array_fixed_short_return' do
1400
+ it "has a working function #array_fixed_short_return" do
1340
1401
  res = GIMarshallingTests.array_fixed_short_return
1341
- res.must_be :==, [-1, 0, 1, 2]
1402
+ _(res).must_be :==, [-1, 0, 1, 2]
1342
1403
  end
1343
1404
 
1344
- it 'has a working function #array_gvariant_container_in' do
1405
+ it "has a working function #array_gvariant_container_in" do
1345
1406
  v1 = GLib::Variant.new_int32(27)
1346
- v2 = GLib::Variant.new_string('Hello')
1407
+ v2 = GLib::Variant.new_string("Hello")
1347
1408
  result = GIMarshallingTests.array_gvariant_container_in [v1, v2]
1348
1409
  arr = result.to_a
1349
- arr.size.must_equal 2
1350
- arr[0].get_int32.must_equal 27
1351
- arr[1].get_string.must_equal 'Hello'
1410
+ _(arr.size).must_equal 2
1411
+ _(arr[0].get_int32).must_equal 27
1412
+ _(arr[1].get_string).must_equal "Hello"
1352
1413
  end
1353
1414
 
1354
- it 'has a working function #array_gvariant_full_in' do
1415
+ it "has a working function #array_gvariant_full_in" do
1355
1416
  v1 = GLib::Variant.new_int32(27)
1356
- v2 = GLib::Variant.new_string('Hello')
1417
+ v2 = GLib::Variant.new_string("Hello")
1357
1418
  result = GIMarshallingTests.array_gvariant_full_in [v1, v2]
1358
1419
  arr = result.to_a
1359
- arr.size.must_equal 2
1360
- arr[0].get_int32.must_equal 27
1361
- arr[1].get_string.must_equal 'Hello'
1420
+ _(arr.size).must_equal 2
1421
+ _(arr[0].get_int32).must_equal 27
1422
+ _(arr[1].get_string).must_equal "Hello"
1362
1423
  end
1363
1424
 
1364
- it 'has a working function #array_gvariant_none_in' do
1425
+ it "has a working function #array_gvariant_none_in" do
1365
1426
  v1 = GLib::Variant.new_int32(27)
1366
- v2 = GLib::Variant.new_string('Hello')
1427
+ v2 = GLib::Variant.new_string("Hello")
1367
1428
  result = GIMarshallingTests.array_gvariant_none_in [v1, v2]
1368
1429
  arr = result.to_a
1369
- arr.size.must_equal 2
1370
- arr[0].get_int32.must_equal 27
1371
- arr[1].get_string.must_equal 'Hello'
1430
+ _(arr.size).must_equal 2
1431
+ _(arr[0].get_int32).must_equal 27
1432
+ _(arr[1].get_string).must_equal "Hello"
1372
1433
  end
1373
1434
 
1374
- it 'has a working function #array_in' do
1435
+ it "has a working function #array_in" do
1375
1436
  GIMarshallingTests.array_in [-1, 0, 1, 2]
1376
1437
  pass
1377
1438
  end
1378
1439
 
1379
- it 'has a working function #array_in_guint64_len' do
1440
+ it "has a working function #array_in_guint64_len" do
1380
1441
  GIMarshallingTests.array_in_guint64_len [-1, 0, 1, 2]
1381
1442
  pass
1382
1443
  end
1383
1444
 
1384
- it 'has a working function #array_in_guint8_len' do
1445
+ it "has a working function #array_in_guint8_len" do
1385
1446
  GIMarshallingTests.array_in_guint8_len [-1, 0, 1, 2]
1386
1447
  pass
1387
1448
  end
1388
1449
 
1389
- it 'has a working function #array_in_len_before' do
1450
+ it "has a working function #array_in_len_before" do
1390
1451
  GIMarshallingTests.array_in_len_before [-1, 0, 1, 2]
1391
1452
  pass
1392
1453
  end
1393
1454
 
1394
- it 'has a working function #array_in_len_zero_terminated' do
1455
+ it "has a working function #array_in_len_zero_terminated" do
1395
1456
  GIMarshallingTests.array_in_len_zero_terminated [-1, 0, 1, 2]
1396
1457
  pass
1397
1458
  end
1398
1459
 
1399
- it 'has a working function #array_in_nonzero_nonlen' do
1400
- skip unless get_introspection_data 'GIMarshallingTests', 'array_in_nonzero_nonlen'
1401
- GIMarshallingTests.array_in_nonzero_nonlen 1, 'abcd'.bytes.to_a
1460
+ it "has a working function #array_in_nonzero_nonlen" do
1461
+ GIMarshallingTests.array_in_nonzero_nonlen 1, "abcd".bytes.to_a
1402
1462
  pass
1403
1463
  end
1404
1464
 
1405
- it 'has a working function #array_in_utf8_two_in' do
1406
- skip unless get_introspection_data 'GIMarshallingTests', 'array_in_utf8_two_in'
1407
- GIMarshallingTests.array_in_utf8_two_in [-1, 0, 1, 2], '1', '2'
1465
+ it "has a working function #array_in_utf8_two_in" do
1466
+ GIMarshallingTests.array_in_utf8_two_in [-1, 0, 1, 2], "1", "2"
1408
1467
  pass
1409
1468
  end
1410
1469
 
1411
- it 'has a working function #array_in_utf8_two_in_out_of_order' do
1412
- skip unless get_introspection_data 'GIMarshallingTests', 'array_in_utf8_two_in_out_of_order'
1413
- GIMarshallingTests.array_in_utf8_two_in_out_of_order '1', [-1, 0, 1, 2], '2'
1470
+ it "has a working function #array_in_utf8_two_in_out_of_order" do
1471
+ GIMarshallingTests.array_in_utf8_two_in_out_of_order "1", [-1, 0, 1, 2], "2"
1414
1472
  pass
1415
1473
  end
1416
1474
 
1417
- it 'has a working function #array_inout' do
1475
+ it "has a working function #array_inout" do
1418
1476
  res = GIMarshallingTests.array_inout [-1, 0, 1, 2]
1419
- res.must_be :==, [-2, -1, 0, 1, 2]
1477
+ _(res).must_be :==, [-2, -1, 0, 1, 2]
1420
1478
  end
1421
1479
 
1422
- it 'has a working function #array_inout_etc' do
1480
+ it "has a working function #array_inout_etc" do
1423
1481
  arr, sum = GIMarshallingTests.array_inout_etc 42, [-1, 0, 1, 2], 24
1424
- arr.must_be :==, [42, -1, 0, 1, 24]
1425
- sum.must_equal 42 + 24
1482
+ _(arr).must_be :==, [42, -1, 0, 1, 24]
1483
+ _(sum).must_equal 42 + 24
1484
+ end
1485
+
1486
+ it "has a working function #array_int64_in" do
1487
+ skip_below "1.51.1"
1488
+ GIMarshallingTests.array_int64_in [-1, 0, 1, 2]
1426
1489
  end
1427
1490
 
1428
- it 'has a working function #array_out' do
1491
+ it "has a working function #array_out" do
1429
1492
  res = GIMarshallingTests.array_out
1430
- res.must_be :==, [-1, 0, 1, 2]
1493
+ _(res).must_be :==, [-1, 0, 1, 2]
1431
1494
  end
1432
1495
 
1433
- it 'has a working function #array_out_etc' do
1496
+ it "has a working function #array_out_etc" do
1434
1497
  arr, sum = GIMarshallingTests.array_out_etc 42, 24
1435
- arr.must_be :==, [42, 0, 1, 24]
1436
- sum.must_equal 42 + 24
1498
+ _(arr).must_be :==, [42, 0, 1, 24]
1499
+ _(sum).must_equal 42 + 24
1437
1500
  end
1438
1501
 
1439
- it 'has a working function #array_return' do
1502
+ it "has a working function #array_return" do
1440
1503
  res = GIMarshallingTests.array_return
1441
- res.must_be :==, [-1, 0, 1, 2]
1504
+ _(res).must_be :==, [-1, 0, 1, 2]
1442
1505
  end
1443
1506
 
1444
- it 'has a working function #array_return_etc' do
1507
+ it "has a working function #array_return_etc" do
1445
1508
  arr, sum = GIMarshallingTests.array_return_etc 42, 24
1446
- arr.must_be :==, [42, 0, 1, 24]
1447
- sum.must_equal 42 + 24
1509
+ _(arr).must_be :==, [42, 0, 1, 24]
1510
+ _(sum).must_equal 42 + 24
1448
1511
  end
1449
1512
 
1450
- it 'has a working function #array_simple_struct_in' do
1513
+ it "has a working function #array_simple_struct_in" do
1451
1514
  arr = [1, 2, 3].map do |val|
1452
1515
  GIMarshallingTests::SimpleStruct.new.tap { |struct| struct.long_ = val }
1453
1516
  end
1454
1517
  GIMarshallingTests.array_simple_struct_in arr
1455
1518
  end
1456
1519
 
1457
- it 'has a working function #array_string_in' do
1520
+ it "has a working function #array_string_in" do
1458
1521
  GIMarshallingTests.array_string_in %w(foo bar)
1459
1522
  pass
1460
1523
  end
1461
1524
 
1462
- it 'has a working function #array_struct_in' do
1525
+ it "has a working function #array_struct_in" do
1463
1526
  arr = [1, 2, 3].map do |val|
1464
1527
  GIMarshallingTests::BoxedStruct.new.tap { |struct| struct.long_ = val }
1465
1528
  end
1466
1529
  GIMarshallingTests.array_struct_in arr
1467
1530
  end
1468
1531
 
1469
- it 'has a working function #array_struct_take_in' do
1532
+ it "has a working function #array_struct_take_in" do
1470
1533
  arr = [1, 2, 3].map do |val|
1471
1534
  GIMarshallingTests::BoxedStruct.new.tap { |struct| struct.long_ = val }
1472
1535
  end
1473
1536
  # NOTE: This copies values so arr's elements stay valid
1474
1537
  GIMarshallingTests.array_struct_take_in arr
1475
1538
 
1476
- arr.map(&:long_).must_equal [1, 2, 3]
1539
+ _(arr.map(&:long_)).must_equal [1, 2, 3]
1477
1540
  end
1478
1541
 
1479
- it 'has a working function #array_struct_value_in' do
1480
- skip unless get_introspection_data 'GIMarshallingTests', 'array_struct_value_in'
1542
+ it "has a working function #array_struct_value_in" do
1481
1543
  arr = [1, 2, 3].map do |val|
1482
1544
  GIMarshallingTests::BoxedStruct.new.tap { |struct| struct.long_ = val }
1483
1545
  end
1484
1546
  GIMarshallingTests.array_struct_value_in arr
1485
1547
  end
1486
1548
 
1487
- it 'has a working function #array_uint8_in' do
1488
- arr = 'abcd'.bytes.to_a
1549
+ it "has a working function #array_uint64_in" do
1550
+ skip_below "1.51.1"
1551
+ GIMarshallingTests.array_uint64_in [-1, 0, 1, 2]
1552
+ end
1553
+
1554
+ it "has a working function #array_uint8_in" do
1555
+ arr = "abcd".bytes.to_a
1489
1556
  GIMarshallingTests.array_uint8_in arr
1490
1557
  pass
1491
1558
  end
1492
1559
 
1493
- it 'has a working function #array_zero_terminated_in' do
1560
+ it "has a working function #array_unichar_in" do
1561
+ skip_below "1.51.1"
1562
+ arr = [0x63, 0x6f, 0x6e, 0x73, 0x74,
1563
+ 0x20, 0x2665, 0x20, 0x75, 0x74,
1564
+ 0x66, 0x38]
1565
+ GIMarshallingTests.array_unichar_in arr
1566
+ end
1567
+
1568
+ it "has a working function #array_unichar_out" do
1569
+ skip_below "1.51.1"
1570
+ result = GIMarshallingTests.array_unichar_out
1571
+ _(result.to_a).must_equal [0x63, 0x6f, 0x6e, 0x73, 0x74,
1572
+ 0x20, 0x2665, 0x20, 0x75, 0x74,
1573
+ 0x66, 0x38]
1574
+ end
1575
+
1576
+ it "has a working function #array_zero_terminated_in" do
1494
1577
  GIMarshallingTests.array_zero_terminated_in %w(0 1 2)
1495
1578
  pass
1496
1579
  end
1497
1580
 
1498
- it 'has a working function #array_zero_terminated_inout' do
1581
+ it "has a working function #array_zero_terminated_inout" do
1499
1582
  res = GIMarshallingTests.array_zero_terminated_inout %w(0 1 2)
1500
- res.must_be :==, ['-1', '0', '1', '2']
1583
+ _(res).must_be :==, ["-1", "0", "1", "2"]
1501
1584
  end
1502
1585
 
1503
- it 'has a working function #array_zero_terminated_out' do
1586
+ it "has a working function #array_zero_terminated_out" do
1504
1587
  res = GIMarshallingTests.array_zero_terminated_out
1505
- res.must_be :==, %w(0 1 2)
1588
+ _(res).must_be :==, %w(0 1 2)
1506
1589
  end
1507
1590
 
1508
- it 'has a working function #array_zero_terminated_return' do
1591
+ it "has a working function #array_zero_terminated_return" do
1509
1592
  res = GIMarshallingTests.array_zero_terminated_return
1510
- res.must_be :==, %w(0 1 2)
1593
+ _(res).must_be :==, %w(0 1 2)
1511
1594
  end
1512
1595
 
1513
- it 'has a working function #array_zero_terminated_return_null' do
1596
+ it "has a working function #array_zero_terminated_return_null" do
1514
1597
  res = GIMarshallingTests.array_zero_terminated_return_null
1515
- res.must_be :==, []
1598
+ _(res).must_be :==, []
1516
1599
  end
1517
1600
 
1518
- it 'has a working function #array_zero_terminated_return_struct' do
1601
+ it "has a working function #array_zero_terminated_return_struct" do
1519
1602
  res = GIMarshallingTests.array_zero_terminated_return_struct
1520
- res.to_a.map(&:long_).must_equal [42, 43, 44]
1603
+ _(res.to_a.map(&:long_)).must_equal [42, 43, 44]
1521
1604
  end
1522
1605
 
1523
- it 'has a working function #boolean_in_false' do
1606
+ it "has a working function #array_zero_terminated_return_unichar" do
1607
+ skip_below "1.51.1"
1608
+ res = GIMarshallingTests.array_zero_terminated_return_unichar
1609
+ _(res.to_a).must_equal [0x63, 0x6f, 0x6e, 0x73, 0x74,
1610
+ 0x20, 0x2665, 0x20, 0x75, 0x74,
1611
+ 0x66, 0x38]
1612
+ end
1613
+
1614
+ it "has a working function #boolean_in_false" do
1524
1615
  GIMarshallingTests.boolean_in_false false
1525
1616
  pass
1526
1617
  end
1527
1618
 
1528
- it 'has a working function #boolean_in_true' do
1619
+ it "has a working function #boolean_in_true" do
1529
1620
  GIMarshallingTests.boolean_in_true true
1530
1621
  pass
1531
1622
  end
1532
1623
 
1533
- it 'has a working function #boolean_inout_false_true' do
1624
+ it "has a working function #boolean_inout_false_true" do
1534
1625
  res = GIMarshallingTests.boolean_inout_false_true false
1535
- res.must_equal true
1626
+ _(res).must_equal true
1536
1627
  end
1537
1628
 
1538
- it 'has a working function #boolean_inout_true_false' do
1629
+ it "has a working function #boolean_inout_true_false" do
1539
1630
  res = GIMarshallingTests.boolean_inout_true_false true
1540
- res.must_equal false
1631
+ _(res).must_equal false
1541
1632
  end
1542
1633
 
1543
- it 'has a working function #boolean_out_false' do
1634
+ it "has a working function #boolean_out_false" do
1544
1635
  res = GIMarshallingTests.boolean_out_false
1545
- res.must_equal false
1636
+ _(res).must_equal false
1546
1637
  end
1547
1638
 
1548
- it 'has a working function #boolean_out_true' do
1639
+ it "has a working function #boolean_out_true" do
1549
1640
  res = GIMarshallingTests.boolean_out_true
1550
- res.must_equal true
1641
+ _(res).must_equal true
1551
1642
  end
1552
1643
 
1553
- it 'has a working function #boolean_return_false' do
1644
+ it "has a working function #boolean_return_false" do
1554
1645
  res = GIMarshallingTests.boolean_return_false
1555
- res.must_equal false
1646
+ _(res).must_equal false
1556
1647
  end
1557
1648
 
1558
- it 'has a working function #boolean_return_true' do
1649
+ it "has a working function #boolean_return_true" do
1559
1650
  res = GIMarshallingTests.boolean_return_true
1560
- res.must_equal true
1651
+ _(res).must_equal true
1561
1652
  end
1562
1653
 
1563
- it 'has a working function #boxed_struct_inout' do
1654
+ it "has a working function #boxed_struct_inout" do
1564
1655
  bx = GIMarshallingTests::BoxedStruct.new
1565
1656
  bx.long_ = 42
1566
1657
  res = GIMarshallingTests.boxed_struct_inout bx
1567
- res.long_.must_equal 0
1658
+ _(res.long_).must_equal 0
1568
1659
  end
1569
1660
 
1570
- it 'has a working function #boxed_struct_out' do
1661
+ it "has a working function #boxed_struct_out" do
1571
1662
  res = GIMarshallingTests.boxed_struct_out
1572
- res.long_.must_equal 42
1663
+ _(res.long_).must_equal 42
1573
1664
  end
1574
1665
 
1575
- it 'has a working function #boxed_struct_returnv' do
1666
+ it "has a working function #boxed_struct_returnv" do
1576
1667
  res = GIMarshallingTests.boxed_struct_returnv
1577
- res.long_.must_equal 42
1578
- res.g_strv.must_be :==, %w(0 1 2)
1668
+ _(res.long_).must_equal 42
1669
+ _(res.g_strv).must_be :==, %w(0 1 2)
1579
1670
  end
1580
1671
 
1581
- it 'has a working function #bytearray_full_return' do
1672
+ it "has a working function #bytearray_full_return" do
1582
1673
  ret = GIMarshallingTests.bytearray_full_return
1583
1674
  assert_instance_of GLib::ByteArray, ret
1584
1675
  assert_includes(
1585
- ['0123'.bytes.to_a, "\x001\xFF3".bytes.to_a],
1676
+ ["0123".bytes.to_a, "\x001\xFF3".bytes.to_a],
1586
1677
  ret.to_string.bytes.to_a)
1587
1678
  end
1588
1679
 
1589
- it 'has a working function #bytearray_none_in' do
1680
+ it "has a working function #bytearray_none_in" do
1590
1681
  val = GIMarshallingTests.bytearray_full_return.to_string
1591
1682
  ba = GLib::ByteArray.new
1592
1683
  ba = ba.append val
@@ -1594,647 +1685,684 @@ describe GIMarshallingTests do
1594
1685
  pass
1595
1686
  end
1596
1687
 
1597
- it 'has a working function #callback_multiple_out_parameters' do
1688
+ it "has a working function #callback_multiple_out_parameters" do
1598
1689
  result = GIMarshallingTests.callback_multiple_out_parameters do |*_args|
1599
1690
  [12.0, 13.0]
1600
1691
  end
1601
- result.must_equal [12.0, 13.0]
1692
+ _(result).must_equal [12.0, 13.0]
1602
1693
  end
1603
1694
 
1604
- it 'has a working function #callback_one_out_parameter' do
1695
+ it "has a working function #callback_one_out_parameter" do
1605
1696
  result = GIMarshallingTests.callback_one_out_parameter { 42.0 }
1606
- result.must_equal 42.0
1697
+ _(result).must_equal 42.0
1607
1698
  end
1608
1699
 
1609
- it 'has a working function #callback_owned_boxed' do
1610
- skip unless get_introspection_data 'GIMarshallingTests', 'callback_owned_boxed'
1700
+ it "has a working function #callback_owned_boxed" do
1611
1701
  a = nil
1612
1702
 
1613
1703
  callback = proc { |box, _callback_data| a = box.long_ * 2 }
1614
1704
 
1615
1705
  result = GIMarshallingTests.callback_owned_boxed(&callback)
1616
- result.must_equal 1
1617
- a.must_equal 2
1706
+ _(result).must_equal 1
1707
+ _(a).must_equal 2
1618
1708
 
1619
1709
  result = GIMarshallingTests.callback_owned_boxed(&callback)
1620
- result.must_equal 2
1621
- a.must_equal 4
1710
+ _(result).must_equal 2
1711
+ _(a).must_equal 4
1622
1712
  end
1623
1713
 
1624
- it 'has a working function #callback_return_value_and_multiple_out_parameters' do
1625
- result = GIMarshallingTests.callback_return_value_and_multiple_out_parameters do |*_args|
1626
- [42, -142, 3]
1627
- end
1628
- result.must_equal [42, -142, 3]
1714
+ it "has a working function #callback_return_value_and_multiple_out_parameters" do
1715
+ result =
1716
+ GIMarshallingTests.callback_return_value_and_multiple_out_parameters do |*_args|
1717
+ [42, -142, 3]
1718
+ end
1719
+ _(result).must_equal [42, -142, 3]
1629
1720
  end
1630
1721
 
1631
- it 'has a working function #callback_return_value_and_one_out_parameter' do
1722
+ it "has a working function #callback_return_value_and_one_out_parameter" do
1632
1723
  result = GIMarshallingTests.callback_return_value_and_one_out_parameter do |*_args|
1633
1724
  [42, -142]
1634
1725
  end
1635
- result.must_equal [42, -142]
1726
+ _(result).must_equal [42, -142]
1636
1727
  end
1637
1728
 
1638
- it 'has a working function #callback_return_value_only' do
1729
+ it "has a working function #callback_return_value_only" do
1639
1730
  result = GIMarshallingTests.callback_return_value_only { 42 }
1640
- result.must_equal 42
1731
+ _(result).must_equal 42
1641
1732
  end
1642
1733
 
1643
- it 'has a working function #double_in' do
1734
+ it "has a working function #double_in" do
1644
1735
  GIMarshallingTests.double_in Float::MAX
1645
1736
  pass
1646
1737
  end
1647
1738
 
1648
- it 'has a working function #double_inout' do
1739
+ it "has a working function #double_inout" do
1649
1740
  ret = GIMarshallingTests.double_inout Float::MAX
1650
1741
  assert_in_epsilon 2.225e-308, ret
1651
1742
  end
1652
1743
 
1653
- it 'has a working function #double_out' do
1744
+ it "has a working function #double_out" do
1654
1745
  ret = GIMarshallingTests.double_out
1655
- ret.must_equal Float::MAX
1746
+ _(ret).must_equal Float::MAX
1656
1747
  end
1657
1748
 
1658
- it 'has a working function #double_return' do
1749
+ it "has a working function #double_return" do
1659
1750
  ret = GIMarshallingTests.double_return
1660
- ret.must_equal Float::MAX
1751
+ _(ret).must_equal Float::MAX
1661
1752
  end
1662
1753
 
1663
- it 'has a working function #enum_in' do
1754
+ it "has a working function #enum_in" do
1664
1755
  GIMarshallingTests.enum_in :value3
1665
1756
  pass
1666
1757
  end
1667
1758
 
1668
- it 'has a working function #enum_inout' do
1759
+ it "has a working function #enum_inout" do
1669
1760
  e = GIMarshallingTests.enum_inout :value3
1670
- e.must_equal :value1
1761
+ _(e).must_equal :value1
1671
1762
  end
1672
1763
 
1673
- it 'has a working function #enum_out' do
1764
+ it "has a working function #enum_out" do
1674
1765
  e = GIMarshallingTests.enum_out
1675
- e.must_equal :value3
1766
+ _(e).must_equal :value3
1676
1767
  end
1677
1768
 
1678
- it 'has a working function #enum_returnv' do
1769
+ it "has a working function #enum_returnv" do
1679
1770
  e = GIMarshallingTests.enum_returnv
1680
- e.must_equal :value3
1771
+ _(e).must_equal :value3
1681
1772
  end
1682
1773
 
1683
- it 'has a working function #filename_list_return' do
1774
+ it "has a working function #filename_list_return" do
1684
1775
  fl = GIMarshallingTests.filename_list_return
1685
- fl.must_be_nil
1776
+ _(fl).must_be_nil
1686
1777
  end
1687
1778
 
1688
- it 'has a working function #flags_in' do
1779
+ it "has a working function #flags_in" do
1689
1780
  GIMarshallingTests.flags_in value2: true
1690
1781
  pass
1691
1782
  end
1692
1783
 
1693
- it 'has a working function #flags_in_zero' do
1784
+ it "has a working function #flags_in_zero" do
1694
1785
  GIMarshallingTests.flags_in_zero 0
1695
1786
  pass
1696
1787
  end
1697
1788
 
1698
- it 'has a working function #flags_inout' do
1789
+ it "has a working function #flags_inout" do
1699
1790
  res = GIMarshallingTests.flags_inout value2: true
1700
- res.must_equal(value1: true)
1791
+ _(res).must_equal(value1: true)
1701
1792
  end
1702
1793
 
1703
- it 'has a working function #flags_out' do
1794
+ it "has a working function #flags_out" do
1704
1795
  res = GIMarshallingTests.flags_out
1705
- res.must_equal(value2: true)
1796
+ _(res).must_equal(value2: true)
1706
1797
  end
1707
1798
 
1708
- it 'has a working function #flags_returnv' do
1799
+ it "has a working function #flags_returnv" do
1709
1800
  res = GIMarshallingTests.flags_returnv
1710
- res.must_equal(value2: true)
1801
+ _(res).must_equal(value2: true)
1711
1802
  end
1712
1803
 
1713
- it 'has a working function #float_in' do
1804
+ it "has a working function #float_in" do
1714
1805
  # float_return returns MAX_FLT
1715
1806
  flt = GIMarshallingTests.float_return
1716
1807
  GIMarshallingTests.float_in flt
1717
1808
  pass
1718
1809
  end
1719
1810
 
1720
- it 'has a working function #float_inout' do
1811
+ it "has a working function #float_inout" do
1721
1812
  # float_return returns MAX_FLT
1722
1813
  flt = GIMarshallingTests.float_return
1723
1814
  res = GIMarshallingTests.float_inout flt
1724
1815
  assert_in_epsilon 1.175e-38, res
1725
1816
  end
1726
1817
 
1727
- it 'has a working function #float_out' do
1818
+ it "has a working function #float_out" do
1728
1819
  flt = GIMarshallingTests.float_out
1729
1820
  assert_in_epsilon 3.402e+38, flt
1730
1821
  end
1731
1822
 
1732
- it 'has a working function #float_return' do
1823
+ it "has a working function #float_return" do
1733
1824
  flt = GIMarshallingTests.float_return
1734
1825
  assert_in_epsilon 3.402e+38, flt
1735
1826
  end
1736
1827
 
1737
- it 'has a working function #garray_int_none_in' do
1828
+ it "has a working function #garray_bool_none_in" do
1829
+ skip_below "1.51.1"
1830
+ GIMarshallingTests.garray_bool_none_in [true, false, true, true]
1831
+ end
1832
+
1833
+ it "has a working function #garray_boxed_struct_full_return" do
1834
+ skip_below "1.61.1"
1835
+ result = GIMarshallingTests.garray_boxed_struct_full_return
1836
+ _(result.map(&:long_)).must_equal [42, 43, 44]
1837
+ end
1838
+
1839
+ it "has a working function #garray_int_none_in" do
1738
1840
  arr = [-1, 0, 1, 2]
1739
1841
  GIMarshallingTests.garray_int_none_in arr
1740
1842
  pass
1741
1843
  end
1742
1844
 
1743
- it 'has a working function #garray_int_none_return' do
1845
+ it "has a working function #garray_int_none_return" do
1744
1846
  arr = GIMarshallingTests.garray_int_none_return
1745
- arr.must_be :==, [-1, 0, 1, 2]
1847
+ _(arr).must_be :==, [-1, 0, 1, 2]
1746
1848
  end
1747
1849
 
1748
- it 'has a working function #garray_uint64_none_in' do
1749
- skip unless get_introspection_data 'GIMarshallingTests', 'garray_uint64_none_in'
1850
+ it "has a working function #garray_uint64_none_in" do
1750
1851
  GIMarshallingTests.garray_uint64_none_in [0, 0xffff_ffff_ffff_ffff]
1751
1852
  pass
1752
1853
  end
1753
1854
 
1754
- it 'has a working function #garray_uint64_none_return' do
1755
- skip unless get_introspection_data 'GIMarshallingTests', 'garray_uint64_none_return'
1855
+ it "has a working function #garray_uint64_none_return" do
1756
1856
  res = GIMarshallingTests.garray_uint64_none_return
1757
- res.must_be :==, [0, 0xffff_ffff_ffff_ffff]
1857
+ _(res).must_be :==, [0, 0xffff_ffff_ffff_ffff]
1858
+ end
1859
+
1860
+ it "has a working function #garray_unichar_none_in" do
1861
+ skip_below "1.51.1"
1862
+ arr = [0x63, 0x6f, 0x6e, 0x73, 0x74,
1863
+ 0x20, 0x2665, 0x20, 0x75, 0x74,
1864
+ 0x66, 0x38]
1865
+ GIMarshallingTests.garray_unichar_none_in arr
1758
1866
  end
1759
1867
 
1760
- it 'has a working function #garray_utf8_container_inout' do
1868
+ it "has a working function #garray_utf8_container_inout" do
1761
1869
  res = GIMarshallingTests.garray_utf8_container_inout %w(0 1 2)
1762
- res.must_be :==, ['-2', '-1', '0', '1']
1870
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
1763
1871
  end
1764
1872
 
1765
- it 'has a working function #garray_utf8_container_out' do
1873
+ it "has a working function #garray_utf8_container_out" do
1766
1874
  res = GIMarshallingTests.garray_utf8_container_out
1767
- res.must_be :==, %w(0 1 2)
1875
+ _(res).must_be :==, %w(0 1 2)
1768
1876
  end
1769
1877
 
1770
- it 'has a working function #garray_utf8_container_return' do
1878
+ it "has a working function #garray_utf8_container_return" do
1771
1879
  res = GIMarshallingTests.garray_utf8_container_return
1772
- res.must_be :==, %w(0 1 2)
1880
+ _(res).must_be :==, %w(0 1 2)
1773
1881
  end
1774
1882
 
1775
- it 'has a working function #garray_utf8_full_inout' do
1883
+ it "has a working function #garray_utf8_full_inout" do
1776
1884
  arr = %w(0 1 2)
1777
1885
  res = GIMarshallingTests.garray_utf8_full_inout arr
1778
- res.must_be :==, ['-2', '-1', '0', '1']
1886
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
1779
1887
  end
1780
1888
 
1781
- it 'has a working function #garray_utf8_full_out' do
1889
+ it "has a working function #garray_utf8_full_out" do
1782
1890
  res = GIMarshallingTests.garray_utf8_full_out
1783
- res.must_be :==, %w(0 1 2)
1891
+ _(res).must_be :==, %w(0 1 2)
1784
1892
  end
1785
1893
 
1786
- it 'has a working function #garray_utf8_full_out_caller_allocated' do
1787
- skip unless get_introspection_data 'GIMarshallingTests',
1788
- 'garray_utf8_full_out_caller_allocated'
1894
+ it "has a working function #garray_utf8_full_out_caller_allocated" do
1789
1895
  res = GIMarshallingTests.garray_utf8_full_out_caller_allocated
1790
- res.must_be :==, %w(0 1 2)
1896
+ _(res).must_be :==, %w(0 1 2)
1791
1897
  end
1792
1898
 
1793
- it 'has a working function #garray_utf8_full_return' do
1899
+ it "has a working function #garray_utf8_full_return" do
1794
1900
  res = GIMarshallingTests.garray_utf8_full_return
1795
- res.must_be :==, %w(0 1 2)
1901
+ _(res).must_be :==, %w(0 1 2)
1796
1902
  end
1797
1903
 
1798
- it 'has a working function #garray_utf8_none_in' do
1904
+ it "has a working function #garray_utf8_none_in" do
1799
1905
  arr = %w(0 1 2)
1800
1906
  GIMarshallingTests.garray_utf8_none_in arr
1801
1907
  pass
1802
1908
  end
1803
1909
 
1804
- it 'has a working function #garray_utf8_none_inout' do
1910
+ it "has a working function #garray_utf8_none_inout" do
1805
1911
  arr = %w(0 1 2)
1806
1912
  res = GIMarshallingTests.garray_utf8_none_inout arr
1807
- res.must_be :==, ['-2', '-1', '0', '1']
1913
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
1808
1914
  end
1809
1915
 
1810
- it 'has a working function #garray_utf8_none_out' do
1916
+ it "has a working function #garray_utf8_none_out" do
1811
1917
  res = GIMarshallingTests.garray_utf8_none_out
1812
- res.must_be :==, %w(0 1 2)
1918
+ _(res).must_be :==, %w(0 1 2)
1813
1919
  end
1814
1920
 
1815
- it 'has a working function #garray_utf8_none_return' do
1921
+ it "has a working function #garray_utf8_none_return" do
1816
1922
  res = GIMarshallingTests.garray_utf8_none_return
1817
- res.must_be :==, %w(0 1 2)
1923
+ _(res).must_be :==, %w(0 1 2)
1818
1924
  end
1819
1925
 
1820
- it 'has a working function #gbytes_full_return' do
1821
- skip unless get_introspection_data 'GIMarshallingTests', 'gbytes_full_return'
1926
+ it "has a working function #gbytes_full_return" do
1822
1927
  res = GIMarshallingTests.gbytes_full_return
1823
- res.to_a.must_equal [0, 49, 0xFF, 51]
1928
+ _(res.to_a).must_equal [0, 49, 0xFF, 51]
1824
1929
  end
1825
1930
 
1826
- it 'has a working function #gbytes_none_in' do
1827
- skip unless get_introspection_data 'GIMarshallingTests', 'gbytes_none_in'
1931
+ it "has a working function #gbytes_none_in" do
1828
1932
  GIMarshallingTests.gbytes_none_in [0, 49, 0xFF, 51]
1829
1933
  pass
1830
1934
  end
1831
1935
 
1832
- it 'has a working function #gclosure_in' do
1936
+ it "has a working function #gclosure_in" do
1833
1937
  cl = GObject::RubyClosure.new { 42 }
1834
1938
  GIMarshallingTests.gclosure_in cl
1835
1939
  pass
1836
1940
  end
1837
1941
 
1838
- it 'has a working function #gclosure_return' do
1942
+ it "has a working function #gclosure_return" do
1839
1943
  cl = GIMarshallingTests.gclosure_return
1840
1944
  gv = GObject::Value.wrap_ruby_value 0
1841
1945
  result = cl.invoke gv, []
1842
- gv.get_value.must_equal 42
1843
- result.must_equal 42
1946
+ _(gv.get_value).must_equal 42
1947
+ _(result).must_equal 42
1844
1948
  end
1845
1949
 
1846
- it 'has a working function #genum_in' do
1950
+ it "has a working function #genum_in" do
1847
1951
  GIMarshallingTests.genum_in :value3
1848
1952
  pass
1849
1953
  end
1850
1954
 
1851
- it 'has a working function #genum_inout' do
1955
+ it "has a working function #genum_inout" do
1852
1956
  res = GIMarshallingTests.genum_inout :value3
1853
- res.must_equal :value1
1957
+ _(res).must_equal :value1
1854
1958
  end
1855
1959
 
1856
- it 'has a working function #genum_out' do
1960
+ it "has a working function #genum_out" do
1857
1961
  res = GIMarshallingTests.genum_out
1858
- res.must_equal :value3
1962
+ _(res).must_equal :value3
1859
1963
  end
1860
1964
 
1861
- it 'has a working function #genum_returnv' do
1965
+ it "has a working function #genum_returnv" do
1862
1966
  res = GIMarshallingTests.genum_returnv
1863
- res.must_equal :value3
1967
+ _(res).must_equal :value3
1864
1968
  end
1865
1969
 
1866
- it 'has a working function #gerror' do
1867
- begin
1868
- GIMarshallingTests.gerror
1869
- flunk 'Error should have been raised'
1870
- rescue GirFFI::GLibError => e
1871
- e.message.must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1872
- e.domain.must_equal GIMarshallingTests::CONSTANT_GERROR_DOMAIN
1873
- e.code.must_equal GIMarshallingTests::CONSTANT_GERROR_CODE
1874
- end
1970
+ it "has a working function #gerror" do
1971
+ GIMarshallingTests.gerror
1972
+ flunk "Error should have been raised"
1973
+ rescue GirFFI::GLibError => e
1974
+ _(e.message).must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1975
+ _(e.domain).must_equal GIMarshallingTests::CONSTANT_GERROR_DOMAIN
1976
+ _(e.code).must_equal GIMarshallingTests::CONSTANT_GERROR_CODE
1875
1977
  end
1876
1978
 
1877
- it 'has a working function #gerror_array_in' do
1878
- begin
1879
- GIMarshallingTests.gerror_array_in [1, 2, 3]
1880
- flunk 'Error should have been raised'
1881
- rescue GirFFI::GLibError => e
1882
- e.message.must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1883
- e.domain.must_equal GIMarshallingTests::CONSTANT_GERROR_DOMAIN
1884
- e.code.must_equal GIMarshallingTests::CONSTANT_GERROR_CODE
1885
- end
1979
+ it "has a working function #gerror_array_in" do
1980
+ GIMarshallingTests.gerror_array_in [1, 2, 3]
1981
+ flunk "Error should have been raised"
1982
+ rescue GirFFI::GLibError => e
1983
+ _(e.message).must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1984
+ _(e.domain).must_equal GIMarshallingTests::CONSTANT_GERROR_DOMAIN
1985
+ _(e.code).must_equal GIMarshallingTests::CONSTANT_GERROR_CODE
1886
1986
  end
1887
1987
 
1888
- it 'has a working function #gerror_out' do
1988
+ it "has a working function #gerror_out" do
1889
1989
  error, debug = GIMarshallingTests.gerror_out
1890
- debug.must_equal GIMarshallingTests::CONSTANT_GERROR_DEBUG_MESSAGE
1891
- error.message.must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1990
+ _(debug).must_equal GIMarshallingTests::CONSTANT_GERROR_DEBUG_MESSAGE
1991
+ _(error.message).must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1892
1992
  end
1893
1993
 
1894
- it 'has a working function #gerror_out_transfer_none' do
1994
+ it "has a working function #gerror_out_transfer_none" do
1895
1995
  error, debug = GIMarshallingTests.gerror_out_transfer_none
1896
- debug.must_equal GIMarshallingTests::CONSTANT_GERROR_DEBUG_MESSAGE
1897
- error.message.must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1996
+ _(debug).must_equal GIMarshallingTests::CONSTANT_GERROR_DEBUG_MESSAGE
1997
+ _(error.message).must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
1898
1998
  end
1899
1999
 
1900
- it 'has a working function #gerror_return' do
2000
+ it "has a working function #gerror_return" do
1901
2001
  error = GIMarshallingTests.gerror_return
1902
- error.message.must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
2002
+ _(error.message).must_equal GIMarshallingTests::CONSTANT_GERROR_MESSAGE
2003
+ end
2004
+
2005
+ it "has a working function #ghashtable_double_in" do
2006
+ skip_below "1.51.2"
2007
+ GIMarshallingTests.ghashtable_double_in(
2008
+ "-1" => -0.1, "0" => 0.0, "1" => 0.1, "2" => 0.2)
1903
2009
  end
1904
2010
 
1905
- it 'has a working function #ghashtable_int_none_in' do
2011
+ it "has a working function #ghashtable_float_in" do
2012
+ skip_below "1.51.2"
2013
+ GIMarshallingTests.ghashtable_float_in(
2014
+ "-1" => -0.1, "0" => 0.0, "1" => 0.1, "2" => 0.2)
2015
+ end
2016
+
2017
+ it "has a working function #ghashtable_int64_in" do
2018
+ skip_below "1.51.2"
2019
+ GIMarshallingTests.ghashtable_int64_in(
2020
+ "-1" => -1, "0" => 0, "1" => 1, "2" => 0x100000000)
2021
+ end
2022
+
2023
+ it "has a working function #ghashtable_int_none_in" do
1906
2024
  GIMarshallingTests.ghashtable_int_none_in(
1907
2025
  -1 => 1, 0 => 0, 1 => -1, 2 => -2)
1908
2026
  end
1909
2027
 
1910
- it 'has a working function #ghashtable_int_none_return' do
2028
+ it "has a working function #ghashtable_int_none_return" do
1911
2029
  gh = GIMarshallingTests.ghashtable_int_none_return
1912
2030
  assert_equal({ -1 => 1, 0 => 0, 1 => -1, 2 => -2 }, gh.to_hash)
1913
2031
  end
1914
2032
 
1915
- it 'has a working function #ghashtable_utf8_container_in' do
1916
- skip 'This function is defined in the header but not implemented'
2033
+ it "has a working function #ghashtable_uint64_in" do
2034
+ skip_below "1.51.2"
2035
+ GIMarshallingTests.ghashtable_uint64_in(
2036
+ "-1" => 0x100000000, "0" => 0, "1" => 1, "2" => 2)
2037
+ end
2038
+
2039
+ it "has a working function #ghashtable_utf8_container_in" do
2040
+ skip "This function is defined in the header but not implemented"
1917
2041
  end
1918
2042
 
1919
- it 'has a working function #ghashtable_utf8_container_inout' do
1920
- hsh = { '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' }
2043
+ it "has a working function #ghashtable_utf8_container_inout" do
2044
+ hsh = { "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" }
1921
2045
  res = GIMarshallingTests.ghashtable_utf8_container_inout hsh
1922
- assert_equal({ '-1' => '1', '0' => '0', '1' => '1' }, res.to_hash)
2046
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "1" }, res.to_hash)
1923
2047
  end
1924
2048
 
1925
- it 'has a working function #ghashtable_utf8_container_out' do
2049
+ it "has a working function #ghashtable_utf8_container_out" do
1926
2050
  res = GIMarshallingTests.ghashtable_utf8_container_out
1927
- assert_equal({ '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' },
2051
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" },
1928
2052
  res.to_hash)
1929
2053
  end
1930
2054
 
1931
- it 'has a working function #ghashtable_utf8_container_return' do
2055
+ it "has a working function #ghashtable_utf8_container_return" do
1932
2056
  res = GIMarshallingTests.ghashtable_utf8_container_return
1933
- assert_equal({ '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' },
2057
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" },
1934
2058
  res.to_hash)
1935
2059
  end
1936
2060
 
1937
- it 'has a working function #ghashtable_utf8_full_in' do
1938
- skip 'This function is defined in the header but not implemented'
2061
+ it "has a working function #ghashtable_utf8_full_in" do
2062
+ skip "This function is defined in the header but not implemented"
1939
2063
  end
1940
2064
 
1941
- it 'has a working function #ghashtable_utf8_full_inout' do
1942
- hsh = { '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' }
2065
+ it "has a working function #ghashtable_utf8_full_inout" do
2066
+ hsh = { "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" }
1943
2067
  res = GIMarshallingTests.ghashtable_utf8_full_inout hsh
1944
- assert_equal({ '-1' => '1', '0' => '0', '1' => '1' }, res.to_hash)
2068
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "1" }, res.to_hash)
1945
2069
  end
1946
2070
 
1947
- it 'has a working function #ghashtable_utf8_full_out' do
2071
+ it "has a working function #ghashtable_utf8_full_out" do
1948
2072
  res = GIMarshallingTests.ghashtable_utf8_full_out
1949
- assert_equal({ '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' },
2073
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" },
1950
2074
  res.to_hash)
1951
2075
  end
1952
2076
 
1953
- it 'has a working function #ghashtable_utf8_full_return' do
2077
+ it "has a working function #ghashtable_utf8_full_return" do
1954
2078
  res = GIMarshallingTests.ghashtable_utf8_full_return
1955
- assert_equal({ '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' },
2079
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" },
1956
2080
  res.to_hash)
1957
2081
  end
1958
2082
 
1959
- it 'has a working function #ghashtable_utf8_none_in' do
1960
- hsh = { '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' }
2083
+ it "has a working function #ghashtable_utf8_none_in" do
2084
+ hsh = { "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" }
1961
2085
  GIMarshallingTests.ghashtable_utf8_none_in hsh
1962
2086
  pass
1963
2087
  end
1964
2088
 
1965
- it 'has a working function #ghashtable_utf8_none_inout' do
1966
- hsh = { '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' }
2089
+ it "has a working function #ghashtable_utf8_none_inout" do
2090
+ hsh = { "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" }
1967
2091
  res = GIMarshallingTests.ghashtable_utf8_none_inout hsh
1968
- assert_equal({ '-1' => '1', '0' => '0', '1' => '1' }, res.to_hash)
2092
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "1" }, res.to_hash)
1969
2093
  end
1970
2094
 
1971
- it 'has a working function #ghashtable_utf8_none_out' do
2095
+ it "has a working function #ghashtable_utf8_none_out" do
1972
2096
  res = GIMarshallingTests.ghashtable_utf8_none_out
1973
- assert_equal({ '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' },
2097
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" },
1974
2098
  res.to_hash)
1975
2099
  end
1976
2100
 
1977
- it 'has a working function #ghashtable_utf8_none_return' do
2101
+ it "has a working function #ghashtable_utf8_none_return" do
1978
2102
  res = GIMarshallingTests.ghashtable_utf8_none_return
1979
- assert_equal({ '-1' => '1', '0' => '0', '1' => '-1', '2' => '-2' },
2103
+ assert_equal({ "-1" => "1", "0" => "0", "1" => "-1", "2" => "-2" },
1980
2104
  res.to_hash)
1981
2105
  end
1982
2106
 
1983
- it 'has a working function #glist_int_none_in' do
2107
+ it "has a working function #glist_int_none_in" do
1984
2108
  GIMarshallingTests.glist_int_none_in [-1, 0, 1, 2]
1985
2109
  pass
1986
2110
  end
1987
2111
 
1988
- it 'has a working function #glist_int_none_return' do
2112
+ it "has a working function #glist_int_none_return" do
1989
2113
  res = GIMarshallingTests.glist_int_none_return
1990
- res.must_be :==, [-1, 0, 1, 2]
2114
+ _(res).must_be :==, [-1, 0, 1, 2]
1991
2115
  end
1992
2116
 
1993
- it 'has a working function #glist_uint32_none_in' do
1994
- skip unless get_introspection_data 'GIMarshallingTests', 'glist_uint32_none_in'
2117
+ it "has a working function #glist_uint32_none_in" do
1995
2118
  GIMarshallingTests.glist_uint32_none_in [0, 0xffff_ffff]
1996
2119
  pass
1997
2120
  end
1998
2121
 
1999
- it 'has a working function #glist_uint32_none_return' do
2000
- skip unless get_introspection_data 'GIMarshallingTests', 'glist_uint32_none_return'
2122
+ it "has a working function #glist_uint32_none_return" do
2001
2123
  res = GIMarshallingTests.glist_uint32_none_return
2002
- res.must_be :==, [0, 0xffff_ffff]
2124
+ _(res).must_be :==, [0, 0xffff_ffff]
2003
2125
  end
2004
2126
 
2005
- it 'has a working function #glist_utf8_container_inout' do
2127
+ it "has a working function #glist_utf8_container_inout" do
2006
2128
  res = GIMarshallingTests.glist_utf8_container_inout %w(0 1 2)
2007
- res.must_be :==, ['-2', '-1', '0', '1']
2129
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2008
2130
  end
2009
2131
 
2010
- it 'has a working function #glist_utf8_container_out' do
2132
+ it "has a working function #glist_utf8_container_out" do
2011
2133
  res = GIMarshallingTests.glist_utf8_container_out
2012
- res.must_be :==, %w(0 1 2)
2134
+ _(res).must_be :==, %w(0 1 2)
2013
2135
  end
2014
2136
 
2015
- it 'has a working function #glist_utf8_container_return' do
2137
+ it "has a working function #glist_utf8_container_return" do
2016
2138
  res = GIMarshallingTests.glist_utf8_container_return
2017
- res.must_be :==, %w(0 1 2)
2139
+ _(res).must_be :==, %w(0 1 2)
2018
2140
  end
2019
2141
 
2020
- it 'has a working function #glist_utf8_full_inout' do
2142
+ it "has a working function #glist_utf8_full_inout" do
2021
2143
  res = GIMarshallingTests.glist_utf8_full_inout %w(0 1 2)
2022
- res.must_be :==, ['-2', '-1', '0', '1']
2144
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2023
2145
  end
2024
2146
 
2025
- it 'has a working function #glist_utf8_full_out' do
2147
+ it "has a working function #glist_utf8_full_out" do
2026
2148
  res = GIMarshallingTests.glist_utf8_full_out
2027
- res.must_be :==, %w(0 1 2)
2149
+ _(res).must_be :==, %w(0 1 2)
2028
2150
  end
2029
2151
 
2030
- it 'has a working function #glist_utf8_full_return' do
2152
+ it "has a working function #glist_utf8_full_return" do
2031
2153
  res = GIMarshallingTests.glist_utf8_full_return
2032
- res.must_be :==, %w(0 1 2)
2154
+ _(res).must_be :==, %w(0 1 2)
2033
2155
  end
2034
2156
 
2035
- it 'has a working function #glist_utf8_none_in' do
2157
+ it "has a working function #glist_utf8_none_in" do
2036
2158
  GIMarshallingTests.glist_utf8_none_in %w(0 1 2)
2037
2159
  end
2038
2160
 
2039
- it 'has a working function #glist_utf8_none_inout' do
2161
+ it "has a working function #glist_utf8_none_inout" do
2040
2162
  res = GIMarshallingTests.glist_utf8_none_inout %w(0 1 2)
2041
- res.must_be :==, ['-2', '-1', '0', '1']
2163
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2042
2164
  end
2043
2165
 
2044
- it 'has a working function #glist_utf8_none_out' do
2166
+ it "has a working function #glist_utf8_none_out" do
2045
2167
  res = GIMarshallingTests.glist_utf8_none_out
2046
- res.must_be :==, %w(0 1 2)
2168
+ _(res).must_be :==, %w(0 1 2)
2047
2169
  end
2048
2170
 
2049
- it 'has a working function #glist_utf8_none_return' do
2171
+ it "has a working function #glist_utf8_none_return" do
2050
2172
  res = GIMarshallingTests.glist_utf8_none_return
2051
- res.must_be :==, %w(0 1 2)
2173
+ _(res).must_be :==, %w(0 1 2)
2052
2174
  end
2053
2175
 
2054
- it 'has a working function #gptrarray_utf8_container_inout' do
2176
+ it "has a working function #gptrarray_boxed_struct_full_return" do
2177
+ skip_below "1.61.1"
2178
+ result = GIMarshallingTests.gptrarray_boxed_struct_full_return
2179
+ _(result.map(&:long_)).must_equal [42, 43, 44]
2180
+ end
2181
+
2182
+ it "has a working function #gptrarray_utf8_container_inout" do
2055
2183
  res = GIMarshallingTests.gptrarray_utf8_container_inout %w(0 1 2)
2056
- res.must_be :==, ['-2', '-1', '0', '1']
2184
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2057
2185
  end
2058
2186
 
2059
- it 'has a working function #gptrarray_utf8_container_out' do
2187
+ it "has a working function #gptrarray_utf8_container_out" do
2060
2188
  res = GIMarshallingTests.gptrarray_utf8_container_out
2061
- res.must_be :==, %w(0 1 2)
2189
+ _(res).must_be :==, %w(0 1 2)
2062
2190
  end
2063
2191
 
2064
- it 'has a working function #gptrarray_utf8_container_return' do
2192
+ it "has a working function #gptrarray_utf8_container_return" do
2065
2193
  res = GIMarshallingTests.gptrarray_utf8_container_return
2066
- res.must_be :==, %w(0 1 2)
2194
+ _(res).must_be :==, %w(0 1 2)
2067
2195
  end
2068
2196
 
2069
- it 'has a working function #gptrarray_utf8_full_inout' do
2197
+ it "has a working function #gptrarray_utf8_full_inout" do
2070
2198
  res = GIMarshallingTests.gptrarray_utf8_full_inout %w(0 1 2)
2071
- res.must_be :==, ['-2', '-1', '0', '1']
2199
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2072
2200
  end
2073
2201
 
2074
- it 'has a working function #gptrarray_utf8_full_out' do
2202
+ it "has a working function #gptrarray_utf8_full_out" do
2075
2203
  res = GIMarshallingTests.gptrarray_utf8_full_out
2076
- res.must_be :==, %w(0 1 2)
2204
+ _(res).must_be :==, %w(0 1 2)
2077
2205
  end
2078
2206
 
2079
- it 'has a working function #gptrarray_utf8_full_return' do
2207
+ it "has a working function #gptrarray_utf8_full_return" do
2080
2208
  res = GIMarshallingTests.gptrarray_utf8_full_return
2081
- res.must_be :==, %w(0 1 2)
2209
+ _(res).must_be :==, %w(0 1 2)
2082
2210
  end
2083
2211
 
2084
- it 'has a working function #gptrarray_utf8_none_in' do
2212
+ it "has a working function #gptrarray_utf8_none_in" do
2085
2213
  GIMarshallingTests.gptrarray_utf8_none_in %w(0 1 2)
2086
2214
  end
2087
2215
 
2088
- it 'has a working function #gptrarray_utf8_none_inout' do
2216
+ it "has a working function #gptrarray_utf8_none_inout" do
2089
2217
  res = GIMarshallingTests.gptrarray_utf8_none_inout %w(0 1 2)
2090
- res.must_be :==, ['-2', '-1', '0', '1']
2218
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2091
2219
  end
2092
2220
 
2093
- it 'has a working function #gptrarray_utf8_none_out' do
2221
+ it "has a working function #gptrarray_utf8_none_out" do
2094
2222
  res = GIMarshallingTests.gptrarray_utf8_none_out
2095
- res.must_be :==, %w(0 1 2)
2223
+ _(res).must_be :==, %w(0 1 2)
2096
2224
  end
2097
2225
 
2098
- it 'has a working function #gptrarray_utf8_none_return' do
2226
+ it "has a working function #gptrarray_utf8_none_return" do
2099
2227
  res = GIMarshallingTests.gptrarray_utf8_none_return
2100
- res.must_be :==, %w(0 1 2)
2228
+ _(res).must_be :==, %w(0 1 2)
2101
2229
  end
2102
2230
 
2103
- it 'has a working function #gslist_int_none_in' do
2231
+ it "has a working function #gslist_int_none_in" do
2104
2232
  GIMarshallingTests.gslist_int_none_in [-1, 0, 1, 2]
2105
2233
  pass
2106
2234
  end
2107
2235
 
2108
- it 'has a working function #gslist_int_none_return' do
2236
+ it "has a working function #gslist_int_none_return" do
2109
2237
  res = GIMarshallingTests.gslist_int_none_return
2110
- res.must_be :==, [-1, 0, 1, 2]
2238
+ _(res).must_be :==, [-1, 0, 1, 2]
2111
2239
  end
2112
2240
 
2113
- it 'has a working function #gslist_utf8_container_inout' do
2241
+ it "has a working function #gslist_utf8_container_inout" do
2114
2242
  res = GIMarshallingTests.gslist_utf8_container_inout %w(0 1 2)
2115
- res.must_be :==, ['-2', '-1', '0', '1']
2243
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2116
2244
  end
2117
2245
 
2118
- it 'has a working function #gslist_utf8_container_out' do
2246
+ it "has a working function #gslist_utf8_container_out" do
2119
2247
  res = GIMarshallingTests.gslist_utf8_container_out
2120
- res.must_be :==, %w(0 1 2)
2248
+ _(res).must_be :==, %w(0 1 2)
2121
2249
  end
2122
2250
 
2123
- it 'has a working function #gslist_utf8_container_return' do
2251
+ it "has a working function #gslist_utf8_container_return" do
2124
2252
  res = GIMarshallingTests.gslist_utf8_container_return
2125
- res.must_be :==, %w(0 1 2)
2253
+ _(res).must_be :==, %w(0 1 2)
2126
2254
  end
2127
2255
 
2128
- it 'has a working function #gslist_utf8_full_inout' do
2256
+ it "has a working function #gslist_utf8_full_inout" do
2129
2257
  res = GIMarshallingTests.gslist_utf8_full_inout %w(0 1 2)
2130
- res.must_be :==, ['-2', '-1', '0', '1']
2258
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2131
2259
  end
2132
2260
 
2133
- it 'has a working function #gslist_utf8_full_out' do
2261
+ it "has a working function #gslist_utf8_full_out" do
2134
2262
  res = GIMarshallingTests.gslist_utf8_full_out
2135
- res.must_be :==, %w(0 1 2)
2263
+ _(res).must_be :==, %w(0 1 2)
2136
2264
  end
2137
2265
 
2138
- it 'has a working function #gslist_utf8_full_return' do
2266
+ it "has a working function #gslist_utf8_full_return" do
2139
2267
  res = GIMarshallingTests.gslist_utf8_full_return
2140
- res.must_be :==, %w(0 1 2)
2268
+ _(res).must_be :==, %w(0 1 2)
2141
2269
  end
2142
2270
 
2143
- it 'has a working function #gslist_utf8_none_in' do
2271
+ it "has a working function #gslist_utf8_none_in" do
2144
2272
  GIMarshallingTests.gslist_utf8_none_in %w(0 1 2)
2145
2273
  pass
2146
2274
  end
2147
2275
 
2148
- it 'has a working function #gslist_utf8_none_inout' do
2276
+ it "has a working function #gslist_utf8_none_inout" do
2149
2277
  res = GIMarshallingTests.gslist_utf8_none_inout %w(0 1 2)
2150
- res.must_be :==, ['-2', '-1', '0', '1']
2278
+ _(res).must_be :==, ["-2", "-1", "0", "1"]
2151
2279
  end
2152
2280
 
2153
- it 'has a working function #gslist_utf8_none_out' do
2281
+ it "has a working function #gslist_utf8_none_out" do
2154
2282
  res = GIMarshallingTests.gslist_utf8_none_out
2155
- res.must_be :==, %w(0 1 2)
2283
+ _(res).must_be :==, %w(0 1 2)
2156
2284
  end
2157
2285
 
2158
- it 'has a working function #gslist_utf8_none_return' do
2286
+ it "has a working function #gslist_utf8_none_return" do
2159
2287
  res = GIMarshallingTests.gslist_utf8_none_return
2160
- res.must_be :==, %w(0 1 2)
2288
+ _(res).must_be :==, %w(0 1 2)
2161
2289
  end
2162
2290
 
2163
- it 'has a working function #gstrv_in' do
2291
+ it "has a working function #gstrv_in" do
2164
2292
  GIMarshallingTests.gstrv_in %w(0 1 2)
2165
2293
  pass
2166
2294
  end
2167
2295
 
2168
- it 'has a working function #gstrv_inout' do
2296
+ it "has a working function #gstrv_inout" do
2169
2297
  res = GIMarshallingTests.gstrv_inout %w(0 1 2)
2170
- res.must_be :==, ['-1', '0', '1', '2']
2298
+ _(res).must_be :==, ["-1", "0", "1", "2"]
2171
2299
  end
2172
2300
 
2173
- it 'has a working function #gstrv_out' do
2301
+ it "has a working function #gstrv_out" do
2174
2302
  res = GIMarshallingTests.gstrv_out
2175
- res.must_be :==, %w(0 1 2)
2303
+ _(res).must_be :==, %w(0 1 2)
2176
2304
  end
2177
2305
 
2178
- it 'has a working function #gstrv_return' do
2306
+ it "has a working function #gstrv_return" do
2179
2307
  res = GIMarshallingTests.gstrv_return
2180
- res.must_be :==, %w(0 1 2)
2308
+ _(res).must_be :==, %w(0 1 2)
2181
2309
  end
2182
2310
 
2183
- it 'has a working function #gtype_in' do
2311
+ it "has a working function #gtype_in" do
2184
2312
  GIMarshallingTests.gtype_in GObject::TYPE_NONE
2185
2313
  pass
2186
2314
  end
2187
2315
 
2188
- it 'has a working function #gtype_inout' do
2316
+ it "has a working function #gtype_inout" do
2189
2317
  res = GIMarshallingTests.gtype_inout GObject::TYPE_NONE
2190
- res.must_equal GObject::TYPE_INT
2318
+ _(res).must_equal GObject::TYPE_INT
2191
2319
  end
2192
2320
 
2193
- it 'has a working function #gtype_out' do
2321
+ it "has a working function #gtype_out" do
2194
2322
  res = GIMarshallingTests.gtype_out
2195
- res.must_equal GObject::TYPE_NONE
2323
+ _(res).must_equal GObject::TYPE_NONE
2196
2324
  end
2197
2325
 
2198
- it 'has a working function #gtype_return' do
2326
+ it "has a working function #gtype_return" do
2199
2327
  res = GIMarshallingTests.gtype_return
2200
- res.must_equal GObject::TYPE_NONE
2328
+ _(res).must_equal GObject::TYPE_NONE
2201
2329
  end
2202
2330
 
2203
- it 'has a working function #gtype_string_in' do
2331
+ it "has a working function #gtype_string_in" do
2204
2332
  GIMarshallingTests.gtype_string_in GObject::TYPE_STRING
2205
2333
  pass
2206
2334
  end
2207
2335
 
2208
- it 'has a working function #gtype_string_out' do
2336
+ it "has a working function #gtype_string_out" do
2209
2337
  res = GIMarshallingTests.gtype_string_out
2210
- res.must_equal GObject::TYPE_STRING
2338
+ _(res).must_equal GObject::TYPE_STRING
2211
2339
  end
2212
2340
 
2213
- it 'has a working function #gtype_string_return' do
2341
+ it "has a working function #gtype_string_return" do
2214
2342
  res = GIMarshallingTests.gtype_string_return
2215
- res.must_equal GObject::TYPE_STRING
2343
+ _(res).must_equal GObject::TYPE_STRING
2216
2344
  end
2217
2345
 
2218
- it 'has a working function #gvalue_flat_array' do
2219
- GIMarshallingTests.gvalue_flat_array [42, '42', true]
2346
+ it "has a working function #gvalue_flat_array" do
2347
+ GIMarshallingTests.gvalue_flat_array [42, "42", true]
2220
2348
  pass
2221
2349
  end
2222
2350
 
2223
- it 'has a working function #gvalue_flat_array_round_trip' do
2224
- result = GIMarshallingTests.gvalue_flat_array_round_trip 42, '42', true
2351
+ it "has a working function #gvalue_flat_array_round_trip" do
2352
+ result = GIMarshallingTests.gvalue_flat_array_round_trip 42, "42", true
2225
2353
  arr = result.to_a
2226
- arr[0].get_value.must_equal 42
2227
- arr[1].get_value.must_equal '42'
2228
- arr[2].get_value.must_equal true
2354
+ _(arr[0].get_value).must_equal 42
2355
+ _(arr[1].get_value).must_equal "42"
2356
+ _(arr[2].get_value).must_equal true
2229
2357
  end
2230
2358
 
2231
- it 'has a working function #gvalue_in' do
2359
+ it "has a working function #gvalue_in" do
2232
2360
  GIMarshallingTests.gvalue_in GObject::Value.wrap_ruby_value(42)
2233
2361
  GIMarshallingTests.gvalue_in 42
2234
2362
  pass
2235
2363
  end
2236
2364
 
2237
- it 'has a working function #gvalue_in_enum' do
2365
+ it "has a working function #gvalue_in_enum" do
2238
2366
  gv = GObject::Value.new
2239
2367
  gv.init GIMarshallingTests::GEnum.gtype
2240
2368
  gv.set_enum GIMarshallingTests::GEnum[:value3]
@@ -2242,29 +2370,27 @@ describe GIMarshallingTests do
2242
2370
  pass
2243
2371
  end
2244
2372
 
2245
- it 'has a working function #gvalue_in_with_modification' do
2246
- skip unless get_introspection_data 'GIMarshallingTests', 'gvalue_in_with_modification'
2373
+ it "has a working function #gvalue_in_with_modification" do
2247
2374
  gv = GObject::Value.wrap_ruby_value(42)
2248
2375
  GIMarshallingTests.gvalue_in_with_modification gv
2249
- gv.get_value.must_equal 24
2376
+ _(gv.get_value).must_equal 24
2250
2377
  end
2251
2378
 
2252
- it 'has a working function #gvalue_in_with_type' do
2379
+ it "has a working function #gvalue_in_with_type" do
2253
2380
  gv = GObject::Value.new
2254
2381
  gv.init GIMarshallingTests::SubSubObject.gtype
2255
2382
  GIMarshallingTests.gvalue_in_with_type gv, GIMarshallingTests::Object.gtype
2256
2383
  end
2257
2384
 
2258
- it 'has a working function #gvalue_inout' do
2385
+ it "has a working function #gvalue_inout" do
2259
2386
  res = GIMarshallingTests.gvalue_inout GObject::Value.wrap_ruby_value(42)
2260
- res.must_equal '42'
2387
+ _(res).must_equal "42"
2261
2388
 
2262
2389
  res = GIMarshallingTests.gvalue_inout 42
2263
- res.must_equal '42'
2390
+ _(res).must_equal "42"
2264
2391
  end
2265
2392
 
2266
- it 'has a working function #gvalue_int64_in' do
2267
- skip unless get_introspection_data 'GIMarshallingTests', 'gvalue_int64_in'
2393
+ it "has a working function #gvalue_int64_in" do
2268
2394
  gv = GObject::Value.new
2269
2395
  gv.init GObject::TYPE_INT64
2270
2396
  gv.set_value 0x7fff_ffff_ffff_ffff
@@ -2272,724 +2398,712 @@ describe GIMarshallingTests do
2272
2398
  pass
2273
2399
  end
2274
2400
 
2275
- it 'has a working function #gvalue_int64_out' do
2276
- skip unless get_introspection_data 'GIMarshallingTests', 'gvalue_int64_out'
2401
+ it "has a working function #gvalue_int64_out" do
2277
2402
  gv = GIMarshallingTests.gvalue_int64_out
2278
- gv.must_equal 0x7fff_ffff_ffff_ffff
2403
+ _(gv).must_equal 0x7fff_ffff_ffff_ffff
2279
2404
  end
2280
2405
 
2281
- it 'has a working function #gvalue_out' do
2406
+ it "has a working function #gvalue_out" do
2282
2407
  res = GIMarshallingTests.gvalue_out
2283
- res.must_equal 42
2408
+ _(res).must_equal 42
2284
2409
  end
2285
2410
 
2286
- it 'has a working function #gvalue_out_caller_allocates' do
2287
- skip unless get_introspection_data 'GIMarshallingTests', 'gvalue_out_caller_allocates'
2411
+ it "has a working function #gvalue_out_caller_allocates" do
2288
2412
  res = GIMarshallingTests.gvalue_out_caller_allocates
2289
- res.must_equal 42
2413
+ _(res).must_equal 42
2290
2414
  end
2291
2415
 
2292
- it 'has a working function #gvalue_return' do
2416
+ it "has a working function #gvalue_return" do
2293
2417
  res = GIMarshallingTests.gvalue_return
2294
- res.must_equal 42
2418
+ _(res).must_equal 42
2295
2419
  end
2296
2420
 
2297
- it 'has a working function #init_function' do
2421
+ it "has a working function #init_function" do
2298
2422
  res, arr = GIMarshallingTests.init_function %w(foo bar baz)
2299
- res.must_equal true
2300
- arr.must_be :==, %w(foo bar)
2423
+ _(res).must_equal true
2424
+ _(arr).must_be :==, %w(foo bar)
2301
2425
  end
2302
2426
 
2303
- it 'has a working function #int16_in_max' do
2427
+ it "has a working function #int16_in_max" do
2304
2428
  GIMarshallingTests.int16_in_max 0x7fff
2305
2429
  pass
2306
2430
  end
2307
2431
 
2308
- it 'has a working function #int16_in_min' do
2432
+ it "has a working function #int16_in_min" do
2309
2433
  GIMarshallingTests.int16_in_min(-0x8000)
2310
2434
  pass
2311
2435
  end
2312
2436
 
2313
- it 'has a working function #int16_inout_max_min' do
2437
+ it "has a working function #int16_inout_max_min" do
2314
2438
  res = GIMarshallingTests.int16_inout_max_min 0x7fff
2315
2439
  assert_equal res, -0x8000
2316
2440
  end
2317
2441
 
2318
- it 'has a working function #int16_inout_min_max' do
2442
+ it "has a working function #int16_inout_min_max" do
2319
2443
  res = GIMarshallingTests.int16_inout_min_max(-0x8000)
2320
2444
  assert_equal 0x7fff, res
2321
2445
  end
2322
2446
 
2323
- it 'has a working function #int16_out_max' do
2447
+ it "has a working function #int16_out_max" do
2324
2448
  res = GIMarshallingTests.int16_out_max
2325
2449
  assert_equal 0x7fff, res
2326
2450
  end
2327
2451
 
2328
- it 'has a working function #int16_out_min' do
2452
+ it "has a working function #int16_out_min" do
2329
2453
  res = GIMarshallingTests.int16_out_min
2330
2454
  assert_equal(-0x8000, res)
2331
2455
  end
2332
2456
 
2333
- it 'has a working function #int16_return_max' do
2457
+ it "has a working function #int16_return_max" do
2334
2458
  res = GIMarshallingTests.int16_return_max
2335
2459
  assert_equal 0x7fff, res
2336
2460
  end
2337
2461
 
2338
- it 'has a working function #int16_return_min' do
2462
+ it "has a working function #int16_return_min" do
2339
2463
  res = GIMarshallingTests.int16_return_min
2340
2464
  assert_equal(-0x8000, res)
2341
2465
  end
2342
2466
 
2343
- it 'has a working function #int32_in_max' do
2467
+ it "has a working function #int32_in_max" do
2344
2468
  GIMarshallingTests.int32_in_max 0x7fffffff
2345
2469
  pass
2346
2470
  end
2347
2471
 
2348
- it 'has a working function #int32_in_min' do
2472
+ it "has a working function #int32_in_min" do
2349
2473
  GIMarshallingTests.int32_in_min(-0x80000000)
2350
2474
  pass
2351
2475
  end
2352
2476
 
2353
- it 'has a working function #int32_inout_max_min' do
2477
+ it "has a working function #int32_inout_max_min" do
2354
2478
  res = GIMarshallingTests.int32_inout_max_min 0x7fffffff
2355
2479
  assert_equal(-0x80000000, res)
2356
2480
  end
2357
2481
 
2358
- it 'has a working function #int32_inout_min_max' do
2482
+ it "has a working function #int32_inout_min_max" do
2359
2483
  res = GIMarshallingTests.int32_inout_min_max(-0x80000000)
2360
2484
  assert_equal 0x7fffffff, res
2361
2485
  end
2362
2486
 
2363
- it 'has a working function #int32_out_max' do
2487
+ it "has a working function #int32_out_max" do
2364
2488
  res = GIMarshallingTests.int32_out_max
2365
2489
  assert_equal 0x7fffffff, res
2366
2490
  end
2367
2491
 
2368
- it 'has a working function #int32_out_min' do
2492
+ it "has a working function #int32_out_min" do
2369
2493
  res = GIMarshallingTests.int32_out_min
2370
2494
  assert_equal(-0x80000000, res)
2371
2495
  end
2372
2496
 
2373
- it 'has a working function #int32_return_max' do
2497
+ it "has a working function #int32_return_max" do
2374
2498
  res = GIMarshallingTests.int32_return_max
2375
2499
  assert_equal 0x7fffffff, res
2376
2500
  end
2377
2501
 
2378
- it 'has a working function #int32_return_min' do
2502
+ it "has a working function #int32_return_min" do
2379
2503
  res = GIMarshallingTests.int32_return_min
2380
2504
  assert_equal(-0x80000000, res)
2381
2505
  end
2382
2506
 
2383
- it 'has a working function #int64_in_max' do
2507
+ it "has a working function #int64_in_max" do
2384
2508
  GIMarshallingTests.int64_in_max 0x7fffffffffffffff
2385
2509
  pass
2386
2510
  end
2387
2511
 
2388
- it 'has a working function #int64_in_min' do
2512
+ it "has a working function #int64_in_min" do
2389
2513
  GIMarshallingTests.int64_in_min(-0x8000000000000000)
2390
2514
  pass
2391
2515
  end
2392
2516
 
2393
- it 'has a working function #int64_inout_max_min' do
2517
+ it "has a working function #int64_inout_max_min" do
2394
2518
  res = GIMarshallingTests.int64_inout_max_min 0x7fffffffffffffff
2395
2519
  assert_equal(-0x8000000000000000, res)
2396
2520
  end
2397
2521
 
2398
- it 'has a working function #int64_inout_min_max' do
2522
+ it "has a working function #int64_inout_min_max" do
2399
2523
  res = GIMarshallingTests.int64_inout_min_max(-0x8000000000000000)
2400
2524
  assert_equal 0x7fffffffffffffff, res
2401
2525
  end
2402
2526
 
2403
- it 'has a working function #int64_out_max' do
2527
+ it "has a working function #int64_out_max" do
2404
2528
  res = GIMarshallingTests.int64_out_max
2405
2529
  assert_equal 0x7fffffffffffffff, res
2406
2530
  end
2407
2531
 
2408
- it 'has a working function #int64_out_min' do
2532
+ it "has a working function #int64_out_min" do
2409
2533
  res = GIMarshallingTests.int64_out_min
2410
2534
  assert_equal(-0x8000000000000000, res)
2411
2535
  end
2412
2536
 
2413
- it 'has a working function #int64_return_max' do
2537
+ it "has a working function #int64_return_max" do
2414
2538
  res = GIMarshallingTests.int64_return_max
2415
2539
  assert_equal 0x7fffffffffffffff, res
2416
2540
  end
2417
2541
 
2418
- it 'has a working function #int64_return_min' do
2542
+ it "has a working function #int64_return_min" do
2419
2543
  res = GIMarshallingTests.int64_return_min
2420
2544
  assert_equal(-0x8000000000000000, res)
2421
2545
  end
2422
2546
 
2423
- it 'has a working function #int8_in_max' do
2547
+ it "has a working function #int8_in_max" do
2424
2548
  GIMarshallingTests.int8_in_max 0x7f
2425
2549
  pass
2426
2550
  end
2427
2551
 
2428
- it 'has a working function #int8_in_min' do
2552
+ it "has a working function #int8_in_min" do
2429
2553
  GIMarshallingTests.int8_in_min(-0x80)
2430
2554
  pass
2431
2555
  end
2432
2556
 
2433
- it 'has a working function #int8_inout_max_min' do
2557
+ it "has a working function #int8_inout_max_min" do
2434
2558
  res = GIMarshallingTests.int8_inout_max_min 0x7f
2435
2559
  assert_equal(-0x80, res)
2436
2560
  end
2437
2561
 
2438
- it 'has a working function #int8_inout_min_max' do
2562
+ it "has a working function #int8_inout_min_max" do
2439
2563
  res = GIMarshallingTests.int8_inout_min_max(-0x80)
2440
2564
  assert_equal 0x7f, res
2441
2565
  end
2442
2566
 
2443
- it 'has a working function #int8_out_max' do
2567
+ it "has a working function #int8_out_max" do
2444
2568
  res = GIMarshallingTests.int8_out_max
2445
2569
  assert_equal 0x7f, res
2446
2570
  end
2447
2571
 
2448
- it 'has a working function #int8_out_min' do
2572
+ it "has a working function #int8_out_min" do
2449
2573
  res = GIMarshallingTests.int8_out_min
2450
2574
  assert_equal(-0x80, res)
2451
2575
  end
2452
2576
 
2453
- it 'has a working function #int8_return_max' do
2577
+ it "has a working function #int8_return_max" do
2454
2578
  res = GIMarshallingTests.int8_return_max
2455
2579
  assert_equal 0x7f, res
2456
2580
  end
2457
2581
 
2458
- it 'has a working function #int8_return_min' do
2582
+ it "has a working function #int8_return_min" do
2459
2583
  res = GIMarshallingTests.int8_return_min
2460
2584
  assert_equal(-0x80, res)
2461
2585
  end
2462
2586
 
2463
- it 'has a working function #int_in_max' do
2587
+ it "has a working function #int_in_max" do
2464
2588
  GIMarshallingTests.int_in_max 0x7fffffff
2465
2589
  pass
2466
2590
  end
2467
2591
 
2468
- it 'has a working function #int_in_min' do
2592
+ it "has a working function #int_in_min" do
2469
2593
  GIMarshallingTests.int_in_min(-0x80000000)
2470
2594
  pass
2471
2595
  end
2472
2596
 
2473
- it 'has a working function #int_inout_max_min' do
2597
+ it "has a working function #int_inout_max_min" do
2474
2598
  res = GIMarshallingTests.int_inout_max_min 0x7fffffff
2475
2599
  assert_equal(-0x80000000, res)
2476
2600
  end
2477
2601
 
2478
- it 'has a working function #int_inout_min_max' do
2602
+ it "has a working function #int_inout_min_max" do
2479
2603
  res = GIMarshallingTests.int_inout_min_max(-0x80000000)
2480
2604
  assert_equal 0x7fffffff, res
2481
2605
  end
2482
2606
 
2483
- it 'has a working function #int_one_in_utf8_two_in_one_allows_none' do
2484
- skip unless get_introspection_data('GIMarshallingTests',
2485
- 'int_one_in_utf8_two_in_one_allows_none')
2486
- GIMarshallingTests.int_one_in_utf8_two_in_one_allows_none 1, '2', '3'
2487
- GIMarshallingTests.int_one_in_utf8_two_in_one_allows_none 1, nil, '3'
2607
+ it "has a working function #int_one_in_utf8_two_in_one_allows_none" do
2608
+ GIMarshallingTests.int_one_in_utf8_two_in_one_allows_none 1, "2", "3"
2609
+ GIMarshallingTests.int_one_in_utf8_two_in_one_allows_none 1, nil, "3"
2488
2610
  pass
2489
2611
  end
2490
2612
 
2491
- it 'has a working function #int_out_max' do
2613
+ it "has a working function #int_out_max" do
2492
2614
  res = GIMarshallingTests.int_out_max
2493
2615
  assert_equal 0x7fffffff, res
2494
2616
  end
2495
2617
 
2496
- it 'has a working function #int_out_min' do
2618
+ it "has a working function #int_out_min" do
2497
2619
  res = GIMarshallingTests.int_out_min
2498
2620
  assert_equal(-0x80000000, res)
2499
2621
  end
2500
2622
 
2501
- it 'has a working function #int_out_out' do
2623
+ it "has a working function #int_out_out" do
2502
2624
  res = GIMarshallingTests.int_out_out
2503
2625
  assert_equal [6, 7], res
2504
2626
  end
2505
2627
 
2506
- it 'has a working function #int_return_max' do
2628
+ it "has a working function #int_return_max" do
2507
2629
  res = GIMarshallingTests.int_return_max
2508
2630
  assert_equal 0x7fffffff, res
2509
2631
  end
2510
2632
 
2511
- it 'has a working function #int_return_min' do
2633
+ it "has a working function #int_return_min" do
2512
2634
  res = GIMarshallingTests.int_return_min
2513
2635
  assert_equal(-0x80000000, res)
2514
2636
  end
2515
2637
 
2516
- it 'has a working function #int_return_out' do
2638
+ it "has a working function #int_return_out" do
2517
2639
  res = GIMarshallingTests.int_return_out
2518
2640
  assert_equal [6, 7], res
2519
2641
  end
2520
2642
 
2521
- it 'has a working function #int_three_in_three_out' do
2643
+ it "has a working function #int_three_in_three_out" do
2522
2644
  res = GIMarshallingTests.int_three_in_three_out 4, 5, 6
2523
2645
  assert_equal [4, 5, 6], res
2524
2646
  end
2525
2647
 
2526
- it 'has a working function #int_two_in_utf8_two_in_with_allow_none' do
2527
- skip unless get_introspection_data('GIMarshallingTests',
2528
- 'int_two_in_utf8_two_in_with_allow_none')
2529
- GIMarshallingTests.int_two_in_utf8_two_in_with_allow_none 1, 2, '3', '4'
2648
+ it "has a working function #int_two_in_utf8_two_in_with_allow_none" do
2649
+ GIMarshallingTests.int_two_in_utf8_two_in_with_allow_none 1, 2, "3", "4"
2530
2650
  GIMarshallingTests.int_two_in_utf8_two_in_with_allow_none 1, 2, nil, nil
2531
2651
  pass
2532
2652
  end
2533
2653
 
2534
- it 'has a working function #long_in_max' do
2654
+ it "has a working function #long_in_max" do
2535
2655
  GIMarshallingTests.long_in_max max_long
2536
2656
  pass
2537
2657
  end
2538
2658
 
2539
- it 'has a working function #long_in_min' do
2659
+ it "has a working function #long_in_min" do
2540
2660
  GIMarshallingTests.long_in_min min_long
2541
2661
  pass
2542
2662
  end
2543
2663
 
2544
- it 'has a working function #long_inout_max_min' do
2664
+ it "has a working function #long_inout_max_min" do
2545
2665
  res = GIMarshallingTests.long_inout_max_min max_long
2546
2666
  assert_equal min_long, res
2547
2667
  end
2548
2668
 
2549
- it 'has a working function #long_inout_min_max' do
2669
+ it "has a working function #long_inout_min_max" do
2550
2670
  res = GIMarshallingTests.long_inout_min_max min_long
2551
2671
  assert_equal max_long, res
2552
2672
  end
2553
2673
 
2554
- it 'has a working function #long_out_max' do
2674
+ it "has a working function #long_out_max" do
2555
2675
  res = GIMarshallingTests.long_out_max
2556
2676
  assert_equal max_long, res
2557
2677
  end
2558
2678
 
2559
- it 'has a working function #long_out_min' do
2679
+ it "has a working function #long_out_min" do
2560
2680
  res = GIMarshallingTests.long_out_min
2561
2681
  assert_equal min_long, res
2562
2682
  end
2563
2683
 
2564
- it 'has a working function #long_return_max' do
2684
+ it "has a working function #long_return_max" do
2565
2685
  res = GIMarshallingTests.long_return_max
2566
2686
  assert_equal max_long, res
2567
2687
  end
2568
2688
 
2569
- it 'has a working function #long_return_min' do
2689
+ it "has a working function #long_return_min" do
2570
2690
  res = GIMarshallingTests.long_return_min
2571
2691
  assert_equal min_long, res
2572
2692
  end
2573
2693
 
2574
- it 'has a working function #multi_array_key_value_in' do
2694
+ it "has a working function #multi_array_key_value_in" do
2575
2695
  keys = %w(one two three)
2576
2696
  values = [1, 2, 3].map { |val| GObject::Value.wrap_ruby_value val }
2577
2697
  GIMarshallingTests.multi_array_key_value_in keys, values
2578
2698
  end
2579
2699
 
2580
- it 'has a working function #no_type_flags_in' do
2700
+ it "has a working function #no_type_flags_in" do
2581
2701
  GIMarshallingTests.no_type_flags_in value2: true
2582
2702
  pass
2583
2703
  end
2584
2704
 
2585
- it 'has a working function #no_type_flags_in_zero' do
2705
+ it "has a working function #no_type_flags_in_zero" do
2586
2706
  GIMarshallingTests.no_type_flags_in_zero 0
2587
2707
  pass
2588
2708
  end
2589
2709
 
2590
- it 'has a working function #no_type_flags_inout' do
2710
+ it "has a working function #no_type_flags_inout" do
2591
2711
  res = GIMarshallingTests.no_type_flags_inout value2: true
2592
- res.must_equal(value1: true)
2712
+ _(res).must_equal(value1: true)
2593
2713
  end
2594
2714
 
2595
- it 'has a working function #no_type_flags_out' do
2715
+ it "has a working function #no_type_flags_out" do
2596
2716
  res = GIMarshallingTests.no_type_flags_out
2597
- res.must_equal(value2: true)
2717
+ _(res).must_equal(value2: true)
2598
2718
  end
2599
2719
 
2600
- it 'has a working function #no_type_flags_returnv' do
2720
+ it "has a working function #no_type_flags_returnv" do
2601
2721
  res = GIMarshallingTests.no_type_flags_returnv
2602
- res.must_equal(value2: true)
2722
+ _(res).must_equal(value2: true)
2603
2723
  end
2604
2724
 
2605
- it 'has a working function #overrides_struct_returnv' do
2725
+ it "has a working function #overrides_struct_returnv" do
2606
2726
  res = GIMarshallingTests.overrides_struct_returnv
2607
- res.must_be_instance_of GIMarshallingTests::OverridesStruct
2727
+ _(res).must_be_instance_of GIMarshallingTests::OverridesStruct
2608
2728
  end
2609
2729
 
2610
- it 'has a working function #param_spec_in_bool' do
2611
- # GLib minor version and GObjectIntrospection minor version should be in sync
2612
- skip 'param_spec_in_bool tests the wrong type' if GLib::MINOR_VERSION < 42
2613
-
2614
- ps = GObject.param_spec_boolean 'mybool', 'nick', 'blurb', true, :readable
2730
+ it "has a working function #param_spec_in_bool" do
2731
+ ps = GObject.param_spec_boolean "mybool", "nick", "blurb", true, :readable
2615
2732
  GIMarshallingTests.param_spec_in_bool ps
2616
2733
  pass
2617
2734
  end
2618
2735
 
2619
- it 'has a working function #param_spec_out' do
2620
- skip unless get_introspection_data 'GIMarshallingTests', 'param_spec_out'
2736
+ it "has a working function #param_spec_out" do
2621
2737
  res = GIMarshallingTests.param_spec_out
2622
- res.value_type.must_equal GObject::TYPE_STRING
2623
- res.get_name.must_equal 'test-param'
2738
+ _(res.value_type).must_equal GObject::TYPE_STRING
2739
+ _(res.get_name).must_equal "test-param"
2624
2740
  end
2625
2741
 
2626
- it 'has a working function #param_spec_return' do
2627
- skip unless get_introspection_data 'GIMarshallingTests', 'param_spec_return'
2742
+ it "has a working function #param_spec_return" do
2628
2743
  res = GIMarshallingTests.param_spec_return
2629
- res.value_type.must_equal GObject::TYPE_STRING
2630
- res.get_name.must_equal 'test-param'
2744
+ _(res.value_type).must_equal GObject::TYPE_STRING
2745
+ _(res.get_name).must_equal "test-param"
2631
2746
  end
2632
2747
 
2633
- it 'has a working function #pointer_in_return' do
2748
+ it "has a working function #pointer_in_return" do
2634
2749
  ptr = FFI::MemoryPointer.new 1
2635
2750
  res = GIMarshallingTests.pointer_in_return ptr
2636
2751
  assert_equal ptr.address, res.address
2637
2752
  end
2638
2753
 
2639
- it 'has a working function #pointer_struct_get_type' do
2754
+ it "has a working function #pointer_struct_get_type" do
2640
2755
  res = GIMarshallingTests.pointer_struct_get_type
2641
- gtype = GObject.type_from_name 'GIMarshallingTestsPointerStruct'
2756
+ gtype = GObject.type_from_name "GIMarshallingTestsPointerStruct"
2642
2757
  assert_equal gtype, res
2643
2758
  end
2644
2759
 
2645
- it 'has a working function #pointer_struct_returnv' do
2760
+ it "has a working function #pointer_struct_returnv" do
2646
2761
  res = GIMarshallingTests.pointer_struct_returnv
2647
2762
  assert_instance_of GIMarshallingTests::PointerStruct, res
2648
2763
  assert_equal 42, res.long_
2649
2764
  end
2650
2765
 
2651
- it 'has a working function #return_gvalue_flat_array' do
2766
+ it "has a working function #return_gvalue_flat_array" do
2652
2767
  result = GIMarshallingTests.return_gvalue_flat_array
2653
2768
  arr = result.to_a
2654
- arr[0].get_value.must_equal 42
2655
- arr[1].get_value.must_equal '42'
2656
- arr[2].get_value.must_equal true
2769
+ _(arr[0].get_value).must_equal 42
2770
+ _(arr[1].get_value).must_equal "42"
2771
+ _(arr[2].get_value).must_equal true
2657
2772
  end
2658
2773
 
2659
- it 'has a working function #short_in_max' do
2774
+ it "has a working function #short_in_max" do
2660
2775
  GIMarshallingTests.short_in_max 0x7fff
2661
2776
  pass
2662
2777
  end
2663
2778
 
2664
- it 'has a working function #short_in_min' do
2779
+ it "has a working function #short_in_min" do
2665
2780
  GIMarshallingTests.short_in_min(-0x8000)
2666
2781
  pass
2667
2782
  end
2668
2783
 
2669
- it 'has a working function #short_inout_max_min' do
2784
+ it "has a working function #short_inout_max_min" do
2670
2785
  res = GIMarshallingTests.short_inout_max_min 0x7fff
2671
2786
  assert_equal(-0x8000, res)
2672
2787
  end
2673
2788
 
2674
- it 'has a working function #short_inout_min_max' do
2789
+ it "has a working function #short_inout_min_max" do
2675
2790
  res = GIMarshallingTests.short_inout_min_max(-0x8000)
2676
2791
  assert_equal 0x7fff, res
2677
2792
  end
2678
2793
 
2679
- it 'has a working function #short_out_max' do
2794
+ it "has a working function #short_out_max" do
2680
2795
  res = GIMarshallingTests.short_out_max
2681
2796
  assert_equal 0x7fff, res
2682
2797
  end
2683
2798
 
2684
- it 'has a working function #short_out_min' do
2799
+ it "has a working function #short_out_min" do
2685
2800
  res = GIMarshallingTests.short_out_min
2686
2801
  assert_equal(-0x8000, res)
2687
2802
  end
2688
2803
 
2689
- it 'has a working function #short_return_max' do
2804
+ it "has a working function #short_return_max" do
2690
2805
  res = GIMarshallingTests.short_return_max
2691
2806
  assert_equal 0x7fff, res
2692
2807
  end
2693
2808
 
2694
- it 'has a working function #short_return_min' do
2809
+ it "has a working function #short_return_min" do
2695
2810
  res = GIMarshallingTests.short_return_min
2696
2811
  assert_equal(-0x8000, res)
2697
2812
  end
2698
2813
 
2699
- it 'has a working function #simple_struct_returnv' do
2814
+ it "has a working function #simple_struct_returnv" do
2700
2815
  res = GIMarshallingTests.simple_struct_returnv
2701
2816
  assert_instance_of GIMarshallingTests::SimpleStruct, res
2702
2817
  assert_equal 6, res.long_
2703
2818
  assert_equal 7, res.int8
2704
2819
  end
2705
2820
 
2706
- it 'has a working function #size_in' do
2821
+ it "has a working function #size_in" do
2707
2822
  GIMarshallingTests.size_in max_size_t
2708
2823
  end
2709
2824
 
2710
- it 'has a working function #size_inout' do
2825
+ it "has a working function #size_inout" do
2711
2826
  res = GIMarshallingTests.size_inout max_size_t
2712
2827
  assert_equal 0, res
2713
2828
  end
2714
2829
 
2715
- it 'has a working function #size_out' do
2830
+ it "has a working function #size_out" do
2716
2831
  res = GIMarshallingTests.size_out
2717
2832
  assert_equal max_size_t, res
2718
2833
  end
2719
2834
 
2720
- it 'has a working function #size_return' do
2835
+ it "has a working function #size_return" do
2721
2836
  res = GIMarshallingTests.size_return
2722
2837
  assert_equal max_size_t, res
2723
2838
  end
2724
2839
 
2725
- it 'has a working function #ssize_in_max' do
2840
+ it "has a working function #ssize_in_max" do
2726
2841
  GIMarshallingTests.ssize_in_max max_ssize_t
2727
2842
  pass
2728
2843
  end
2729
2844
 
2730
- it 'has a working function #ssize_in_min' do
2845
+ it "has a working function #ssize_in_min" do
2731
2846
  GIMarshallingTests.ssize_in_min min_ssize_t
2732
2847
  pass
2733
2848
  end
2734
2849
 
2735
- it 'has a working function #ssize_inout_max_min' do
2850
+ it "has a working function #ssize_inout_max_min" do
2736
2851
  res = GIMarshallingTests.ssize_inout_max_min max_ssize_t
2737
2852
  assert_equal min_ssize_t, res
2738
2853
  end
2739
2854
 
2740
- it 'has a working function #ssize_inout_min_max' do
2855
+ it "has a working function #ssize_inout_min_max" do
2741
2856
  res = GIMarshallingTests.ssize_inout_min_max min_ssize_t
2742
2857
  assert_equal max_ssize_t, res
2743
2858
  end
2744
2859
 
2745
- it 'has a working function #ssize_out_max' do
2860
+ it "has a working function #ssize_out_max" do
2746
2861
  res = GIMarshallingTests.ssize_out_max
2747
2862
  assert_equal max_ssize_t, res
2748
2863
  end
2749
2864
 
2750
- it 'has a working function #ssize_out_min' do
2865
+ it "has a working function #ssize_out_min" do
2751
2866
  res = GIMarshallingTests.ssize_out_min
2752
2867
  assert_equal min_ssize_t, res
2753
2868
  end
2754
2869
 
2755
- it 'has a working function #ssize_return_max' do
2870
+ it "has a working function #ssize_return_max" do
2756
2871
  res = GIMarshallingTests.ssize_return_max
2757
2872
  assert_equal max_ssize_t, res
2758
2873
  end
2759
2874
 
2760
- it 'has a working function #ssize_return_min' do
2875
+ it "has a working function #ssize_return_min" do
2761
2876
  res = GIMarshallingTests.ssize_return_min
2762
2877
  assert_equal min_ssize_t, res
2763
2878
  end
2764
2879
 
2765
- it 'has a working function #test_interface_test_int8_in' do
2880
+ it "has a working function #test_interface_test_int8_in" do
2766
2881
  derived_klass.class_eval { include GIMarshallingTests::Interface }
2767
2882
  instance = make_derived_instance do |info|
2768
2883
  info.install_vfunc_implementation :test_int8_in, proc { |obj, in_| obj.int = in_ }
2769
2884
  end
2770
- instance.int.must_equal 0
2885
+ _(instance.int).must_equal 0
2771
2886
  GIMarshallingTests.test_interface_test_int8_in instance, 8
2772
- instance.int.must_equal 8
2887
+ _(instance.int).must_equal 8
2773
2888
  end
2774
2889
 
2775
- it 'has a working function #time_t_in' do
2890
+ it "has a working function #time_t_in" do
2776
2891
  GIMarshallingTests.time_t_in 1_234_567_890
2777
2892
  pass
2778
2893
  end
2779
2894
 
2780
- it 'has a working function #time_t_inout' do
2895
+ it "has a working function #time_t_inout" do
2781
2896
  res = GIMarshallingTests.time_t_inout 1_234_567_890
2782
2897
  assert_equal 0, res
2783
2898
  end
2784
2899
 
2785
- it 'has a working function #time_t_out' do
2900
+ it "has a working function #time_t_out" do
2786
2901
  res = GIMarshallingTests.time_t_out
2787
2902
  assert_equal 1_234_567_890, res
2788
2903
  end
2789
2904
 
2790
- it 'has a working function #time_t_return' do
2905
+ it "has a working function #time_t_return" do
2791
2906
  res = GIMarshallingTests.time_t_return
2792
2907
  assert_equal 1_234_567_890, res
2793
2908
  end
2794
2909
 
2795
- it 'has a working function #uint16_in' do
2910
+ it "has a working function #uint16_in" do
2796
2911
  GIMarshallingTests.uint16_in 0xffff
2797
2912
  pass
2798
2913
  end
2799
2914
 
2800
- it 'has a working function #uint16_inout' do
2915
+ it "has a working function #uint16_inout" do
2801
2916
  res = GIMarshallingTests.uint16_inout 0xffff
2802
2917
  assert_equal 0, res
2803
2918
  end
2804
2919
 
2805
- it 'has a working function #uint16_out' do
2920
+ it "has a working function #uint16_out" do
2806
2921
  res = GIMarshallingTests.uint16_out
2807
2922
  assert_equal 0xffff, res
2808
2923
  end
2809
2924
 
2810
- it 'has a working function #uint16_return' do
2925
+ it "has a working function #uint16_return" do
2811
2926
  res = GIMarshallingTests.uint16_return
2812
2927
  assert_equal 0xffff, res
2813
2928
  end
2814
2929
 
2815
- it 'has a working function #uint32_in' do
2930
+ it "has a working function #uint32_in" do
2816
2931
  GIMarshallingTests.uint32_in 0xffffffff
2817
2932
  end
2818
2933
 
2819
- it 'has a working function #uint32_inout' do
2934
+ it "has a working function #uint32_inout" do
2820
2935
  res = GIMarshallingTests.uint32_inout 0xffffffff
2821
2936
  assert_equal 0, res
2822
2937
  end
2823
2938
 
2824
- it 'has a working function #uint32_out' do
2939
+ it "has a working function #uint32_out" do
2825
2940
  res = GIMarshallingTests.uint32_out
2826
2941
  assert_equal 0xffffffff, res
2827
2942
  end
2828
2943
 
2829
- it 'has a working function #uint32_return' do
2944
+ it "has a working function #uint32_return" do
2830
2945
  res = GIMarshallingTests.uint32_return
2831
2946
  assert_equal 0xffffffff, res
2832
2947
  end
2833
2948
 
2834
- it 'has a working function #uint64_in' do
2949
+ it "has a working function #uint64_in" do
2835
2950
  GIMarshallingTests.uint64_in 0xffff_ffff_ffff_ffff
2836
2951
  pass
2837
2952
  end
2838
2953
 
2839
- it 'has a working function #uint64_inout' do
2954
+ it "has a working function #uint64_inout" do
2840
2955
  res = GIMarshallingTests.uint64_inout 0xffff_ffff_ffff_ffff
2841
2956
  assert_equal 0, res
2842
2957
  end
2843
2958
 
2844
- it 'has a working function #uint64_out' do
2959
+ it "has a working function #uint64_out" do
2845
2960
  res = GIMarshallingTests.uint64_out
2846
2961
  assert_equal 0xffff_ffff_ffff_ffff, res
2847
2962
  end
2848
2963
 
2849
- it 'has a working function #uint64_return' do
2964
+ it "has a working function #uint64_return" do
2850
2965
  res = GIMarshallingTests.uint64_return
2851
2966
  assert_equal 0xffff_ffff_ffff_ffff, res
2852
2967
  end
2853
2968
 
2854
- it 'has a working function #uint8_in' do
2969
+ it "has a working function #uint8_in" do
2855
2970
  GIMarshallingTests.uint8_in 0xff
2856
2971
  end
2857
2972
 
2858
- it 'has a working function #uint8_inout' do
2973
+ it "has a working function #uint8_inout" do
2859
2974
  res = GIMarshallingTests.uint8_inout 0xff
2860
2975
  assert_equal 0, res
2861
2976
  end
2862
2977
 
2863
- it 'has a working function #uint8_out' do
2978
+ it "has a working function #uint8_out" do
2864
2979
  res = GIMarshallingTests.uint8_out
2865
2980
  assert_equal 0xff, res
2866
2981
  end
2867
2982
 
2868
- it 'has a working function #uint8_return' do
2983
+ it "has a working function #uint8_return" do
2869
2984
  res = GIMarshallingTests.uint8_return
2870
2985
  assert_equal 0xff, res
2871
2986
  end
2872
2987
 
2873
- it 'has a working function #uint_in' do
2988
+ it "has a working function #uint_in" do
2874
2989
  GIMarshallingTests.uint_in max_uint
2875
2990
  pass
2876
2991
  end
2877
2992
 
2878
- it 'has a working function #uint_inout' do
2993
+ it "has a working function #uint_inout" do
2879
2994
  res = GIMarshallingTests.uint_inout max_uint
2880
2995
  assert_equal 0, res
2881
2996
  end
2882
2997
 
2883
- it 'has a working function #uint_out' do
2998
+ it "has a working function #uint_out" do
2884
2999
  res = GIMarshallingTests.uint_out
2885
3000
  assert_equal max_uint, res
2886
3001
  end
2887
3002
 
2888
- it 'has a working function #uint_return' do
3003
+ it "has a working function #uint_return" do
2889
3004
  res = GIMarshallingTests.uint_return
2890
3005
  assert_equal max_uint, res
2891
3006
  end
2892
3007
 
2893
- it 'has a working function #ulong_in' do
3008
+ it "has a working function #ulong_in" do
2894
3009
  GIMarshallingTests.ulong_in max_ulong
2895
3010
  end
2896
3011
 
2897
- it 'has a working function #ulong_inout' do
3012
+ it "has a working function #ulong_inout" do
2898
3013
  res = GIMarshallingTests.ulong_inout max_ulong
2899
3014
  assert_equal 0, res
2900
3015
  end
2901
3016
 
2902
- it 'has a working function #ulong_out' do
3017
+ it "has a working function #ulong_out" do
2903
3018
  res = GIMarshallingTests.ulong_out
2904
3019
  assert_equal max_ulong, res
2905
3020
  end
2906
3021
 
2907
- it 'has a working function #ulong_return' do
3022
+ it "has a working function #ulong_return" do
2908
3023
  res = GIMarshallingTests.ulong_return
2909
3024
  assert_equal max_ulong, res
2910
3025
  end
2911
3026
 
2912
- it 'has a working function #union_inout' do
2913
- skip 'This function is defined in the header but not implemented'
3027
+ it "has a working function #union_inout" do
3028
+ skip "This function is defined in the header but not implemented"
2914
3029
  end
2915
3030
 
2916
- it 'has a working function #union_out' do
2917
- skip 'This function is defined in the header but not implemented'
3031
+ it "has a working function #union_out" do
3032
+ skip "This function is defined in the header but not implemented"
2918
3033
  end
2919
3034
 
2920
- it 'has a working function #union_returnv' do
3035
+ it "has a working function #union_returnv" do
2921
3036
  res = GIMarshallingTests.union_returnv
2922
3037
  assert_instance_of GIMarshallingTests::Union, res
2923
3038
  assert_equal 42, res.long_
2924
3039
  end
2925
3040
 
2926
- it 'has a working function #ushort_in' do
3041
+ it "has a working function #ushort_in" do
2927
3042
  GIMarshallingTests.ushort_in max_ushort
2928
3043
  pass
2929
3044
  end
2930
3045
 
2931
- it 'has a working function #ushort_inout' do
3046
+ it "has a working function #ushort_inout" do
2932
3047
  res = GIMarshallingTests.ushort_inout max_ushort
2933
3048
  assert_equal 0, res
2934
3049
  end
2935
3050
 
2936
- it 'has a working function #ushort_out' do
3051
+ it "has a working function #ushort_out" do
2937
3052
  res = GIMarshallingTests.ushort_out
2938
3053
  assert_equal max_ushort, res
2939
3054
  end
2940
3055
 
2941
- it 'has a working function #ushort_return' do
3056
+ it "has a working function #ushort_return" do
2942
3057
  res = GIMarshallingTests.ushort_return
2943
3058
  assert_equal max_ushort, res
2944
3059
  end
2945
3060
 
2946
- it 'has a working function #utf8_as_uint8array_in' do
2947
- skip unless get_introspection_data 'GIMarshallingTests', 'utf8_as_uint8array_in'
3061
+ it "has a working function #utf8_as_uint8array_in" do
2948
3062
  GIMarshallingTests.utf8_as_uint8array_in GIMarshallingTests::CONSTANT_UTF8.bytes.to_a
2949
3063
  pass
2950
3064
  end
2951
3065
 
2952
- it 'has a working function #utf8_dangling_out' do
3066
+ it "has a working function #utf8_dangling_out" do
2953
3067
  res = GIMarshallingTests.utf8_dangling_out
2954
3068
  assert_nil res
2955
3069
  end
2956
3070
 
2957
- it 'has a working function #utf8_full_in' do
2958
- skip 'This function is defined in the header but not implemented'
3071
+ it "has a working function #utf8_full_in" do
3072
+ skip "This function is defined in the header but not implemented"
2959
3073
  end
2960
3074
 
2961
- it 'has a working function #utf8_full_inout' do
2962
- res = GIMarshallingTests.utf8_full_inout 'const ♥ utf8'
2963
- assert_equal '', res
3075
+ it "has a working function #utf8_full_inout" do
3076
+ res = GIMarshallingTests.utf8_full_inout "const ♥ utf8"
3077
+ assert_equal "", res
2964
3078
  end
2965
3079
 
2966
- it 'has a working function #utf8_full_out' do
3080
+ it "has a working function #utf8_full_out" do
2967
3081
  res = GIMarshallingTests.utf8_full_out
2968
- assert_equal 'const ♥ utf8', res
3082
+ assert_equal "const ♥ utf8", res
2969
3083
  end
2970
3084
 
2971
- it 'has a working function #utf8_full_return' do
3085
+ it "has a working function #utf8_full_return" do
2972
3086
  res = GIMarshallingTests.utf8_full_return
2973
- assert_equal 'const ♥ utf8', res
3087
+ assert_equal "const ♥ utf8", res
2974
3088
  end
2975
3089
 
2976
- it 'has a working function #utf8_none_in' do
2977
- GIMarshallingTests.utf8_none_in 'const ♥ utf8'
3090
+ it "has a working function #utf8_none_in" do
3091
+ GIMarshallingTests.utf8_none_in "const ♥ utf8"
2978
3092
  pass
2979
3093
  end
2980
3094
 
2981
- it 'has a working function #utf8_none_inout' do
2982
- res = GIMarshallingTests.utf8_none_inout 'const ♥ utf8'
2983
- assert_equal '', res
3095
+ it "has a working function #utf8_none_inout" do
3096
+ res = GIMarshallingTests.utf8_none_inout "const ♥ utf8"
3097
+ assert_equal "", res
2984
3098
  end
2985
3099
 
2986
- it 'has a working function #utf8_none_out' do
3100
+ it "has a working function #utf8_none_out" do
2987
3101
  res = GIMarshallingTests.utf8_none_out
2988
- assert_equal 'const ♥ utf8', res
3102
+ assert_equal "const ♥ utf8", res
2989
3103
  end
2990
3104
 
2991
- it 'has a working function #utf8_none_return' do
3105
+ it "has a working function #utf8_none_return" do
2992
3106
  res = GIMarshallingTests.utf8_none_return
2993
- assert_equal 'const ♥ utf8', res
3107
+ assert_equal "const ♥ utf8", res
2994
3108
  end
2995
3109
  end