elan: Add umockdev based test

Unfortunately, the timeout handling cannot be simulated properly. This
also adds a workaround in the driver to not consider it a protocol error
if this happens.
This commit is contained in:
Benjamin Berg
2020-01-03 15:20:23 +01:00
parent 8992e559f8
commit c27a4faeca
6 changed files with 427 additions and 1 deletions

View File

@@ -549,7 +549,11 @@ capture_run_state (FpiSsm *ssm, FpDevice *dev)
}
else
{
fpi_ssm_mark_failed (ssm, fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
/* XXX: The timeout is emulated incorrectly, resulting in a zero byte read. */
if (g_strcmp0 (g_getenv ("FP_DEVICE_EMULATION"), "1") == 0)
fpi_ssm_mark_completed (ssm);
else
fpi_ssm_mark_failed (ssm, fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
}
break;