Patch 8.2.2959

4 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 7, 2021, 2:29:28 PM6/7/21
to vim...@googlegroups.com

Patch 8.2.2959
Problem: sound_playfile() is not tested on MS-Windows.
Solution: Make it work and enable the test. (Dominique Pellé, closes #8338)
Files: src/sound.c, src/testdir/test_sound.vim


*** ../vim-8.2.2958/src/sound.c 2020-01-04 16:13:44.408524644 +0100
--- src/sound.c 2021-06-07 20:27:52.709698461 +0200
***************
*** 355,364 ****
if (wp == NULL)
return;

! PlaySoundW(wp, NULL, SND_ASYNC | SND_ALIAS);
free(wp);
-
- rettv->vval.v_number = ++sound_id;
}

void
--- 355,363 ----
if (wp == NULL)
return;

! if (PlaySoundW(wp, NULL, SND_ASYNC | SND_ALIAS))
! rettv->vval.v_number = ++sound_id;
free(wp);
}

void
*** ../vim-8.2.2958/src/testdir/test_sound.vim 2021-06-06 15:07:05.624372128 +0200
--- src/testdir/test_sound.vim 2021-06-07 20:28:19.149641143 +0200
***************
*** 75,91 ****
endfunc

func Test_play_event_error()
! " Do not run test on Windows as:
! " - playing event with callback is not supported on Windows.
! " - FIXME: even without callback, sound_playevent('') does not return 0 on Windows. Bug?
! CheckNotMSWindows
!
! call assert_equal(0, sound_playevent(''))
! call assert_equal(0, sound_playevent(test_null_string()))
! call assert_equal(0, sound_playevent('doesnotexist'))
! call assert_equal(0, sound_playevent('doesnotexist', 'doesnotexist'))
! call assert_equal(0, sound_playevent(test_null_string(), test_null_string()))
! call assert_equal(0, sound_playevent(test_null_string(), test_null_function()))

call assert_equal(0, sound_playfile(''))
call assert_equal(0, sound_playfile(test_null_string()))
--- 75,89 ----
endfunc

func Test_play_event_error()
! " FIXME: sound_playevent() doesn't return 0 in case of error on Windows.
! if !has('win32')
! call assert_equal(0, sound_playevent(''))
! call assert_equal(0, sound_playevent(test_null_string()))
! call assert_equal(0, sound_playevent('doesnotexist'))
! call assert_equal(0, sound_playevent('doesnotexist', 'doesnotexist'))
! call assert_equal(0, sound_playevent(test_null_string(), test_null_string()))
! call assert_equal(0, sound_playevent(test_null_string(), test_null_function()))
! endif

call assert_equal(0, sound_playfile(''))
call assert_equal(0, sound_playfile(test_null_string()))
*** ../vim-8.2.2958/src/version.c 2021-06-07 18:49:58.620217338 +0200
--- src/version.c 2021-06-07 20:26:55.101822164 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2959,
/**/

--
To keep milk from turning sour: Keep it in the cow.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages