[gjs/gnome-3-36] testGIMarshalling: Verify vfunc inout parameters are correctly hanled



commit d12225b672286e5e436128f7702c6d767a419748
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Mon Mar 16 23:34:21 2020 +0100

    testGIMarshalling: Verify vfunc inout parameters are correctly hanled
    
    Requires https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/201

 installed-tests/js/testGIMarshalling.js | 34 +++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
---
diff --git a/installed-tests/js/testGIMarshalling.js b/installed-tests/js/testGIMarshalling.js
index 901e380a..0938b380 100644
--- a/installed-tests/js/testGIMarshalling.js
+++ b/installed-tests/js/testGIMarshalling.js
@@ -1100,6 +1100,22 @@ const VFuncTester = GObject.registerClass(class VFuncTester extends GIMarshallin
         return [48, 49, 50];
     }
 
+    vfunc_vfunc_one_inout_parameter(input) {
+        return input * 5;
+    }
+
+    vfunc_vfunc_multiple_inout_parameters(inputA, inputB) {
+        return [inputA * 5, inputB * -1];
+    }
+
+    vfunc_vfunc_return_value_and_one_inout_parameter(input) {
+        return [49, input * 5];
+    }
+
+    vfunc_vfunc_return_value_and_multiple_inout_parameters(inputA, inputB) {
+        return [49, inputA * 5, inputB * -1];
+    }
+
     vfunc_vfunc_array_out_parameter() {
         return [50, 51];
     }
@@ -1192,6 +1208,24 @@ describe('Virtual function', function () {
             .toEqual([48, 49, 50]);
     });
 
+    it('marshals one inout parameter', function () {
+        expect(tester.vfunc_one_inout_parameter(10)).toEqual(50);
+    }).pend('https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/201');
+
+    it('marshals multiple inout parameters', function () {
+        expect(tester.vfunc_multiple_inout_parameters(10, 5)).toEqual([50, -5]);
+    }).pend('https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/201');
+
+    it('marshals a return value and one inout parameter', function () {
+        expect(tester.vfunc_return_value_and_one_inout_parameter(10))
+            .toEqual([49, 50]);
+    }).pend('https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/201');
+
+    it('marshals a return value and multiple inout parameters', function () {
+        expect(tester.vfunc_return_value_and_multiple_inout_parameters(10, -51))
+            .toEqual([49, 50, 51]);
+    }).pend('https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/201');
+
     it('marshals an array out parameter', function () {
         expect(tester.vfunc_array_out_parameter()).toEqual([50, 51]);
     });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]