mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
fp-device: Do not setup current action before updating temperature
At every action we update the device temperature, and this can potentially lead to a failure, if the temperature is too hot. However in such case we were failing a task that we had just stolen, causing an error, tasks never returning and the device was left in an undefined state. So, just return early in case temperature is too hot, as we don't really need to have the current task or action set at this point because there's no active action to cancel yet. This was causing random errors when running tests under valgrind
This commit is contained in:
@@ -2388,6 +2388,11 @@ test_driver_identify_warmup_cooldown (void)
|
||||
g_assert_true (identify_data->called);
|
||||
g_assert_error (identify_data->error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_TOO_HOT);
|
||||
|
||||
/* Try to identify again, and ensure that we fail early */
|
||||
fp_device_identify_sync (device, prints, NULL, NULL, NULL, NULL, NULL, &error);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_TOO_HOT);
|
||||
g_clear_error (&error);
|
||||
|
||||
/* Now, wait for it to cool down again;
|
||||
* WARM should be reached after about 2s
|
||||
* COLD after 5s but give it some more slack. */
|
||||
|
||||
Reference in New Issue
Block a user