diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-05-11 13:11:19 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-05-11 13:11:19 +0200 |
commit | b3c62e6acc5761171822f522dc9d784558f9afbe (patch) | |
tree | c32a939d059c0a5e76a2fa88084511945fc78070 /ecp | |
parent | 320d6a8f68d4f32081006cda86f2a2bbd79c3f71 (diff) |
fixed tests for no hashtable
Diffstat (limited to 'ecp')
-rw-r--r-- | ecp/test/Makefile | 5 | ||||
-rw-r--r-- | ecp/test/init.c | 3 | ||||
-rw-r--r-- | ecp/test/init_vconn.c | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/ecp/test/Makefile b/ecp/test/Makefile index 56cc879..3e5effe 100644 --- a/ecp/test/Makefile +++ b/ecp/test/Makefile @@ -3,7 +3,10 @@ include $(src_dir)/ecp/common.mk CFLAGS += -I../util dep = ../build-posix/*.a ../util/libecputil.a -target = basic client server vc_inb vc_outb vcs vc_server vc_client +target = basic client server +ifeq ($(with_htable),yes) +target += vc_inb vc_outb vcs vc_server vc_client +endif %.o: %.c diff --git a/ecp/test/init.c b/ecp/test/init.c index aca2630..79c1098 100644 --- a/ecp/test/init.c +++ b/ecp/test/init.c @@ -19,7 +19,8 @@ static ECPConnection *conn_new(ECPSocket *sock, ECPConnection *parent, unsigned } static void conn_free(ECPConnection *conn) { - if (ecp_conn_is_gc(conn)) free(conn); + /* outbound connections are statically allocated */ + if (ecp_conn_is_inb(conn)) free(conn); } int ecp_init(ECPContext *ctx) { diff --git a/ecp/test/init_vconn.c b/ecp/test/init_vconn.c index 7594c92..3393a16 100644 --- a/ecp/test/init_vconn.c +++ b/ecp/test/init_vconn.c @@ -13,6 +13,7 @@ static ECPConnection *conn_new(ECPSocket *sock, ECPConnection *parent, unsigned ECPConnection *conn = NULL; switch (type) { +#ifdef ECP_WITH_HTABLE case ECP_CTYPE_VCONN: { ECPVConnInb *_conn; @@ -23,6 +24,7 @@ static ECPConnection *conn_new(ECPSocket *sock, ECPConnection *parent, unsigned } break; } +#endif case ECP_CTYPE_VLINK: { conn = malloc(sizeof(ECPConnection)); @@ -42,7 +44,8 @@ static ECPConnection *conn_new(ECPSocket *sock, ECPConnection *parent, unsigned } static void conn_free(ECPConnection *conn) { - if (ecp_conn_is_gc(conn)) free(conn); + /* outbound connections are statically allocated */ + if (ecp_conn_is_inb(conn)) free(conn); } int ecp_init(ECPContext *ctx, ECPConnHandler *vconn_handler, ECPConnHandler *vlink_handler) { |