From: Victor Julien Date: Sun, 17 Jan 2021 22:34:07 +0000 (+0100) Subject: http: enable and fix content range tests X-Git-Tag: suricata-7.0.0-beta1~1862 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5737%2Fhead;p=thirdparty%2Fsuricata.git http: enable and fix content range tests --- diff --git a/src/app-layer-htp-file.c b/src/app-layer-htp-file.c index 464868d6b7..e5cc415c19 100644 --- a/src/app-layer-htp-file.c +++ b/src/app-layer-htp-file.c @@ -1228,5 +1228,6 @@ void HTPFileParserRegisterTests(void) UtRegisterTest("HTPFileParserTest09", HTPFileParserTest09); UtRegisterTest("HTPFileParserTest10", HTPFileParserTest10); UtRegisterTest("HTPFileParserTest11", HTPFileParserTest11); + AppLayerHtpFileRegisterTests(); #endif /* UNITTESTS */ } diff --git a/src/tests/app-layer-htp-file.c b/src/tests/app-layer-htp-file.c index 09f194fd9a..a1701c0d36 100644 --- a/src/tests/app-layer-htp-file.c +++ b/src/tests/app-layer-htp-file.c @@ -28,7 +28,7 @@ static int AppLayerHtpFileParseContentRangeTest01 (void) { HtpContentRange range; bstr * rawvalue = bstr_dup_c("bytes 12-25/100"); - FAIL_IF_NOT(HTPParseContentRange(rawvalue, &range) == HTP_OK); + FAIL_IF_NOT(HTPParseContentRange(rawvalue, &range) == 0); FAIL_IF_NOT(range.start == 12); FAIL_IF_NOT(range.end == 25); FAIL_IF_NOT(range.size == 100); @@ -45,7 +45,7 @@ static int AppLayerHtpFileParseContentRangeTest02 (void) { HtpContentRange range; bstr * rawvalue = bstr_dup_c("bytes 15335424-27514354/"); - FAIL_IF(HTPParseContentRange(rawvalue, &range) == HTP_OK); + FAIL_IF(HTPParseContentRange(rawvalue, &range) == 0); bstr_free(rawvalue); PASS; } @@ -59,7 +59,7 @@ static int AppLayerHtpFileParseContentRangeTest03 (void) { HtpContentRange range; bstr * rawvalue = bstr_dup_c("bytes 15335424-"); - FAIL_IF(HTPParseContentRange(rawvalue, &range) == HTP_OK); + FAIL_IF(HTPParseContentRange(rawvalue, &range) == 0); bstr_free(rawvalue); PASS; } @@ -74,7 +74,7 @@ static int AppLayerHtpFileParseContentRangeTest04 (void) { HtpContentRange range; bstr * rawvalue = bstr_dup_c("bytes 24-42/*"); - FAIL_IF_NOT(HTPParseContentRange(rawvalue, &range) == HTP_OK); + FAIL_IF_NOT(HTPParseContentRange(rawvalue, &range) == 0); FAIL_IF_NOT(range.start == 24); FAIL_IF_NOT(range.end == 42); bstr_free(rawvalue);