1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Add test for http status.

This commit is contained in:
winlin 2019-12-14 10:12:25 +08:00
parent 6ce04051e4
commit 4758a284d7
2 changed files with 10 additions and 6 deletions

View file

@ -24,8 +24,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_http_stack.hpp>
VOID TEST(ProtoStackTest, StatusCode2Text)
VOID TEST(ProtocolHTTPTest, StatusCode2Text)
{
EXPECT_STREQ(SRS_CONSTS_HTTP_OK_str, srs_generate_http_status_text(SRS_CONSTS_HTTP_OK).c_str());
EXPECT_STREQ("Status Unknown", srs_generate_http_status_text(999).c_str());
EXPECT_FALSE(srs_go_http_body_allowd(SRS_CONSTS_HTTP_Continue));
EXPECT_FALSE(srs_go_http_body_allowd(SRS_CONSTS_HTTP_OK-1));
EXPECT_FALSE(srs_go_http_body_allowd(SRS_CONSTS_HTTP_NoContent));
EXPECT_FALSE(srs_go_http_body_allowd(SRS_CONSTS_HTTP_NotModified));
EXPECT_TRUE(srs_go_http_body_allowd(SRS_CONSTS_HTTP_OK));
}