From: Victor Julien Date: Sat, 24 Sep 2022 19:08:30 +0000 (+0200) Subject: stream: minor test cleanup X-Git-Tag: suricata-7.0.0-beta1~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=536d66e344f515b31bf92ad5f88a68367f7bb6ba;p=thirdparty%2Fsuricata.git stream: minor test cleanup --- diff --git a/src/tests/stream-tcp.c b/src/tests/stream-tcp.c index 19c126121d..c6eec9b902 100644 --- a/src/tests/stream-tcp.c +++ b/src/tests/stream-tcp.c @@ -46,34 +46,17 @@ static int StreamTcpTest01(void) memset(&f, 0, sizeof(Flow)); FLOW_INITIALIZE(&f); p->flow = &f; - int ret = 0; - StreamTcpUTInit(&stt.ra_ctx); - TcpSession *ssn = StreamTcpNewSession(p, 0); - if (ssn == NULL) { - printf("Session can not be allocated: "); - goto end; - } + FAIL_IF_NULL(ssn); f.protoctx = ssn; - - if (f.alparser != NULL) { - printf("AppLayer field not set to NULL: "); - goto end; - } - if (ssn->state != 0) { - printf("TCP state field not set to 0: "); - goto end; - } - + FAIL_IF_NOT_NULL(f.alparser); + FAIL_IF_NOT(ssn->state == 0); StreamTcpSessionClear(p->flow->protoctx); - - ret = 1; -end: SCFree(p); FLOW_DESTROY(&f); StreamTcpUTDeinit(stt.ra_ctx); - return ret; + PASS; } /**