]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1985: tests: test_sound.vim fails on Windows v9.1.1985
authorMuraoka Taro <koron.kaoriya@gmail.com>
Tue, 16 Dec 2025 18:51:26 +0000 (19:51 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 16 Dec 2025 18:51:26 +0000 (19:51 +0100)
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

src/testdir/test_sound.vim
src/version.c

index fba904c1dd099086b289ff198fa95ca69da0626e..852b5931da98f85f06830478ecf8379ada477d39 100644 (file)
@@ -33,9 +33,14 @@ func Test_play_event()
 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)
index 7539181d91cb012428441017ded7e53832358dd9..27c364c1b7b0dbea5898452eb6a0b32267741b32 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1985,
 /**/
     1984,
 /**/