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

fxe_media_volume_get_extended.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 /** Media */
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_media.h"
30
31
32 FX_CALLER_CHECKING_EXTERNS
33
34
35 /**************************************************************************/
36 /* */
37 /* FUNCTION RELEASE */
38 /* */
39 /* _fxe_media_volume_get_extended PORTABLE C */
40 /* 6.1 */
41 /* AUTHOR */
42 /* */
43 /* William E. Lamie, Microsoft Corporation */
44 /* */
45 /* DESCRIPTION */
46 /* */
47 /* This function checks for errors in the media volume get service. */
48 /* */
49 /* INPUT */
50 /* */
51 /* media_ptr Media control block pointer */
52 /* volume_name Pointer to destination for */
53 /* the volume name (maximum */
54 /* 11 characters + NULL) */
55 /* volume_name_buffer_length Buffer length for volume_name */
56 /* volume_source Source of volume */
57 /* */
58 /* OUTPUT */
59 /* */
60 /* return status */
61 /* */
62 /* CALLS */
63 /* */
64 /* _fx_media_volume_get_extended Actual media volume get */
65 /* service */
66 /* */
67 /* CALLED BY */
68 /* */
69 /* Application Code */
70 /* */
71 /**************************************************************************/
72 3474 UINT _fxe_media_volume_get_extended(FX_MEDIA *media_ptr, CHAR *volume_name, UINT volume_name_buffer_length, UINT volume_source)
73 {
74
75 UINT status;
76
77
78 /* Check for a NULL media or volume name pointer. */
79
4/4
✓ Branch 2 → 3 taken 3466 times.
✓ Branch 2 → 4 taken 8 times.
✓ Branch 3 → 4 taken 690 times.
✓ Branch 3 → 5 taken 2776 times.
3474 if ((media_ptr == FX_NULL) || (volume_name == FX_NULL))
80 {
81 698 return(FX_PTR_ERROR);
82 }
83
84 /* Check for zero length buffer. */
85
2/2
✓ Branch 5 → 6 taken 690 times.
✓ Branch 5 → 7 taken 2086 times.
2776 if (volume_name_buffer_length == 0)
86 {
87 690 return(FX_BUFFER_ERROR);
88 }
89
90 /* Check for a valid caller. */
91
6/6
✓ Branch 7 → 8 taken 1388 times.
✓ Branch 7 → 10 taken 690 times.
✓ Branch 8 → 9 taken 698 times.
✓ Branch 8 → 10 taken 690 times.
✓ Branch 9 → 10 taken 690 times.
✓ Branch 9 → 11 taken 8 times.
2078 FX_CALLER_CHECKING_CODE
92
93 /* Call actual media volume get service. */
94 16 status = _fx_media_volume_get_extended(media_ptr, volume_name, volume_name_buffer_length, volume_source);
95
96 /* Return status to the caller. */
97 16 return(status);
98 }
99
100