Commit b312a5e5 authored by Marco Trevisan's avatar Marco Trevisan Committed by Bastien Nocera
Browse files

device: Return 'enroll-failed' on cancelled enrollment

We were returning an 'enroll-unknown-error' while we actually know what
happened, so better to return a soft operation failure.
parent c12778ec
...@@ -381,6 +381,8 @@ enroll_result_to_name (gboolean completed, gboolean enrolled, GError *error) ...@@ -381,6 +381,8 @@ enroll_result_to_name (gboolean completed, gboolean enrolled, GError *error)
return "enroll-disconnected"; return "enroll-disconnected";
else if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_FULL)) else if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_FULL))
return "enroll-data-full"; return "enroll-data-full";
else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return "enroll-failed";
return "enroll-unknown-error"; return "enroll-unknown-error";
} }
......
...@@ -521,6 +521,13 @@ class FPrintdVirtualDeviceTest(FPrintdTest): ...@@ -521,6 +521,13 @@ class FPrintdVirtualDeviceTest(FPrintdTest):
self.device.Release() self.device.Release()
def test_enroll_stop_cancels(self):
self.device.Claim('(s)', 'testuser')
self.device.EnrollStart('(s)', 'left-index-finger')
self.device.EnrollStop()
self.wait_for_result(expected='enroll-failed')
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) == 2 and sys.argv[1] == "list-tests": if len(sys.argv) == 2 and sys.argv[1] == "list-tests":
for machine, human in list_tests(): for machine, human in list_tests():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment