tests/unit: Update test-io-channel-socket.c for Windows

Change to dynamically include the test cases by checking AF_UNIX
availability using a new helper socket_check_afunix_support().
With such changes testing on a Windows host can be covered as well.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220802075200.907360-5-bmeng.cn@gmail.com>
This commit is contained in:
Bin Meng 2022-08-02 15:52:00 +08:00 committed by Marc-André Lureau
parent 120fa5e0e6
commit 0370f239ad
3 changed files with 48 additions and 14 deletions

View file

@ -32,4 +32,13 @@
*/
int socket_check_protocol_support(bool *has_ipv4, bool *has_ipv6);
/*
* @has_afunix: set to true on return if unix socket support is available
*
* Check whether unix domain socket support is available for use.
* On success, @has_afunix will be set to indicate whether AF_UNIX protocol
* is available.
*/
void socket_check_afunix_support(bool *has_afunix);
#endif