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% 10 / 0 / 10

fxe_directory_attributes_set.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_attributes_set 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 attribute set */
47 /* call. */
48 /* */
49 /* INPUT */
50 /* */
51 /* media_ptr Media control block pointer */
52 /* directory_name Directory name pointer */
53 /* attributes New file attributes */
54 /* */
55 /* OUTPUT */
56 /* */
57 /* return status */
58 /* */
59 /* CALLS */
60 /* */
61 /* _fx_directory_attributes_set Actual directory attributes */
62 /* set service */
63 /* */
64 /* CALLED BY */
65 /* */
66 /* Application Code */
67 /* */
68 /**************************************************************************/
69 2170 UINT _fxe_directory_attributes_set(FX_MEDIA *media_ptr, CHAR *directory_name, UINT attributes)
70 {
71
72 UINT status;
73
74
75 /* Check for a null media pointer. */
76
2/2
✓ Branch 2 → 3 taken 8 times.
✓ Branch 2 → 4 taken 2162 times.
2170 if (media_ptr == FX_NULL)
77 {
78 8 return(FX_PTR_ERROR);
79 }
80
81 /* Check for invalid attributes. */
82
2/2
✓ Branch 4 → 5 taken 8 times.
✓ Branch 4 → 6 taken 2154 times.
2162 if ((INT)attributes & ~(FX_DIRECTORY | FX_READ_ONLY | FX_HIDDEN | FX_SYSTEM | FX_ARCHIVE))
83 {
84 8 return(FX_INVALID_ATTR);
85 }
86
87 /* Check for a valid caller. */
88
6/6
✓ Branch 6 → 7 taken 1422 times.
✓ Branch 6 → 9 taken 690 times.
✓ Branch 7 → 8 taken 732 times.
✓ Branch 7 → 9 taken 690 times.
✓ Branch 8 → 9 taken 690 times.
✓ Branch 8 → 10 taken 42 times.
2112 FX_CALLER_CHECKING_CODE
89
90 /* Call actual set attributes service. */
91 84 status = _fx_directory_attributes_set(media_ptr, directory_name, attributes);
92
93 /* File attribute set is complete, return status. */
94 60 return(status);
95 }
96
97