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