]> granicus.if.org Git - vim/commitdiff
patch 8.2.2016: swap file test is a little flaky v8.2.2016
authorBram Moolenaar <Bram@vim.org>
Thu, 19 Nov 2020 17:57:23 +0000 (18:57 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 19 Nov 2020 17:57:23 +0000 (18:57 +0100)
Problem:    Swap file test is a little flaky.
Solution:   Don't set a byte to a fixed value, increment it.

src/testdir/test_swap.vim
src/version.c

index 8a6d81c5d5c6ba7df18d8890783bf8b22d76816c..4bc73097c886fcafd8ab7efe6e254e31b187c8e9 100644 (file)
@@ -417,7 +417,7 @@ func Test_swap_auto_delete()
   " swap file should be automatically deleted.
   bwipe!
   " change the process ID to avoid the "still running" warning
-  let swapfile_bytes[24] = 0x99
+  let swapfile_bytes[24] = swapfile_bytes[24] + 1
   call writefile(swapfile_bytes, swapfile_name)
   edit Xtest.scr
   " will end up using the same swap file after deleting the existing one
@@ -433,7 +433,7 @@ func Test_swap_auto_delete()
   augroup END
 
   " change the host name
-  let swapfile_bytes[28 + 40] = 0x89
+  let swapfile_bytes[28 + 40] = swapfile_bytes[28 + 40] + 2
   call writefile(swapfile_bytes, swapfile_name)
   edit Xtest.scr
   call assert_equal(1, filereadable(swapfile_name))
index 1170a7fdbae463e0e4c94f868ea18867d93db737..01cf3c935ced64635516f3290a7cb8356c67ded1 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2016,
 /**/
     2015,
 /**/