Problem: tests: test_sound.vim fails when run locally on Windows
Solution: Skip Test_play_silent in Windows non-GUI environments.
Cause: There are two causes:
1) The global variable g:id is undefined, causing an undefined
reference. Due to the execution order of test cases, g:id is defined in
Test_play_event. However, on Windows, this test is skipped, so g:id is
not defined. It is referenced in Test_play_silent's WaitForAssert()
without being defined, resulting in an undefined error.
Solution: Define g:id at the beginning of Test_play_silent.
2) In the non-GUI Windows version of vim, there is no message loop,
so the callback when play file sound ends does not occur, and
Test_play_silent's WaitForAssert times out and fails. In CI,
sound_playfile() returns 0, so Test_play_silent is skipped. The
reason for this is unknown, but it may be because CI is running on
Windows Server or something like that.
Solution: Skip Test_play_silent in Windows non-GUI environments.
Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
closes: #18941
endfunc
func Test_play_silent()
+ if has('win32') && !has('gui_running')
+ throw 'Skipped: Playing file with callback is not supported on Windows, non-GUI'
+ endif
+
let fname = fnamemodify('silent.wav', '%p')
let g:playcallback_count = 0
let g:result = -1
+ let g:id = 0
" play without callback
let id1 = sound_playfile(fname)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1985,
/**/
1984,
/**/