fpi-device: Only mark a device as closed if the operation succeeded

We may fail during the close phase, in such case the device should not be
marked as closed.
This commit is contained in:
Marco Trevisan (Treviño)
2020-01-17 16:51:48 +01:00
parent b3a4c2cf9a
commit 027ac8d843
2 changed files with 10 additions and 5 deletions

View File

@@ -386,6 +386,7 @@ test_driver_close_error (void)
g_assert (fake_dev->last_called_function == dev_class->close);
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
g_assert (error == g_steal_pointer (&fake_dev->ret_error));
g_assert_true (fp_device_is_open (device));
}
static void