GCC Code Coverage Report


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

fxe_directory_information_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 /** Directory */
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_directory.h"
30
31 FX_CALLER_CHECKING_EXTERNS
32
33
34 /**************************************************************************/
35 /* */
36 /* FUNCTION RELEASE */
37 /* */
38 /* _fxe_directory_information_get PORTABLE C */
39 /* 6.1 */
40 /* AUTHOR */
41 /* */
42 /* William E. Lamie, Microsoft Corporation */
43 /* */
44 /* DESCRIPTION */
45 /* */
46 /* This function checks for errors in the directory information */
47 /* get call. */
48 /* */
49 /* INPUT */
50 /* */
51 /* media_ptr Media control block pointer */
52 /* directory_name Directory name pointer */
53 /* attributes Pointer to attributes */
54 /* size Pointer to size */
55 /* year Pointer to year */
56 /* month Pointer to month */
57 /* day Pointer to day */
58 /* hour Pointer to hour */
59 /* minute Pointer to minute */
60 /* second Pointer to second */
61 /* */
62 /* OUTPUT */
63 /* */
64 /* return status */
65 /* */
66 /* CALLS */
67 /* */
68 /* _fx_directory_information_get Actual directory information */
69 /* get service */
70 /* */
71 /* CALLED BY */
72 /* */
73 /* Application Code */
74 /* */
75 /**************************************************************************/
76 9034 UINT _fxe_directory_information_get(FX_MEDIA *media_ptr, CHAR *directory_name,
77 UINT *attributes, ULONG *size,
78 UINT *year, UINT *month, UINT *day,
79 UINT *hour, UINT *minute, UINT *second)
80 {
81
82 UINT status;
83
84
85 /* Check for a null media pointer or all null return parameter pointers. */
86
4/4
✓ Branch 2 → 3 taken 8344 times.
✓ Branch 2 → 11 taken 690 times.
✓ Branch 3 → 4 taken 5544 times.
✓ Branch 3 → 12 taken 2800 times.
9034 if ((media_ptr == FX_NULL) ||
87
8/8
✓ Branch 4 → 5 taken 4854 times.
✓ Branch 4 → 12 taken 690 times.
✓ Branch 5 → 6 taken 4164 times.
✓ Branch 5 → 12 taken 690 times.
✓ Branch 6 → 7 taken 3474 times.
✓ Branch 6 → 12 taken 690 times.
✓ Branch 7 → 8 taken 2784 times.
✓ Branch 7 → 12 taken 690 times.
5544 ((attributes == FX_NULL) && (size == FX_NULL) && (year == FX_NULL) && (month == FX_NULL) &&
88
6/6
✓ Branch 8 → 9 taken 2094 times.
✓ Branch 8 → 12 taken 690 times.
✓ Branch 9 → 10 taken 1396 times.
✓ Branch 9 → 12 taken 698 times.
✓ Branch 10 → 11 taken 698 times.
✓ Branch 10 → 12 taken 698 times.
2784 (day == FX_NULL) && (hour == FX_NULL) && (minute == FX_NULL) && (second == FX_NULL)))
89 {
90 1388 return(FX_PTR_ERROR);
91 }
92
93 /* Check for a valid caller. */
94
6/6
✓ Branch 12 → 13 taken 1408 times.
✓ Branch 12 → 15 taken 6210 times.
✓ Branch 13 → 14 taken 718 times.
✓ Branch 13 → 15 taken 690 times.
✓ Branch 14 → 15 taken 690 times.
✓ Branch 14 → 16 taken 28 times.
7618 FX_CALLER_CHECKING_CODE
95
96 /* Call actual directory information get service. */
97 56 status = _fx_directory_information_get(media_ptr, directory_name, attributes, size,
98 year, month, day, hour, minute, second);
99
100 /* Directory information get is complete, return status. */
101 56 return(status);
102 }
103
104