Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- configure | 1 + configure.ac | 1 + dlls/mfreadwrite/tests/Makefile.in | 5 ++ dlls/mfreadwrite/tests/mfplat.c | 108 +++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 dlls/mfreadwrite/tests/Makefile.in create mode 100644 dlls/mfreadwrite/tests/mfplat.c
diff --git a/configure b/configure index b3a360e..663b6dc 100755 --- a/configure +++ b/configure @@ -19692,6 +19692,7 @@ wine_fn_config_makefile dlls/mf3216 enable_mf3216 wine_fn_config_makefile dlls/mfplat enable_mfplat wine_fn_config_makefile dlls/mfplat/tests enable_tests wine_fn_config_makefile dlls/mfreadwrite enable_mfreadwrite +wine_fn_config_makefile dlls/mfreadwrite/tests enable_tests wine_fn_config_makefile dlls/mfuuid enable_mfuuid wine_fn_config_makefile dlls/mgmtapi enable_mgmtapi wine_fn_config_makefile dlls/midimap enable_midimap diff --git a/configure.ac b/configure.ac index 119c4ce..1b425d2 100644 --- a/configure.ac +++ b/configure.ac @@ -3431,6 +3431,7 @@ WINE_CONFIG_MAKEFILE(dlls/mf3216) WINE_CONFIG_MAKEFILE(dlls/mfplat) WINE_CONFIG_MAKEFILE(dlls/mfplat/tests) WINE_CONFIG_MAKEFILE(dlls/mfreadwrite) +WINE_CONFIG_MAKEFILE(dlls/mfreadwrite/tests) WINE_CONFIG_MAKEFILE(dlls/mfuuid) WINE_CONFIG_MAKEFILE(dlls/mgmtapi) WINE_CONFIG_MAKEFILE(dlls/midimap) diff --git a/dlls/mfreadwrite/tests/Makefile.in b/dlls/mfreadwrite/tests/Makefile.in new file mode 100644 index 0000000..5c906a1 --- /dev/null +++ b/dlls/mfreadwrite/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = mfreadwrite.dll +IMPORTS = ole32 mfplat mfreadwrite mfuuid + +C_SRCS = \ + mfplat.c diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c new file mode 100644 index 0000000..700b61b --- /dev/null +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -0,0 +1,108 @@ +/* + * Copyright 2018 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" + +#include "mfapi.h" +#include "mfidl.h" +#include "mferror.h" +#include "mfreadwrite.h" + +#include "wine/test.h" + +#include "initguid.h" +DEFINE_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO,0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61); +DEFINE_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x0890, 0x4b0e, 0x93, 0x8c, 0x05, 0x43, 0x32, 0xc5, 0x47, 0xe1); + +static HRESULT (WINAPI *pMFCreateMFByteStreamOnStream)(IStream *stream, IMFByteStream **bytestream); + +static void init_functions(void) +{ + HMODULE mod = GetModuleHandleA("mfplat.dll"); + +#define X(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return; + X(MFCreateMFByteStreamOnStream); +#undef X +} + +static void test_MFCreateSourceReaderFromByteStream(void) +{ + static const WCHAR audio[] = {'A','u','d','i','o',0}; + IMFSourceReader *source; + IMFAttributes *attributes; + IMFByteStream *bytestream = NULL; + IStream *stream = NULL; + HRESULT hr; + + if(!pMFCreateMFByteStreamOnStream) + { + win_skip("MFCreateMFByteStreamOnStream() not found\n"); + return; + } + + hr = MFCreateAttributes( &attributes, 3 ); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMFAttributes_SetString(attributes, &MF_READWRITE_MMCSS_CLASS_AUDIO, audio); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMFAttributes_SetUINT32(attributes, &MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = pMFCreateMFByteStreamOnStream(stream, &bytestream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = MFCreateSourceReaderFromByteStream(bytestream, attributes, &source); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if(stream) + IStream_Release(stream); + if(bytestream) + IMFByteStream_Release(bytestream); + IMFAttributes_Release(attributes); + IMFSourceReader_Release(source); +} + +START_TEST(mfplat) +{ + HRESULT hr; + + CoInitialize(NULL); + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + init_functions(); + + test_MFCreateSourceReaderFromByteStream(); + + MFShutdown(); + + CoUninitialize(); +}
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46837
Your paranoid android.
=== w7u (32 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 0aa4:mfplat: unhandled exception c0000005 at 00401875
=== w7pro64 (32 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 0a98:mfplat: unhandled exception c0000005 at 00401875
=== w8 (32 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 0d94:mfplat: unhandled exception c0000005 at 00401875
=== w8adm (32 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 0da4:mfplat: unhandled exception c0000005 at 00401875
=== w864 (32 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 0aec:mfplat: unhandled exception c0000005 at 00401875
=== w1064 (32 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 07b8:mfplat: unhandled exception c0000005 at 00401875
=== w7pro64 (64 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 0adc:mfplat: unhandled exception c0000005 at 000000000040183F
=== w864 (64 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 059c:mfplat: unhandled exception c0000005 at 000000000040183F
=== w1064 (64 bit report) ===
mfreadwrite: mfplat.c:82: Test failed: got 0xc00d36c4 07b0:mfplat: unhandled exception c0000005 at 000000000040183F