Helium
|
Utility functions. More...
#include <he.h>
Go to the source code of this file.
Macros | |
#define | HE_DISPATCH(func, ...) func(__VA_ARGS__); |
#define | HE_DISPATCH_CONN(func, ...) func(__VA_ARGS__); |
Functions | |
he_return_code_t | he_internal_setup_stream_state (he_conn_t *conn, uint8_t *data, size_t length) |
Setup the pointers and counters for reading from a TCP stream. | |
Utility functions.
#define HE_DISPATCH | ( | func, | |
... | |||
) | func(__VA_ARGS__); |
Out of the box, Unity doesn't allow us to mock intra-module function calls. This is generally OK but is very annoying for the packet lifecycle functions, where we pass control to a bunch of various functions in a pipeline, so instead of artificially breaking these functions into different modules we just mock the "handover" here with a dispatch macro.
If TEST isn't defined this just compiles down to a function call, so there's zero performance penalty AND we would get compile errors if the function is called incorrectly.