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

device: Return 'verify-no-match' on cancelled verification

We were returning a 'verify-unknown-error' while we actually know what
happened, so better to return a soft operation failure.
parent b312a5e5
...@@ -345,6 +345,8 @@ verify_result_to_name (gboolean match, GError *error) ...@@ -345,6 +345,8 @@ verify_result_to_name (gboolean match, GError *error)
*/ */
if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_PROTO)) if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_PROTO))
return "verify-disconnect"; return "verify-disconnect";
else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return "verify-no-match";
return "verify-unknown-error"; return "verify-unknown-error";
} }
...@@ -527,6 +527,19 @@ class FPrintdVirtualDeviceTest(FPrintdTest): ...@@ -527,6 +527,19 @@ class FPrintdVirtualDeviceTest(FPrintdTest):
self.device.EnrollStop() self.device.EnrollStop()
self.wait_for_result(expected='enroll-failed') self.wait_for_result(expected='enroll-failed')
def test_verify_stop_cancels(self):
self.device.Claim('(s)', 'testuser')
self.device.VerifyStart('(s)', 'any')
def test_verify_finger_stop_cancels(self):
self.device.Claim('(s)', 'testuser')
self.enroll_image('whorl', finger='left-thumb')
self.device.VerifyStart('(s)', 'left-thumb')
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":
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