add fake connection to C API

This commit is contained in:
Vinzenz Schroeter 2024-11-04 21:49:23 +01:00
parent 960f12ebc5
commit f8f5dd0d4f
2 changed files with 31 additions and 1 deletions

View file

@ -1201,6 +1201,20 @@ SPCommand *sp_command_hard_reset(void);
*/
SPCommand *sp_command_try_from_packet(SPPacket *packet);
/**
* Creates a new instance of [SPConnection] for testing that does not actually send anything.
*
* returns: a new instance. Will never return NULL.
*
* # Safety
*
* The caller has to make sure that:
*
* - the returned instance is freed in some way, either by using a consuming function or
* by explicitly calling `sp_connection_free`.
*/
SPConnection *sp_connection_fake(void);
/**
* Closes and deallocates a [SPConnection].
*