Commit 9f59a609 authored by Alexandre Julliard's avatar Alexandre Julliard

mmdevapi/tests: Use float constants with fabsf.

parent d2805206
...@@ -948,15 +948,15 @@ static void test_volume_dependence(void) ...@@ -948,15 +948,15 @@ static void test_volume_dependence(void)
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol); hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.2) < 0.05f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.2f) < 0.05f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = IChannelAudioVolume_GetChannelVolume(cav, 0, &vol); hr = IChannelAudioVolume_GetChannelVolume(cav, 0, &vol);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.4) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol); hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
ok(hr == S_OK, "SAV_GetMasterVolume failed: %08x\n", hr); ok(hr == S_OK, "SAV_GetMasterVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.6) < 0.05f, "SAV_GetMasterVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.6f) < 0.05f, "SAV_GetMasterVolume gave wrong volume: %f\n", vol);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER,
NULL, (void**)&ac2); NULL, (void**)&ac2);
...@@ -976,7 +976,7 @@ static void test_volume_dependence(void) ...@@ -976,7 +976,7 @@ static void test_volume_dependence(void)
hr = IChannelAudioVolume_GetChannelVolume(cav2, 0, &vol); hr = IChannelAudioVolume_GetChannelVolume(cav2, 0, &vol);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.4) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = IAudioStreamVolume_GetChannelVolume(asv2, 0, &vol); hr = IAudioStreamVolume_GetChannelVolume(asv2, 0, &vol);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
......
...@@ -1855,15 +1855,15 @@ static void test_volume_dependence(void) ...@@ -1855,15 +1855,15 @@ static void test_volume_dependence(void)
hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol); hr = IAudioStreamVolume_GetChannelVolume(asv, 0, &vol);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.2) < 0.05f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.2f) < 0.05f, "ASV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = IChannelAudioVolume_GetChannelVolume(cav, 0, &vol); hr = IChannelAudioVolume_GetChannelVolume(cav, 0, &vol);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.4) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol); hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol);
ok(hr == S_OK, "SAV_GetMasterVolume failed: %08x\n", hr); ok(hr == S_OK, "SAV_GetMasterVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.6) < 0.05f, "SAV_GetMasterVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.6f) < 0.05f, "SAV_GetMasterVolume gave wrong volume: %f\n", vol);
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER,
NULL, (void**)&ac2); NULL, (void**)&ac2);
...@@ -1889,7 +1889,7 @@ static void test_volume_dependence(void) ...@@ -1889,7 +1889,7 @@ static void test_volume_dependence(void)
hr = IChannelAudioVolume_GetChannelVolume(cav2, 0, &vol); hr = IChannelAudioVolume_GetChannelVolume(cav2, 0, &vol);
ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "CAV_GetChannelVolume failed: %08x\n", hr);
ok(fabsf(vol - 0.4) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol); ok(fabsf(vol - 0.4f) < 0.05f, "CAV_GetChannelVolume gave wrong volume: %f\n", vol);
hr = IAudioStreamVolume_GetChannelVolume(asv2, 0, &vol); hr = IAudioStreamVolume_GetChannelVolume(asv2, 0, &vol);
ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr); ok(hr == S_OK, "ASV_GetChannelVolume failed: %08x\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment