From: Giovanni Mascellani <gmascellani@codeweavers.com> This reverts commit c18070ca049d2b598550fce5cc5fb46a61dc2d54, in preparation to a more systematic way to test format compatibility in winmm. --- dlls/winmm/tests/wave.c | 62 ++++++----------------------------------- 1 file changed, 9 insertions(+), 53 deletions(-) diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c index dd349d0d9da..43779ed8519 100644 --- a/dlls/winmm/tests/wave.c +++ b/dlls/winmm/tests/wave.c @@ -1771,8 +1771,7 @@ static void test_reentrant_callback(void) CloseHandle(hevent); } -static void create_wav_file(char *temp_file, WORD format_tag, unsigned int channels, - unsigned int bits_per_sample, unsigned int samples_per_sec) +static void create_wav_file(char *temp_file) { WAVEFORMATEX format; HMMIO h; @@ -1782,13 +1781,13 @@ static void create_wav_file(char *temp_file, WORD format_tag, unsigned int chann DWORD length; char *buffer; - format.wFormatTag = format_tag; + format.wFormatTag=WAVE_FORMAT_PCM; format.cbSize = 0; - format.nChannels = channels; - format.wBitsPerSample = bits_per_sample; - format.nSamplesPerSec = samples_per_sec; - format.nBlockAlign = format.nChannels * format.wBitsPerSample / 8; - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; + format.nChannels=1; + format.wBitsPerSample=8; + format.nSamplesPerSec=8000; + format.nBlockAlign=format.nChannels*format.wBitsPerSample/8; + format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign; h = mmioOpenA(temp_file, NULL, MMIO_ALLOCBUF | MMIO_WRITE | MMIO_CREATE); ok(h != NULL, "Can't open temp_file\n"); @@ -1824,11 +1823,6 @@ static void create_wav_file(char *temp_file, WORD format_tag, unsigned int chann ok(rc == MMSYSERR_NOERROR, "mmioClose failed, got %u\n", rc); } -static const unsigned int sampling_rates[] = { 8000, 44100, 96000 }; -static const unsigned int channel_counts[] = { 1, 2 }; -static const unsigned int sample_formats[][2] = { {WAVE_FORMAT_PCM, 8}, {WAVE_FORMAT_PCM, 16}, - {WAVE_FORMAT_PCM, 32}, {WAVE_FORMAT_IEEE_FLOAT, 32} }; - static void test_PlaySound(void) { BOOL br; @@ -1847,10 +1841,7 @@ static void test_PlaySound(void) GetTempPathA(sizeof(test_file), test_file); strcat(test_file, "mysound.wav"); - - /* Test some filename quirks. */ - - create_wav_file(test_file, WAVE_FORMAT_PCM, 1, 8, 8000); + create_wav_file(test_file); br = PlaySoundA(test_file, NULL, SND_FILENAME | SND_NODEFAULT); ok(br, "PlaySound failed, got %d\n", br); @@ -1874,42 +1865,7 @@ static void test_PlaySound(void) DeleteFileA(test_file); - /* Test many different formats. */ - for (unsigned int i = 0; i < ARRAY_SIZE(sampling_rates); ++i) - { - winetest_push_context("rate %u", sampling_rates[i]); - - for (unsigned int j = 0; j < ARRAY_SIZE(channel_counts); ++j) - { - winetest_push_context("channel count %u", channel_counts[j]); - - for (unsigned int k = 0; k < ARRAY_SIZE(sample_formats); ++k) - { - winetest_push_context("type %s, depth %u", sample_formats[k][0] == WAVE_FORMAT_PCM ? "PCM" : "float", - sample_formats[k][1]); - - create_wav_file(test_file, sample_formats[k][0], channel_counts[j], - sample_formats[k][1], sampling_rates[i]); - - br = PlaySoundA(test_file, NULL, SND_FILENAME | SND_NODEFAULT); - ok(br, "PlaySound failed, got %d\n", br); - - /* SND_ALIAS fallbacks to SND_FILENAME */ - br = PlaySoundA(test_file, NULL, SND_ALIAS | SND_NODEFAULT); - ok(br, "PlaySound failed, got %d\n", br); - - DeleteFileA(test_file); - - winetest_pop_context(); - } - - winetest_pop_context(); - } - - winetest_pop_context(); - } - - /* Test a few more exotic formats. */ + /* Test a few exotic formats. */ br = PlaySoundA("test_s24le.wav", GetModuleHandleA(NULL), SND_RESOURCE | SND_NODEFAULT); ok(br, "PlaySound failed, got %d\n", br); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10175