]> granicus.if.org Git - vim/commitdiff
patch 8.2.2424: some tests are known to cause an error with ASAN v8.2.2424
authorBram Moolenaar <Bram@vim.org>
Thu, 28 Jan 2021 17:34:35 +0000 (18:34 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 28 Jan 2021 17:34:35 +0000 (18:34 +0100)
Problem:    Some tests are known to cause an error with ASAN.
Solution:   Add CheckNotAsan.

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

index 2a4599763fca9c5730e86c2866ee2c074fa6fea7..e5298bc5309bde80e02adacac14ab3ae5b8a3f25 100644 (file)
@@ -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
index a07649e0b82d989d88c5dfefc07705ecf45671ec..ffde11e3e9e072b23c9884d2d6927f049d9a9978 100644 (file)
@@ -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>")
index e59bd207e5b9d43254f6299cd1fadd6a9411ac5a..5aa26645bf34d34ed55f058bfd8cc47259b181cf 100644 (file)
@@ -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
index 49abc5677bf85c46da10d9045adf65b6fb779c8e..4f78d9a09497c40b21da9cda55450e4f4bc579c9 100644 (file)
@@ -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
 
index 0816982468c036a1c031ee3d14c75c9eb035daac..fbdb35cc63575bd38998191fb7d0fc1b04cc6bf4 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2424,
 /**/
     2423,
 /**/