diff options
author | David Timber <mieabby@gmail.com> | 2021-07-12 23:39:13 +1000 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2021-07-12 23:39:13 +1000 |
commit | 035df3be909e1c2509814f870c2d10edfa23576d (patch) | |
tree | e5f6293d844d3a205824545dbb64b3c55494688d /src/proone-test_proto.c | |
parent | 15bde4c46b707f7a95c7ea6650a3f02d67e50530 (diff) |
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
Diffstat (limited to 'src/proone-test_proto.c')
-rw-r--r-- | src/proone-test_proto.c | 14 |
1 files changed, 14 insertions, 0 deletions
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); + } +} |