Michael Stefaniuc : xaudio2_7/tests: Remove redundant not-NULL checks ( coccinellery).
Alexandre Julliard
julliard at winehq.org
Mon Mar 18 16:20:16 CDT 2019
Module: wine
Branch: master
Commit: 61d825ca3ed57ddec4a07f2e62f87432386a8daf
URL: https://source.winehq.org/git/wine.git/?a=commit;h=61d825ca3ed57ddec4a07f2e62f87432386a8daf
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Fri Mar 8 21:16:53 2019 +0100
xaudio2_7/tests: Remove redundant not-NULL checks (coccinellery).
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/xaudio2_7/tests/xaudio2.c | 104 ++++++++++++++++++++---------------------
1 file changed, 50 insertions(+), 54 deletions(-)
diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c
index 4ead8d8..f2bffdf 100644
--- a/dlls/xaudio2_7/tests/xaudio2.c
+++ b/dlls/xaudio2_7/tests/xaudio2.c
@@ -1000,28 +1000,9 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
return;
}
- if(pCreateFX){
- for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
- hr = pCreateFX(const_clsids[i], &fx_unk);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
- if(SUCCEEDED(hr)){
- IXAPO *xapo;
- hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
- ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
- if(SUCCEEDED(hr))
- IXAPO_Release(xapo);
- IUnknown_Release(fx_unk);
- }
-
- hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
- &IID_IUnknown, (void**)&fx_unk);
- ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
- if(SUCCEEDED(hr))
- IUnknown_Release(fx_unk);
- }
-
- hr = pCreateFX(avm_clsids[version - 20], &fx_unk);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(avm_clsids[version - 20]), hr);
+ for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
+ hr = pCreateFX(const_clsids[i], &fx_unk);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
if(SUCCEEDED(hr)){
IXAPO *xapo;
hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
@@ -1031,16 +1012,33 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
IUnknown_Release(fx_unk);
}
- hr = pCreateFX(ar_clsids[version - 20], &fx_unk);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(ar_clsids[version - 20]), hr);
- if(SUCCEEDED(hr)){
- IXAPO *xapo;
- hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
- ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
- if(SUCCEEDED(hr))
- IXAPO_Release(xapo);
+ hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void**)&fx_unk);
+ ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
+ if(SUCCEEDED(hr))
IUnknown_Release(fx_unk);
- }
+ }
+
+ hr = pCreateFX(avm_clsids[version - 20], &fx_unk);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(avm_clsids[version - 20]), hr);
+ if(SUCCEEDED(hr)){
+ IXAPO *xapo;
+ hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
+ ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IXAPO_Release(xapo);
+ IUnknown_Release(fx_unk);
+ }
+
+ hr = pCreateFX(ar_clsids[version - 20], &fx_unk);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(ar_clsids[version - 20]), hr);
+ if(SUCCEEDED(hr)){
+ IXAPO *xapo;
+ hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
+ ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IXAPO_Release(xapo);
+ IUnknown_Release(fx_unk);
}
FreeLibrary(xapofxdll);
@@ -1083,29 +1081,9 @@ static void test_xapo_creation_modern(const char *module)
return;
}
- if(pCreateFX){
- for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
- hr = pCreateFX(const_clsids[i], &fx_unk, NULL, 0);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
- if(SUCCEEDED(hr)){
- IXAPO *xapo;
- hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
- ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr);
- if(SUCCEEDED(hr))
- IXAPO_Release(xapo);
- IUnknown_Release(fx_unk);
- }
-
- hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
- &IID_IUnknown, (void**)&fx_unk);
- ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
- if(SUCCEEDED(hr))
- IUnknown_Release(fx_unk);
- }
-
- /* test legacy CLSID */
- hr = pCreateFX(&CLSID_AudioVolumeMeter27, &fx_unk, NULL, 0);
- ok(hr == S_OK, "%s: CreateFX(CLSID_AudioVolumeMeter) failed: %08x\n", module, hr);
+ for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
+ hr = pCreateFX(const_clsids[i], &fx_unk, NULL, 0);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
if(SUCCEEDED(hr)){
IXAPO *xapo;
hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
@@ -1114,6 +1092,24 @@ static void test_xapo_creation_modern(const char *module)
IXAPO_Release(xapo);
IUnknown_Release(fx_unk);
}
+
+ hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void**)&fx_unk);
+ ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IUnknown_Release(fx_unk);
+ }
+
+ /* test legacy CLSID */
+ hr = pCreateFX(&CLSID_AudioVolumeMeter27, &fx_unk, NULL, 0);
+ ok(hr == S_OK, "%s: CreateFX(CLSID_AudioVolumeMeter) failed: %08x\n", module, hr);
+ if(SUCCEEDED(hr)){
+ IXAPO *xapo;
+ hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
+ ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IXAPO_Release(xapo);
+ IUnknown_Release(fx_unk);
}
pCAVM = (void*)GetProcAddress(xaudio2dll, "CreateAudioVolumeMeter");
More information about the wine-cvs
mailing list