summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Welsh <noreply@evanwelsh.com>2020-10-01 12:39:42 -0500
committerEvan Welsh <noreply@evanwelsh.com>2020-10-01 12:39:42 -0500
commit358848f56a07230aff9eca0199c7b727e05d3c9f (patch)
tree1d284299076dfe263e77b8120476fe2e9fa2035f
parenta7a3a966a6aff687630f0767853c33779b92de34 (diff)
downloadgjs-ewlsh/fix-null-pointers.tar.gz
Add test for not-nullable gpointer parameters.ewlsh/fix-null-pointers
Use GLib.str_hash until Regress has a suitable test case.
-rw-r--r--installed-tests/js/testGLib.js8
1 files changed, 8 insertions, 0 deletions
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/);
});