mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Remove bandwidth check because falsh is disabled. v5.0.52
This commit is contained in:
parent
1630918b0f
commit
937605b18c
16 changed files with 5 additions and 1490 deletions
|
@ -841,186 +841,6 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
|
|||
HELPER_EXPECT_SUCCESS(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 22, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','F','i','n','i','s','h','e','d', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 21, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','P','l','a','y','i','n','g', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 24, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','P','u','b','l','i','s','h','i','n','g', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 31, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','a','r','t','i','n','g','P','l','a','y','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 34, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','a','r','t','i','n','g','P','u','b','l','i','s','h','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 28, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','a','r','t','P','l','a','y','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 31, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','a','r','t','P','u','b','l','i','s','h','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 30, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','o','p','p','e','d','P','l','a','y','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 27, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','o','p','P','l','a','y','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 30, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','o','p','P','u','b','l','i','s','h','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 33, 'o','n','S','r','s','B','a','n','d','C','h','e','c','k','S','t','o','p','p','e','d','P','u','b','l','i','s','h','B','y','t','e','s', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
||||
uint8_t bytes[] = {0x02, 0x00, 17, 'f','i','n','a','l','C','l','i','e','n','t','P','a','c','k','e','t', 0x00,0,0,0,0,0,0,0,0};
|
||||
SrsCommonMessage* msg = _create_amf0((char*)bytes, sizeof(bytes), 1);
|
||||
SrsAutoFree(SrsCommonMessage, msg);
|
||||
|
||||
SrsPacket* pkt;
|
||||
SrsAutoFree(SrsPacket, pkt);
|
||||
|
||||
// Without enough data, it fail when decoding the request packet.
|
||||
HELPER_EXPECT_FAILED(p.decode_message(msg, &pkt));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockBufferIO io;
|
||||
SrsProtocol p(&io);
|
||||
|
@ -2488,78 +2308,6 @@ VOID TEST(ProtocolRTMPTest, CoverAll)
|
|||
}
|
||||
}
|
||||
|
||||
VOID TEST(ProtocolRTMPTest, CoverBandwidth)
|
||||
{
|
||||
if (true) {
|
||||
SrsBandwidthPacket p;
|
||||
|
||||
p.set_command("onSrsBandCheckStartPlayBytes");
|
||||
EXPECT_TRUE(p.is_start_play());
|
||||
|
||||
p.command_name = "onSrsBandCheckStartPlayBytes";
|
||||
EXPECT_TRUE(p.is_start_play());
|
||||
}
|
||||
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_start_play();
|
||||
EXPECT_TRUE(p->is_start_play());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_starting_play();
|
||||
EXPECT_TRUE(p->is_starting_play());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_playing();
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_stop_play();
|
||||
EXPECT_TRUE(p->is_stop_play());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_stopped_play();
|
||||
EXPECT_TRUE(p->is_stopped_play());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_start_publish();
|
||||
EXPECT_TRUE(p->is_start_publish());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_starting_publish();
|
||||
EXPECT_TRUE(p->is_starting_publish());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_publishing();
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_stop_publish();
|
||||
EXPECT_TRUE(p->is_stop_publish());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_stopped_publish();
|
||||
EXPECT_TRUE(p->is_stopped_publish());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_finish();
|
||||
EXPECT_TRUE(p->is_finish());
|
||||
srs_freep(p);
|
||||
}
|
||||
if (true) {
|
||||
SrsBandwidthPacket* p = SrsBandwidthPacket::create_final();
|
||||
EXPECT_TRUE(p->is_final());
|
||||
srs_freep(p);
|
||||
}
|
||||
}
|
||||
|
||||
VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
|
||||
{
|
||||
srs_error_t err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue