Fix some warnings for compiler

pull/1568/head
winlin 5 years ago
parent 10464a5fbe
commit 69e2d94e50

@ -131,7 +131,7 @@ VOID TEST(SrsAVCTest, H264SequenceHeader)
if (true) {
SrsRawH264Stream h; string sh;
HELPER_ASSERT_SUCCESS(h.mux_sequence_header("Hello", "world", 0, 0, sh));
EXPECT_EQ(11+5+5, sh.length());
EXPECT_EQ(11+5+5, (int)sh.length());
EXPECT_STREQ("Hello", sh.substr(8, 5).c_str());
EXPECT_STREQ("world", sh.substr(16).c_str());
}

@ -2675,7 +2675,7 @@ VOID TEST(ConfigMainTest, CheckGlobalConfig)
if (true) {
MockSrsConfig conf;
HELPER_ASSERT_SUCCESS(conf.parse("listen 1935;"));
EXPECT_EQ(1, conf.get_listens().size());
EXPECT_EQ(1, (int)conf.get_listens().size());
}
if (true) {

@ -4788,13 +4788,13 @@ VOID TEST(KernelMP4Test, CoverMP4All)
if (true) {
SrsMp4ElstEntry e;
EXPECT_EQ(0, e.media_time);
EXPECT_EQ(0, e.segment_duration);
EXPECT_EQ(0, (int)e.segment_duration);
}
if (true) {
SrsMp4CttsEntry e;
EXPECT_EQ(0, e.sample_count);
EXPECT_EQ(0, e.sample_offset);
EXPECT_EQ(0, (int)e.sample_count);
EXPECT_EQ(0, (int)e.sample_offset);
}
}

@ -492,7 +492,7 @@ VOID TEST(KernelMp4Test, FullBoxDump)
SrsMp4FullBox box;
HELPER_ASSERT_SUCCESS(box.decode(&b));
EXPECT_EQ(1, box.version);
EXPECT_EQ(2, box.flags);
EXPECT_EQ(2, (int)box.flags);
}
if (true) {
@ -596,7 +596,7 @@ VOID TEST(KernelMp4Test, TFHDBox)
if (true) {
SrsMp4TrackFragmentHeaderBox box;
box.track_id = 100;
EXPECT_EQ(sizeof(buf), box.nb_bytes());
EXPECT_EQ((int)sizeof(buf), (int)box.nb_bytes());
HELPER_EXPECT_SUCCESS(box.encode(&b));
stringstream ss;
@ -682,7 +682,7 @@ VOID TEST(KernelMp4Test, TFDTBox)
b.skip(-1 * b.pos());
SrsMp4TrackFragmentDecodeTimeBox box;
HELPER_EXPECT_SUCCESS(box.decode(&b));
EXPECT_EQ(100, box.base_media_decode_time);
EXPECT_EQ(100, (int)box.base_media_decode_time);
}
}

@ -5805,7 +5805,7 @@ VOID TEST(ProtocolHTTPTest, HTTPParser)
// size = 70, nparsed = 70, nread = 0
HELPER_EXPECT_SUCCESS(parser.parse("GET /gslb/v1/versions HTTP/1.1\r\nHost: ossrs.net\r\nContent-Length: 5\r\n\r\n"));
EXPECT_EQ(70, parser.parsed);
EXPECT_EQ(0, parser.parser->nread);
EXPECT_EQ(0, (int)parser.parser->nread);
EXPECT_TRUE(!parser.body);
EXPECT_TRUE(parser.headers_complete);
EXPECT_TRUE(!parser.message_complete);

@ -1314,7 +1314,7 @@ VOID TEST(ProtocolRTMPTest, HandshakeC0C1)
SrsHandshakeBytes hs;
HELPER_EXPECT_SUCCESS(hs.read_c0c1(&io));
EXPECT_EQ(0x01020304, hs.proxy_real_ip);
EXPECT_EQ((uint32_t)0x01020304, (uint32_t)hs.proxy_real_ip);
}
// It's extended c0c1 prefixed with ip, which should be ok.

Loading…
Cancel
Save