[gjs/gnome-3-38] Add test for not-nullable gpointer parameters.
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/gnome-3-38] Add test for not-nullable gpointer parameters.
- Date: Thu, 8 Oct 2020 22:29:20 +0000 (UTC)
commit 16f168ef54cfc37812f23c8fa92e8ed8be26ac8e
Author: Evan Welsh <noreply evanwelsh com>
Date: Thu Oct 1 12:39:42 2020 -0500
Add test for not-nullable gpointer parameters.
Use GLib.str_hash until Regress has a suitable test case.
installed-tests/js/testGLib.js | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/installed-tests/js/testGLib.js b/installed-tests/js/testGLib.js
index d25e3785..4e5d23c8 100644
--- a/installed-tests/js/testGLib.js
+++ b/installed-tests/js/testGLib.js
@@ -133,6 +133,14 @@ describe('GLib string function overrides', function () {
numExpectedWarnings = 0;
});
+ // TODO: Add Regress.func_not_nullable_untyped_gpointer_in and move to testRegress.js
+ it('GLib.str_hash errors when marshalling null to a not-nullable parameter', function () {
+ // This tests that we don't marshal null to a not-nullable untyped gpointer.
+ expect(() => GLib.str_hash(null)).toThrowError(
+ /Argument [a-z]+ may not be null/
+ );
+ });
+
it('GLib.stpcpy', function () {
expect(() => GLib.stpcpy('dest', 'src')).toThrowError(/not introspectable/);
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]