Skip to content

Commit 88ce0c5

Browse files
committed
patch 9.1.1106: tests: Test_log_nonexistent() causes asan failure
Problem: tests: Test_log_nonexistent() causes asan failure (Hirohito Higashi) Solution: don't run vim using system(), but run Vim in a terminal related: #16602 related: #16610 Signed-off-by: Christian Brabandt <[email protected]>
1 parent 7e89800 commit 88ce0c5

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/testdir/test_startup.vim

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,15 @@ endfunc
742742

743743
func Test_log_nonexistent()
744744
" this used to crash Vim
745-
CheckFeature channel
745+
CheckRunVimInTerminal
746746
CheckUnix
747-
let result = join(systemlist(GetVimCommand() .. ' --log /X/Xlogfile -c qa!'))
748-
call assert_match("E484: Can't open file", result)
747+
let args = ' -u NONE -i NONE -U NONE --log /X/Xlogfile -X -c qa!'
748+
let options = {'term_finish': 'open', 'cmd':
749+
\ 'sh -c "' .. GetVimCommand() .. args .. '"'}
750+
let buf = RunVimInTerminal('', options)
751+
call WaitForAssert({-> assert_match('E484: Can''t open file.*Xlogfile', term_getline(buf, 1))})
752+
" terminal job has already finished, so just close the buffer
753+
exe buf .. "bw!"
749754
endfunc
750755

751756
func Test_read_stdin()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1106,
707709
/**/
708710
1105,
709711
/**/

0 commit comments

Comments
 (0)