diff options
| author | Glenn Morris | 2018-08-26 15:10:50 -0700 |
|---|---|---|
| committer | Glenn Morris | 2018-08-26 15:10:50 -0700 |
| commit | 1afd313334c93cb5b0a7a378bd635a54dc1d6a9e (patch) | |
| tree | cb95ad44d35f9b32a8acc8bb00b7291f38549c52 /test/data | |
| parent | 18d52b90a1692a47cea5b5e905a58a3b2c6c9a64 (diff) | |
| parent | 54fb383af6f6af7b72c28f38b308d9b24d2af4f6 (diff) | |
| download | emacs-1afd313334c93cb5b0a7a378bd635a54dc1d6a9e.tar.gz emacs-1afd313334c93cb5b0a7a378bd635a54dc1d6a9e.zip | |
Merge from origin/emacs-26
54fb383 (origin/emacs-26) Fix detection of freed emacs_values (Bug#32...
769d0cd ; Fix out-of-tree build for mod-test.so
9a1329e Avoid crashes with very wide TTY frames on MS-Windows
9a613d3 Prevent `modify-file-local-variable-prop-line' from adding ex...
624e7dc Update GNOME bugtracker URLs
51ef6d5 Clarify in the Emacs manual that ChangeLog files are not used
6e08019 Recognize codepage 65001 as a valid encoding
1a350d7 ; * etc/NEWS: Fix format of first lines of some entries.
22d1f53 Avoid compilation warning in nt/addpm.c
7bc9ce7 Fix duplicate custom group names in bibtex.el
a9cf938 Fix outdated text in the Calc manual
Conflicts:
etc/NEWS
etc/PROBLEMS
src/emacs-module.c
src/gtkutil.c
src/image.c
src/xterm.c
test/Makefile.in
Diffstat (limited to 'test/data')
| -rw-r--r-- | test/data/emacs-module/mod-test.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index db05e90bc49..a9b459b4cc4 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c | |||
| @@ -156,6 +156,24 @@ Fmod_test_globref_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[], | |||
| 156 | return env->make_global_ref (env, lisp_str); | 156 | return env->make_global_ref (env, lisp_str); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | /* Create a few global references from arguments and free them. */ | ||
| 160 | static emacs_value | ||
| 161 | Fmod_test_globref_free (emacs_env *env, ptrdiff_t nargs, emacs_value args[], | ||
| 162 | void *data) | ||
| 163 | { | ||
| 164 | emacs_value refs[10]; | ||
| 165 | for (int i = 0; i < 10; i++) | ||
| 166 | { | ||
| 167 | refs[i] = env->make_global_ref (env, args[i % nargs]); | ||
| 168 | } | ||
| 169 | for (int i = 0; i < 10; i++) | ||
| 170 | { | ||
| 171 | env->free_global_ref (env, refs[i]); | ||
| 172 | } | ||
| 173 | return env->intern (env, "ok"); | ||
| 174 | } | ||
| 175 | |||
| 176 | |||
| 159 | 177 | ||
| 160 | /* Return a copy of the argument string where every 'a' is replaced | 178 | /* Return a copy of the argument string where every 'a' is replaced |
| 161 | with 'b'. */ | 179 | with 'b'. */ |
| @@ -339,6 +357,7 @@ emacs_module_init (struct emacs_runtime *ert) | |||
| 339 | DEFUN ("mod-test-non-local-exit-funcall", Fmod_test_non_local_exit_funcall, | 357 | DEFUN ("mod-test-non-local-exit-funcall", Fmod_test_non_local_exit_funcall, |
| 340 | 1, 1, NULL, NULL); | 358 | 1, 1, NULL, NULL); |
| 341 | DEFUN ("mod-test-globref-make", Fmod_test_globref_make, 0, 0, NULL, NULL); | 359 | DEFUN ("mod-test-globref-make", Fmod_test_globref_make, 0, 0, NULL, NULL); |
| 360 | DEFUN ("mod-test-globref-free", Fmod_test_globref_free, 4, 4, NULL, NULL); | ||
| 342 | DEFUN ("mod-test-string-a-to-b", Fmod_test_string_a_to_b, 1, 1, NULL, NULL); | 361 | DEFUN ("mod-test-string-a-to-b", Fmod_test_string_a_to_b, 1, 1, NULL, NULL); |
| 343 | DEFUN ("mod-test-userptr-make", Fmod_test_userptr_make, 1, 1, NULL, NULL); | 362 | DEFUN ("mod-test-userptr-make", Fmod_test_userptr_make, 1, 1, NULL, NULL); |
| 344 | DEFUN ("mod-test-userptr-get", Fmod_test_userptr_get, 1, 1, NULL, NULL); | 363 | DEFUN ("mod-test-userptr-get", Fmod_test_userptr_get, 1, 1, NULL, NULL); |