changeset 23766:704fdd4d0949 v8.2.2424

patch 8.2.2424: some tests are known to cause an error with ASAN Commit: https://github.com/vim/vim/commit/97202d951685fc4d90085da676a90644cbf72571 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 28 18:34:35 2021 +0100 patch 8.2.2424: some tests are known to cause an error with ASAN Problem: Some tests are known to cause an error with ASAN. Solution: Add CheckNotAsan.
author Bram Moolenaar <Bram@vim.org>
date Thu, 28 Jan 2021 18:45:03 +0100
parents 6943434d5d93
children 51c399104d33
files src/testdir/check.vim src/testdir/test_ex_mode.vim src/testdir/test_ins_complete.vim src/testdir/test_memory_usage.vim src/version.c
diffstat 5 files changed, 37 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -183,4 +183,12 @@ func s:CheckIPv6Loopback()
   return v:false
 endfunc
 
+" Command to check for not running under ASAN
+command CheckNotAsan call CheckNotAsan()
+func CheckNotAsan()
+  if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
+    throw 'Skipped: does not work with ASAN'
+  endif
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
--- a/src/testdir/test_ex_mode.vim
+++ b/src/testdir/test_ex_mode.vim
@@ -207,6 +207,9 @@ func Test_ex_mode_with_global()
 endfunc
 
 func Test_ex_mode_count_overflow()
+  " The multiplication causes an integer overflow
+  CheckNotAsan
+
   " this used to cause a crash
   let lines =<< trim END
     call feedkeys("\<Esc>Q\<CR>")
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -562,27 +562,33 @@ func Test_completefunc_error()
   call setline(1, ['', 'abcd', ''])
   call assert_fails('exe "normal 2G$a\<C-X>\<C-U>"', 'E578:')
 
-  " Jump to a different window from the complete function
-  " TODO: The following test causes an ASAN failure. Once this issue is
-  " addressed, enable the following test.
-  "func! CompleteFunc(findstart, base)
-  "  if a:findstart == 1
-  "    return col('.') - 1
-  "  endif
-  "  wincmd p
-  "  return ['a', 'b']
-  "endfunc
-  "set completefunc=CompleteFunc
-  "new
-  "call assert_fails('exe "normal a\<C-X>\<C-U>"', 'E839:')
-  "close!
-
   set completefunc&
   delfunc CompleteFunc
   delfunc CompleteFunc2
   close!
 endfunc
 
+func Test_completefunc_error_not_asan()
+  " The following test causes an ASAN failure.
+  CheckNotAsan
+
+  " Jump to a different window from the complete function
+  func! CompleteFunc(findstart, base)
+    if a:findstart == 1
+      return col('.') - 1
+    endif
+    wincmd p
+    return ['a', 'b']
+  endfunc
+  set completefunc=CompleteFunc
+  new
+  call assert_fails('exe "normal a\<C-X>\<C-U>"', 'E839:')
+  close!
+
+  set completefunc&
+  delfunc CompleteFunc
+endfunc
+
 " Test for returning non-string values from 'completefunc'
 func Test_completefunc_invalid_data()
   new
--- a/src/testdir/test_memory_usage.vim
+++ b/src/testdir/test_memory_usage.vim
@@ -4,11 +4,9 @@ source check.vim
 CheckFeature terminal
 CheckNotGui
 
-if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
-  " Skip tests on Travis CI ASAN build because it's difficult to estimate
-  " memory usage.
-  throw 'Skipped: does not work with ASAN'
-endif
+" Skip tests on Travis CI ASAN build because it's difficult to estimate memory
+" usage.
+CheckNotAsan
 
 source shared.vim
 
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2424,
+/**/
     2423,
 /**/
     2422,