comparison src/testdir/runtest.vim @ 29340:fba9e366ced4 v9.0.0013

patch 9.0.0013: reproducing memory access errors can be difficult Commit: https://github.com/vim/vim/commit/fa4873ccfc10e0f278dc46f39d00136fab059b19 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 30 22:13:59 2022 +0100 patch 9.0.0013: reproducing memory access errors can be difficult Problem: Reproducing memory access errors can be difficult. Solution: When testing, copy each line to allocated memory, so that valgrind can detect accessing memory before and/or after it. Fix uncovered problems.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 Jun 2022 23:15:03 +0200
parents 0e0e298e05c1
children 9dce192d1ac2
comparison
equal deleted inserted replaced
29339:a023e3008ae3 29340:fba9e366ced4
152 endif 152 endif
153 153
154 " Prepare for calling test_garbagecollect_now(). 154 " Prepare for calling test_garbagecollect_now().
155 let v:testing = 1 155 let v:testing = 1
156 156
157 " By default, copy each buffer line into allocated memory, so that valgrind can
158 " detect accessing memory before and after it.
159 call test_override('alloc_lines', 1)
160
157 " Support function: get the alloc ID by name. 161 " Support function: get the alloc ID by name.
158 function GetAllocId(name) 162 function GetAllocId(name)
159 exe 'split ' . s:srcdir . '/alloc.h' 163 exe 'split ' . s:srcdir . '/alloc.h'
160 let top = search('typedef enum') 164 let top = search('typedef enum')
161 if top == 0 165 if top == 0
180 184
181 " Avoid a three second wait when a message is about to be overwritten by the 185 " Avoid a three second wait when a message is about to be overwritten by the
182 " mode message. 186 " mode message.
183 set noshowmode 187 set noshowmode
184 188
185 " Clear any overrides. 189 " Clear any overrides, except "alloc_lines".
186 call test_override('ALL', 0) 190 call test_override('ALL', 0)
187 191
188 " Some tests wipe out buffers. To be consistent, always wipe out all 192 " Some tests wipe out buffers. To be consistent, always wipe out all
189 " buffers. 193 " buffers.
190 %bwipe! 194 %bwipe!