Skip to content
Commit 2a3ca2cf authored by Reuben Cartwright's avatar Reuben Cartwright Committed by Devaraj Ranganna
Browse files

coremqtt-agent: Expose mqtt_agent_task.c statics



This commit makes the static functions in mqtt_agent_task.c visible
if the UNIT_TESTING macro is defined.
This is done by:
1.  Define the `STATIC` macro in the header.
```
\#ifdef UNIT_TESTING
    #define STATIC /* as nothing */
\#else
    #define STATIC static
\#endif /* UNIT_TESTING */
```
2. Add prototypes to the header.
```
STATIC int foo(void);
```
3. Remove all other function prototypes in the .c file.

This is justified because:
- These functions need to be tested.
- Functions other than `vStartMqttAgentTask` cannot be refactored to be
non-static, as only `vStartMqttAgentTask` should be called in another
file.

Signed-off-by: default avatarReuben Cartwright <Reuben.Cartwright@arm.com>
parent 4a4f28f2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment