From 035df3be909e1c2509814f870c2d10edfa23576d Mon Sep 17 00:00:00 2001 From: David Timber Date: Mon, 12 Jul 2021 23:39:13 +1000 Subject: Impl proone-htbtclient, fix htbt ... * Fix bug where htbt slv ctx loops when the connection stays on. This bug has not been found earlier because the test connections shutdown write channel * Fix bug where errno is not properly set when htbt_main_do_connect() fails * Add test for protocol enums * proone-htbtclient: impl hover command --- src/proone-test_proto.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/proone-test_proto.c') diff --git a/src/proone-test_proto.c b/src/proone-test_proto.c index 9b8907c..5f61a32 100644 --- a/src/proone-test_proto.c +++ b/src/proone-test_proto.c @@ -13,6 +13,7 @@ static uint8_t proto_buf[PRNE_HTBT_PROTO_MIN_BUF]; static size_t proto_buf_cnt_len; static void test_ser (void); +static void test_enum (void); int main (void) { @@ -22,6 +23,7 @@ int main (void) { } test_ser(); + test_enum(); return 0; } @@ -541,3 +543,15 @@ static void test_ser (void) { prne_htbt_free_hover(&hv_a); prne_htbt_free_hover(&hv_b); } + +static void test_enum (void) { + for (prne_arch_t i = 0; i < NB_PRNE_ARCH; i += 1) { + assert(prne_arch_tostr(i) != NULL); + } + for (prne_htbt_ser_rc_t i = 0; i < NB_PRNE_HTBT_SER_RC; i += 1) { + assert(prne_htbt_serrc_tostr(i) != NULL); + } + for (prne_htbt_op_t i = 0; i < NB_PRNE_HTBT_OP; i += 1) { + assert(prne_htbt_op_tostr(i) != NULL); + } +} -- cgit