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_date_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_date_get PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* William E. Lamie, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function checks for errors in the get system date call. */
45 /* */
46 /* INPUT */
47 /* */
48 /* year Pointer to year */
49 /* month Pointer to month */
50 /* day Pointer to day */
51 /* */
52 /* OUTPUT */
53 /* */
54 /* FX_PTR_ERROR Invalid destination pointer */
55 /* status Actual completion status */
56 /* */
57 /* CALLS */
58 /* */
59 /* _fx_system_date_get Actual get system date call */
60 /* */
61 /* CALLED BY */
62 /* */
63 /* Application Code */
64 /* */
65 /**************************************************************************/
66 32 UINT _fxe_system_date_get(UINT *year, UINT *month, UINT *day)
67 {
68
69 UINT status;
70
71
72 /* Check for an invalid 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 ((year == FX_NULL) || (month == FX_NULL) || (day == FX_NULL))
74 {
75 24 return(FX_PTR_ERROR);
76 }
77
78 /* Call actual service to get the system date. */
79 8 status = _fx_system_date_get(year, month, day);
80
81 /* Return status. */
82 8 return(status);
83 }
84
85