diff options
author | Dominique Pelle <dominique.pelle@gmail.com> | 2021-06-07 20:28:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-07 20:28:45 +0200 |
commit | 2f9c209ba089d81fd727122bbe0ae1da00585d80 (patch) | |
tree | 4ee448faaf8f361c45f07e1cb33361a28d5c7bb5 /src | |
parent | f7a023e580c695e86f68228adcf5c9e6ea00a4d5 (diff) | |
download | vim-git-2f9c209ba089d81fd727122bbe0ae1da00585d80.tar.gz |
patch 8.2.2959: sound_playfile() is not tested on MS-Windowsv8.2.2959
Problem: sound_playfile() is not tested on MS-Windows.
Solution: Make it work and enable the test. (Dominique Pellé, closes #8338)
Diffstat (limited to 'src')
-rw-r--r-- | src/sound.c | 5 | ||||
-rw-r--r-- | src/testdir/test_sound.vim | 20 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 13 insertions, 14 deletions
diff --git a/src/sound.c b/src/sound.c index 9d91f6c08..702fd257a 100644 --- a/src/sound.c +++ b/src/sound.c @@ -355,10 +355,9 @@ f_sound_playevent(typval_T *argvars, typval_T *rettv) if (wp == NULL) return; - PlaySoundW(wp, NULL, SND_ASYNC | SND_ALIAS); + if (PlaySoundW(wp, NULL, SND_ASYNC | SND_ALIAS)) + rettv->vval.v_number = ++sound_id; free(wp); - - rettv->vval.v_number = ++sound_id; } void diff --git a/src/testdir/test_sound.vim b/src/testdir/test_sound.vim index cc01bf6a7..ff58262bf 100644 --- a/src/testdir/test_sound.vim +++ b/src/testdir/test_sound.vim @@ -75,17 +75,15 @@ func Test_play_silent() 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())) + " 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())) diff --git a/src/version.c b/src/version.c index e39ee98fc..13a520047 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2959, +/**/ 2958, /**/ 2957, |