]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1106: tests: Test_log_nonexistent() causes asan failure v9.1.1106
authorChristian Brabandt <cb@256bit.org>
Tue, 11 Feb 2025 21:58:20 +0000 (22:58 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 11 Feb 2025 21:58:20 +0000 (22:58 +0100)
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 <cb@256bit.org>
src/testdir/test_startup.vim
src/version.c

index 78c24e4ab2aa1db90fcf38352f448bb4a3d8c966..78bbc7e6bb883c36734c18808f1581a0da9b04b5 100644 (file)
@@ -742,10 +742,15 @@ endfunc
 
 func Test_log_nonexistent()
   " this used to crash Vim
-  CheckFeature channel
+  CheckRunVimInTerminal
   CheckUnix
-  let result = join(systemlist(GetVimCommand() .. ' --log /X/Xlogfile -c qa!'))
-  call assert_match("E484: Can't open file", result)
+  let args = ' -u NONE -i NONE -U NONE --log /X/Xlogfile -X -c qa!'
+  let options = {'term_finish': 'open', 'cmd':
+        \  'sh -c "' .. GetVimCommand() .. args .. '"'}
+  let buf = RunVimInTerminal('', options)
+  call WaitForAssert({-> assert_match('E484: Can''t open file.*Xlogfile', term_getline(buf, 1))})
+  " terminal job has already finished, so just close the buffer
+  exe buf .. "bw!"
 endfunc
 
 func Test_read_stdin()
index f9aa19a5b33b9098d410fa46fe1f75f55854c68c..f17944a7a7e9277a5d6c6a131745e97a694f9cb9 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1106,
 /**/
     1105,
 /**/