To: vim_dev@googlegroups.com Subject: Patch 8.2.2105 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2105 Problem: Sound test is a bit flaky. Solution: Use WaitForAssert(). (Dominique Pellé, closes #7429) Files: src/testdir/test_sound.vim *** ../vim-8.2.2104/src/testdir/test_sound.vim 2020-08-12 18:50:31.887655765 +0200 --- src/testdir/test_sound.vim 2020-12-06 21:41:48.962292927 +0100 *************** *** 1,5 **** --- 1,7 ---- " Tests for the sound feature + source shared.vim + if !has('sound') throw 'Skipped: sound feature not available' endif *************** *** 13,18 **** --- 15,21 ---- if has('win32') throw 'Skipped: Playing event with callback is not supported on Windows' endif + let g:id = 0 let id = 'bell'->sound_playevent('PlayCallback') if id == 0 throw 'Skipped: bell event not available' *************** *** 20,27 **** " Stop it quickly, avoid annoying the user. sleep 20m eval id->sound_stop() ! sleep 30m ! call assert_equal(id, g:id) call assert_equal(1, g:result) " sound was aborted endfunc --- 23,29 ---- " Stop it quickly, avoid annoying the user. sleep 20m eval id->sound_stop() ! call WaitForAssert({-> assert_equal(id, g:id)}) call assert_equal(1, g:result) " sound was aborted endfunc *************** *** 37,53 **** " play until the end let id2 = fname->sound_playfile('PlayCallback') call assert_true(id2 > 0) ! sleep 500m ! call assert_equal(id2, g:id) call assert_equal(0, g:result) let id2 = sound_playfile(fname, 'PlayCallback') call assert_true(id2 > 0) sleep 20m call sound_clear() ! sleep 30m ! call assert_equal(id2, g:id) ! call assert_equal(1, g:result) " recursive use was causing a crash func PlayAgain(id, fname) --- 39,53 ---- " play until the end let id2 = fname->sound_playfile('PlayCallback') call assert_true(id2 > 0) ! call WaitForAssert({-> assert_equal(id2, g:id)}) call assert_equal(0, g:result) let id2 = sound_playfile(fname, 'PlayCallback') call assert_true(id2 > 0) sleep 20m call sound_clear() ! call WaitForAssert({-> assert_equal(id2, g:id)}) ! call assert_equal(1, g:result) " sound was aborted " recursive use was causing a crash func PlayAgain(id, fname) *************** *** 59,66 **** call assert_true(id3 > 0) sleep 50m call sound_clear() ! sleep 30m ! call assert_true(g:id_again > 0) endfunc " vim: shiftwidth=2 sts=2 expandtab --- 59,65 ---- call assert_true(id3 > 0) sleep 50m call sound_clear() ! call WaitForAssert({-> assert_true(g:id > 0)}) endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2104/src/version.c 2020-12-06 21:11:27.386524151 +0100 --- src/version.c 2020-12-06 21:42:46.346029802 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2105, /**/ -- [Another hideous roar.] BEDEVERE: That's it! ARTHUR: What? BEDEVERE: It's The Legendary Black Beast of Aaaaarrrrrrggghhh! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///