GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 1 / 0 / 1
Functions: -% 0 / 0 / 0
Branches: 50.0% 5 / 0 / 10

tests/test-utils.h
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 #pragma once
21
22 #include <glib.h>
23
24 typedef enum {
25 FPT_VIRTUAL_DEVICE_IMAGE = 0,
26 FPT_VIRTUAL_DEVICE_NONIMAGE,
27 FPT_VIRTUAL_DEVICE_NONIMAGE_STORAGE,
28 FPT_NUM_VIRTUAL_DEVICE_TYPES
29 } FptVirtualDeviceType;
30
31 void fpt_setup_virtual_device_environment (FptVirtualDeviceType devtype);
32 void fpt_teardown_virtual_device_environment (void);
33
34 typedef struct _FptContext
35 {
36 FpContext *fp_context;
37 FpDevice *device;
38 gpointer user_data;
39 } FptContext;
40
41 FptContext * fpt_context_new (void);
42 FptContext * fpt_context_new_with_virtual_device (FptVirtualDeviceType devtype);
43
44 void fpt_context_free (FptContext *test_context);
45
46
5/10
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 1 time.
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 13 taken 1 time.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 16 not taken.
✓ Branch 17 → 18 taken 2 times.
✗ Branch 17 → 19 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 20 not taken.
22 G_DEFINE_AUTOPTR_CLEANUP_FUNC (FptContext, fpt_context_free)
47