To: vim_dev@googlegroups.com Subject: Patch 8.2.3080 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3080 Problem: Recover test fails on 32bit systems. (Ondřej Súkup) Solution: Detect 32/64 bit systems. (Yegappan Lakshmanan, closes #8485, closes #8479) Files: src/testdir/test_recover.vim *** ../vim-8.2.3079/src/testdir/test_recover.vim 2021-06-12 14:05:37.872370788 +0200 --- src/testdir/test_recover.vim 2021-06-30 21:25:40.648707992 +0200 *************** *** 202,211 **** " Not all fields are written in a system-independent manner. Detect whether " the test is running on a little or big-endian system, so the correct " corruption values can be set. ! let little_endian = b[1008:1015] == 0z33323130.00000000 " clear the B0_MAGIC_LONG field ! let b[1008:1015] = 0z0000000000000000 call writefile(b, sn) let msg = execute('recover Xfile1') call assert_match('the file has been damaged', msg) --- 202,217 ---- " Not all fields are written in a system-independent manner. Detect whether " the test is running on a little or big-endian system, so the correct " corruption values can be set. ! let little_endian = b[1008:1011] == 0z33323130 ! " The swap file header fields can be either 32-bit or 64-bit. ! let system_64bit = b[1012:1015] == 0z00000000 " clear the B0_MAGIC_LONG field ! if system_64bit ! let b[1008:1015] = 0z00000000.00000000 ! else ! let b[1008:1011] = 0z00000000 ! endif call writefile(b, sn) let msg = execute('recover Xfile1') call assert_match('the file has been damaged', msg) *************** *** 243,249 **** " set the block number in a pointer entry to a negative number let b = copy(save_b) ! let b[4104:4111] = little_endian ? 0z00000000.00000080 : 0z80000000.00000000 call writefile(b, sn) call assert_fails('recover Xfile1', 'E312:') call assert_equal('Xfile1', @%) --- 249,259 ---- " set the block number in a pointer entry to a negative number let b = copy(save_b) ! if system_64bit ! let b[4104:4111] = little_endian ? 0z00000000.00000080 : 0z80000000.00000000 ! else ! let b[4104:4107] = little_endian ? 0z00000080 : 0z80000000 ! endif call writefile(b, sn) call assert_fails('recover Xfile1', 'E312:') call assert_equal('Xfile1', @%) *************** *** 261,267 **** " set the number of lines in the data block to zero let b = copy(save_b) ! let b[8208:8215] = 0z00000000.00000000 call writefile(b, sn) call assert_fails('recover Xfile1', 'E312:') call assert_equal('Xfile1', @%) --- 271,281 ---- " set the number of lines in the data block to zero let b = copy(save_b) ! if system_64bit ! let b[8208:8215] = 0z00000000.00000000 ! else ! let b[8208:8211] = 0z00000000 ! endif call writefile(b, sn) call assert_fails('recover Xfile1', 'E312:') call assert_equal('Xfile1', @%) *************** *** 271,277 **** " use an invalid text start for the lines in a data block let b = copy(save_b) ! let b[8216:8219] = 0z00000000 call writefile(b, sn) call assert_fails('recover Xfile1', 'E312:') call assert_equal('Xfile1', @%) --- 285,295 ---- " use an invalid text start for the lines in a data block let b = copy(save_b) ! if system_64bit ! let b[8216:8219] = 0z00000000 ! else ! let b[8212:8215] = 0z00000000 ! endif call writefile(b, sn) call assert_fails('recover Xfile1', 'E312:') call assert_equal('Xfile1', @%) *** ../vim-8.2.3079/src/version.c 2021-06-30 20:54:30.696546341 +0200 --- src/version.c 2021-06-30 21:29:03.644317665 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3080, /**/ -- hundred-and-one symptoms of being an internet addict: 59. Your wife says communication is important in a marriage...so you buy another computer and install a second phone line so the two of you can chat. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///