diff options
| author | Michael Albinus | 2018-08-27 12:51:44 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-08-27 12:51:44 +0200 |
| commit | c61fbc529343194923ca11dfe10e9afb8b2546d3 (patch) | |
| tree | 02ccba7f8c7917a8413d3e5e0a5928ba6a572d0f /test/data | |
| parent | e1370c36cef12e4ffdf4519a2eec6bb5b7727883 (diff) | |
| parent | 1afd313334c93cb5b0a7a378bd635a54dc1d6a9e (diff) | |
| download | emacs-c61fbc529343194923ca11dfe10e9afb8b2546d3.tar.gz emacs-c61fbc529343194923ca11dfe10e9afb8b2546d3.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
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); |