GCC Code Coverage Report


Directory: common/src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 5 / 0 / 5
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 6 / 0 / 6

fxe_system_time_get.c
Line Branch Exec Source
1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 * Copyright (c) 2026-present Eclipse ThreadX contributors
4 *
5 * This program and the accompanying materials are made available under the
6 * terms of the MIT License which is available at
7 * https://opensource.org/licenses/MIT.
8 *
9 * SPDX-License-Identifier: MIT
10 **************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** FileX Component */
17 /** */
18 /** System */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define FX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "fx_api.h"
29 #include "fx_system.h"
30
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _fxe_system_time_get PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* William E. Lamie, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function checks of errors in the get system time call. */
45 /* */
46 /* INPUT */
47 /* */
48 /* hour Pointer to hour */
49 /* minute Pointer to minute */
50 /* second Pointer to second */
51 /* */
52 /* OUTPUT */
53 /* */
54 /* FX_PTR_ERROR Invalid destination pointer */
55 /* status Actual completion status */
56 /* */
57 /* CALLS */
58 /* */
59 /* _fx_system_time_get Actual get time service */
60 /* */
61 /* CALLED BY */
62 /* */
63 /* Application Code */
64 /* */
65 /**************************************************************************/
66 32 UINT _fxe_system_time_get(UINT *hour, UINT *minute, UINT *second)
67 {
68
69 UINT status;
70
71
72 /* Check for an invalid destination pointer. */
73
6/6
✓ Branch 2 → 3 taken 24 times.
✓ Branch 2 → 5 taken 8 times.
✓ Branch 3 → 4 taken 16 times.
✓ Branch 3 → 5 taken 8 times.
✓ Branch 4 → 5 taken 8 times.
✓ Branch 4 → 6 taken 8 times.
32 if ((hour == FX_NULL) || (minute == FX_NULL) || (second == FX_NULL))
74 {
75 24 return(FX_PTR_ERROR);
76 }
77
78 /* Call actual get time service. */
79 8 status = _fx_system_time_get(hour, minute, second);
80
81 /* Return status. */
82 8 return(status);
83 }
84
85