diff options
author | Philipp Stephani <phst@google.com> | 2017-06-12 23:45:18 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2017-06-12 23:46:02 +0200 |
commit | 52c846d45dc52365349fc71e15d305a20788ce00 (patch) | |
tree | 006bb54004843a65f6873bd4d67166b43e69b7d1 /test/data | |
parent | 69899d4a7e6e9e1b5e9f1894c53a81e340907f9d (diff) | |
download | emacs-52c846d45dc52365349fc71e15d305a20788ce00.tar.gz |
Print module structure sizes when initializing test module
* test/data/emacs-module/mod-test.c (emacs_module_init): Print
compile-time and runtime sizes of module structures to ease debugging
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/emacs-module/mod-test.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index 5e857c048f0..eee9466c5d6 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c @@ -265,12 +265,22 @@ int emacs_module_init (struct emacs_runtime *ert) { if (ert->size < sizeof *ert) - return 1; + { + fprintf (stderr, "Runtime size of runtime structure (%td bytes) " + "smaller than compile-time size (%zu bytes)", + ert->size, sizeof *ert); + return 1; + } emacs_env *env = ert->get_environment (ert); if (env->size < sizeof *env) - return 2; + { + fprintf (stderr, "Runtime size of environment structure (%td bytes) " + "smaller than compile-time size (%zu bytes)", + env->size, sizeof *env); + return 2; + } #define DEFUN(lsym, csym, amin, amax, doc, data) \ bind_function (env, lsym, \ |