mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 02:28:05 +00:00
tests: Move tod context creation into test-utils-tod library
This commit is contained in:
@@ -19,37 +19,7 @@
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
#include "test-utils.h"
|
||||
|
||||
static FptContext *
|
||||
fpt_context_new_with_fake_dev (void)
|
||||
{
|
||||
FptContext *tctx;
|
||||
GPtrArray *devices;
|
||||
unsigned int i;
|
||||
|
||||
tctx = fpt_context_new ();
|
||||
devices = fp_context_get_devices (tctx->fp_context);
|
||||
|
||||
g_assert_nonnull (devices);
|
||||
g_assert_cmpuint (devices->len, ==, 1);
|
||||
|
||||
for (i = 0; i < devices->len; ++i)
|
||||
{
|
||||
FpDevice *device = devices->pdata[i];
|
||||
|
||||
if (g_strcmp0 (fp_device_get_driver (device), "fake_test_dev") == 0)
|
||||
{
|
||||
tctx->device = device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_assert_true (FP_IS_DEVICE (tctx->device));
|
||||
g_object_add_weak_pointer (G_OBJECT (tctx->device), (gpointer) & tctx->device);
|
||||
|
||||
return tctx;
|
||||
}
|
||||
#include "test-utils-tod.h"
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, FptContext *tctx)
|
||||
|
||||
Reference in New Issue
Block a user