Skip to content

Commit

Permalink
test: add HAVE_UNIXSOCK=0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Mar 10, 2023
1 parent a3190a9 commit e6bd939
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ int test_sa_cmp(void)
uint16_t port2;
bool eq;
} testv[] = {
#if HAVE_UNIXSOCK
{
"unix:/test.sock", 0,
"unix:/test.sock", 0,
true
},
#endif
{
"1.2.3.4", 12345,
"1.2.3.4", 12345,
Expand Down Expand Up @@ -347,7 +349,9 @@ int test_sa_pton(void)
{"fa01::2a29", 0 },
{"127.0.0.1", 0 },
{"192.168.110.2", 0 },
#if HAVE_UNIXSOCK
{"unix:/test.sock", 0 },
#endif
{"fe80::xxxx:d8d9:ddc3:25dd:%eth0", EADDRNOTAVAIL},
};

Expand Down
6 changes: 6 additions & 0 deletions test/unixsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@
#include <re_dbg.h>


#if HAVE_UNIXSOCK
static void http_req_handler(struct http_conn *conn,
const struct http_msg *msg, void *arg)
{
(void)conn;
(void)msg;
(void)arg;
}
#endif


int test_unixsock(void)
{
#if HAVE_UNIXSOCK
struct sa srv;
re_sock_t fd = RE_BAD_SOCK;
struct http_sock *sock;
Expand Down Expand Up @@ -57,4 +60,7 @@ int test_unixsock(void)
if (err)
(void)unlink(&socket[5]);
return err;
#else
return ESKIPPED;
#endif
}

0 comments on commit e6bd939

Please sign in to comment.