GCC Code Coverage Report


Directory: ./
File: tests/test-utils.h
Date: 2024-05-04 14:54:39
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 0 0 -%
Branches: 6 12 50.0%

Line Branch Exec Source
1 /*
2 * Unit tests for libfprint
3 * Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include <glib.h>
21
22 typedef enum {
23 FPT_VIRTUAL_DEVICE_IMAGE = 0,
24 FPT_VIRTUAL_DEVICE_NONIMAGE,
25 FPT_VIRTUAL_DEVICE_NONIMAGE_STORAGE,
26 FPT_NUM_VIRTUAL_DEVICE_TYPES
27 } FptVirtualDeviceType;
28
29 void fpt_setup_virtual_device_environment (FptVirtualDeviceType devtype);
30 void fpt_teardown_virtual_device_environment (void);
31
32 typedef struct _FptContext
33 {
34 FpContext *fp_context;
35 FpDevice *device;
36 gpointer user_data;
37 } FptContext;
38
39 FptContext * fpt_context_new (void);
40 FptContext * fpt_context_new_with_virtual_device (FptVirtualDeviceType devtype);
41
42 void fpt_context_free (FptContext *test_context);
43
44
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✗ Branch 28 not taken.
✓ Branch 29 taken 1 times.
✓ Branch 31 taken 1 times.
✗ Branch 32 not taken.
22 G_DEFINE_AUTOPTR_CLEANUP_FUNC (FptContext, fpt_context_free)
45