diff options
author | Philipp Stephani <phst@google.com> | 2020-07-25 23:23:19 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2020-07-26 14:33:59 +0200 |
commit | 3838aeb7397ce80134c70fd49f7e9e5ef7aff3e5 (patch) | |
tree | 0e38c2b6668f603e9a2f127164b230219fe77621 /test/src | |
parent | bde5f5f8978f704f24cce2fc7beec8c740d0e331 (diff) | |
download | emacs-3838aeb7397ce80134c70fd49f7e9e5ef7aff3e5.tar.gz emacs-3838aeb7397ce80134c70fd49f7e9e5ef7aff3e5.tar.bz2 emacs-3838aeb7397ce80134c70fd49f7e9e5ef7aff3e5.zip |
Backport: add another test case for module assertions.
This backports commit 9f01ce6327 from master. Since the bug isn’t
present on emacs-27, just backport the new test case.
* test/data/emacs-module/mod-test.c (Fmod_test_globref_invalid_free):
New test module function.
(emacs_module_init): Export it.
* test/src/emacs-module-tests.el
(module--test-assertions--globref-invalid-free): New unit test.
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/emacs-module-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index de707a4243a..e9f13ba368b 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -299,6 +299,17 @@ during garbage collection." (mod-test-invalid-finalizer) (garbage-collect))) +(ert-deftest module--test-assertions--globref-invalid-free () + "Check that -module-assertions detects invalid freeing of a +local reference." + (skip-unless (or (file-executable-p mod-test-emacs) + (and (eq system-type 'windows-nt) + (file-executable-p (concat mod-test-emacs ".exe"))))) + (module--test-assertion + (rx "Global value was not found in list of " (+ digit) " globals") + (mod-test-globref-invalid-free) + (garbage-collect))) + (ert-deftest module/describe-function-1 () "Check that Bug#30163 is fixed." (with-temp-buffer |