mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 10:34:18 +00:00
test-fp-context-tod: Try to open/close a device from the public library
We need to skip this for devices with no close vfunc (like the SSM one)
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#define FP_COMPONENT "tod"
|
#define FP_COMPONENT "tod"
|
||||||
|
|
||||||
#include "fpi-log.h"
|
#include "fpi-log.h"
|
||||||
|
#include "fpi-device.h"
|
||||||
#include <libfprint/fprint.h>
|
#include <libfprint/fprint.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -77,6 +78,19 @@ test_context_has_fake_device (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_assert_true (FP_IS_DEVICE (fake_device));
|
g_assert_true (FP_IS_DEVICE (fake_device));
|
||||||
|
|
||||||
|
if (FP_DEVICE_GET_CLASS (fake_device)->open)
|
||||||
|
{
|
||||||
|
GCancellable *cancellable;
|
||||||
|
g_assert_true (fp_device_open_sync (fake_device, NULL, NULL));
|
||||||
|
g_assert_false (fp_device_open_sync (fake_device, NULL, NULL));
|
||||||
|
g_assert_true (fp_device_close_sync (fake_device, NULL, NULL));
|
||||||
|
|
||||||
|
cancellable = g_cancellable_new ();
|
||||||
|
g_cancellable_cancel (cancellable);
|
||||||
|
g_assert_false (fp_device_open_sync (fake_device, cancellable, NULL));
|
||||||
|
g_clear_object (&cancellable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user