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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202106071829.157ITLq3638197%40masaka.moolenaar.net.