[PATCH 0/1] MR9707: devenum/tests: Skip test if no video capture device is present.
This patch copies the same skip seen in [qcap/tests/videocapture.c](https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/qcap/tests/videocaptu...). This is to avoid the test crashing with wine and windows. [Test pattern page](https://test.winehq.org/data/patterns.html#devenum:devenum) Followup to 9f3ca141da. <details> <summary>ASan crash report</summary> ``` ================================================================= ==devenum_test.exe==472==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000000 (pc 0x0001400098c3 bp 0x7ffffe1ffa50 sp 0x7ffffe1ffa30 T0) ==devenum_test.exe==472==The signal is caused by a READ memory access. ==devenum_test.exe==472==Hint: address points to the zero page. #0 0x0001400098c2 in IEnumMoniker_Next Z:\builds\bernhardu\wine\build64\include\objidl.h:6841 #1 0x0001400094c5 in test_video_input Z:\builds\bernhardu\wine\build64\..\dlls\devenum\tests\devenum.c:1173 #2 0x0001400010d0 in func_devenum Z:\builds\bernhardu\wine\build64\..\dlls\devenum\tests\devenum.c:1224 #3 0x00014000e4d2 in run_test+0x102 (C:\users\gitlab\AppData\Local\Temp\wct\devenum_test.exe+0x14000e4d2) #4 0x00014000df4c in main+0x4bc (C:\users\gitlab\AppData\Local\Temp\wct\devenum_test.exe+0x14000df4c) #5 0x00014001006a in mainCRTStartup Z:\builds\bernhardu\wine\build64\..\dlls\msvcrt\crt_main.c:62 #6 0x6fffffc37a64 (C:\windows\system32\kernel32.dll+0x178027a64) #7 0x6fffffdc08b6 (C:\windows\system32\ntdll.dll+0x1700508b6) ==devenum_test.exe==472==Register values: rax = 0 rbx = 7ffffe1ffb80 rcx = 0 rdx = 140100000 rdi = 7ffffe1ffaa0 rsi = 1 rbp = 7ffffe1ffa50 rsp = 7ffffe1ffa30 r8 = 7ffffe1ffae0 r9 = 0 r10 = 8 r11 = 202 r12 = 140100000 r13 = fffffc3ff90 r14 = 7ffffe1ffae0 r15 = 0 AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: access-violation Z:\builds\bernhardu\wine\build64\include\objidl.h:6841 in IEnumMoniker_Next ==devenum_test.exe==472==ABORTING ``` </details> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9707
From: Bernhard Übelacker <bernhardu(a)mailbox.org> Followup to 9f3ca141da. --- dlls/devenum/tests/devenum.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/devenum/tests/devenum.c b/dlls/devenum/tests/devenum.c index ccc4eb3b5b2..5caf942a0f0 100644 --- a/dlls/devenum/tests/devenum.c +++ b/dlls/devenum/tests/devenum.c @@ -1168,6 +1168,13 @@ static void test_video_input(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_VideoInputDeviceCategory, &mon, 0); + if (hr == S_FALSE) + { + skip("No video capture devices present.\n"); + ICreateDevEnum_Release(create_devenum); + CoUninitialize(); + return; + } ok(hr == S_OK, "Got hr %#lx.\n", hr); while (IEnumMoniker_Next(mon, 1, &moniker, NULL) == S_OK) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9707
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9707
participants (2)
-
Bernhard Übelacker -
Elizabeth Figura (@zfigura)