Rémi Bernon (@rbernon) commented about dlls/windows.devices.bluetooth/tests/bluetooth.c:
* allows testing the watcher with custom advertisements as well. */
- if (winetest_interactive)
SleepEx( 10000, FALSE );
- hr = IBluetoothLEAdvertisementWatcher_Stop( watcher );
- todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
- ret = WaitForSingleObject( stopped_data.event, 5000 );
- todo_wine ok( !ret, "got ret %lu.\n", ret );
- /* The watcher should not have stopped with BluetoothError_RadioNotAvailable. */
- ok( !stopped_data.no_radio, "got no_radio %d.\n", stopped_data.no_radio );
- /* Calling Stop for a stopped watcher also does not result in any errors, but also does not dispatch any more Stopped events. */
- hr = IBluetoothLEAdvertisementWatcher_Stop( watcher );
- todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
- ret = WaitForSingleObject( stopped_data.event, 1000 );
- ok( ret == WAIT_TIMEOUT, "got ret %lu.\n", ret );
It's usually preferred to keep the timeouts smaller if we're expecting a timeout, something like 10ms or 100ms instead should be good enough. It might not be as accurate but we want to avoid wasting time unnecessarily in the tests.