[gjs/ewlsh/gvalues: 46/46] gi: Enable pending tests which are now correctly handled




commit 71c16a369ae8132524319e401cea8f7e75c449af
Author: Evan Welsh <contact evanwelsh com>
Date:   Tue Aug 24 22:05:07 2021 -0700

    gi: Enable pending tests which are now correctly handled

 installed-tests/js/testGIMarshalling.js | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/installed-tests/js/testGIMarshalling.js b/installed-tests/js/testGIMarshalling.js
index 5864cafe..298696da 100644
--- a/installed-tests/js/testGIMarshalling.js
+++ b/installed-tests/js/testGIMarshalling.js
@@ -758,10 +758,12 @@ describe('GValue', function () {
     });
 
     it('can be passed into a function and modified', function () {
-        expect(() => GIMarshallingTests.gvalue_in_with_modification(42)).not.toThrow();
-        // Let's assume this test doesn't expect that the modified GValue makes
-        // it back to the caller; I don't see how that could be achieved.
-        // See https://gitlab.gnome.org/GNOME/gjs/issues/80
+        const value = new GObject.Value();
+        value.init(GObject.TYPE_INT);
+        value.set_int(42);
+
+        expect(() => GIMarshallingTests.gvalue_in_with_modification(value)).not.toThrow();
+        expect(value.get_int()).toBe(24);
     });
 
     it('enum can be passed into a function and packed', function () {
@@ -772,10 +774,14 @@ describe('GValue', function () {
         expect(() => GIMarshallingTests.gvalue_in_enum(value))
             .not.toThrow();
     });
-    xit('flags can be passed into a function and packed', function () {
-        expect(() => GIMarshallingTests.gvalue_in_flags(GIMarshallingTests.Flags.VALUE3))
+
+    it('flags can be passed into a function and packed', function () {
+        const value = new GObject.Value();
+        value.init(GIMarshallingTests.Flags);
+        value.set_flags(GIMarshallingTests.Flags.VALUE3);
+        expect(() => GIMarshallingTests.gvalue_in_flags(value))
             .not.toThrow();
-    }).pend("we don't know to pack flags in a GValue as flags and not gint");
+    });
 
     it('marshals as an int64 out parameter', function () {
         expect(GIMarshallingTests.gvalue_int64_out()).toEqual(Limits.int64.max);


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