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
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()))