@ -18,6 +18,7 @@
# include <srs_kernel_buffer.hpp>
# include <srs_kernel_buffer.hpp>
# include <srs_kernel_codec.hpp>
# include <srs_kernel_codec.hpp>
# include <srs_protocol_utility.hpp>
# include <srs_protocol_utility.hpp>
# include <srs_core_deprecated.hpp>
# define SRS_DEFAULT_RECV_BUFFER_SIZE 131072
# define SRS_DEFAULT_RECV_BUFFER_SIZE 131072
@ -246,7 +247,7 @@ VOID TEST(ProtocolRTMPTest, SendPacketsError)
SrsSharedPtrMessage * msg = new SrsSharedPtrMessage ( ) ;
SrsSharedPtrMessage * msg = new SrsSharedPtrMessage ( ) ;
msg - > create ( & pkt ) ;
msg - > create ( & pkt ) ;
Srs AutoFree( SrsSharedPtrMessage , msg ) ;
Srs UniquePtr< SrsSharedPtrMessage > msg_uptr ( msg ) ;
SrsSharedPtrMessage * msgs [ 10240 ] ;
SrsSharedPtrMessage * msgs [ 10240 ] ;
for ( int i = 0 ; i < 10240 ; i + + ) {
for ( int i = 0 ; i < 10240 ; i + + ) {
@ -358,7 +359,7 @@ VOID TEST(ProtocolRTMPTest, HugeMessages)
SrsSharedPtrMessage * msg = new SrsSharedPtrMessage ( ) ;
SrsSharedPtrMessage * msg = new SrsSharedPtrMessage ( ) ;
msg - > create ( & pkt ) ;
msg - > create ( & pkt ) ;
Srs AutoFree( SrsSharedPtrMessage , msg ) ;
Srs UniquePtr< SrsSharedPtrMessage > msg_uptr ( msg ) ;
SrsSharedPtrMessage * msgs [ 1024 ] ;
SrsSharedPtrMessage * msgs [ 1024 ] ;
for ( int i = 0 ; i < 1024 ; i + + ) {
for ( int i = 0 ; i < 1024 ; i + + ) {
@ -380,7 +381,7 @@ VOID TEST(ProtocolRTMPTest, HugeMessages)
SrsSharedPtrMessage * msg = new SrsSharedPtrMessage ( ) ;
SrsSharedPtrMessage * msg = new SrsSharedPtrMessage ( ) ;
msg - > create ( & pkt ) ;
msg - > create ( & pkt ) ;
Srs AutoFree( SrsSharedPtrMessage , msg ) ;
Srs UniquePtr< SrsSharedPtrMessage > msg_uptr ( msg ) ;
SrsSharedPtrMessage * msgs [ 10240 ] ;
SrsSharedPtrMessage * msgs [ 10240 ] ;
for ( int i = 0 ; i < 10240 ; i + + ) {
for ( int i = 0 ; i < 10240 ; i + + ) {
@ -435,9 +436,10 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages)
// Always response ACK message.
// Always response ACK message.
HELPER_EXPECT_SUCCESS ( p . set_in_window_ack_size ( 1 ) ) ;
HELPER_EXPECT_SUCCESS ( p . set_in_window_ack_size ( 1 ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
io . in_buffer . append ( & bytes ) ;
io . in_buffer . append ( & bytes ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -461,12 +463,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages2)
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x01 , ' s ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x03 , 0 , 0 , 9 } ;
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x01 , ' s ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x03 , 0 , 0 , 9 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = RTMP_MSG_AMF3CommandMessage ;
msg - > header . message_type = RTMP_MSG_AMF3CommandMessage ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
SrsCallPacket * call = ( SrsCallPacket * ) pkt ;
SrsCallPacket * call = ( SrsCallPacket * ) pkt ;
EXPECT_STREQ ( " s " , call - > command_name . c_str ( ) ) ;
EXPECT_STREQ ( " s " , call - > command_name . c_str ( ) ) ;
@ -478,13 +480,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages2)
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x01 , ' s ' } ;
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x01 , ' s ' } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = RTMP_MSG_AMF3CommandMessage ;
msg - > header . message_type = RTMP_MSG_AMF3CommandMessage ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -493,13 +494,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages2)
uint8_t bytes [ ] = { 0x00 } ;
uint8_t bytes [ ] = { 0x00 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = 0xff ;
msg - > header . message_type = 0xff ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -508,13 +508,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages2)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x01 , ' s ' } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x01 , ' s ' } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = RTMP_MSG_AMF0DataMessage ;
msg - > header . message_type = RTMP_MSG_AMF0DataMessage ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
}
}
@ -528,14 +527,13 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = RTMP_MSG_AMF0DataMessage ;
msg - > header . message_type = RTMP_MSG_AMF0DataMessage ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Decode the response failed, no transaction ID was set by request.
// Decode the response failed, no transaction ID was set by request.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -544,14 +542,13 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' } ;
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = RTMP_MSG_AMF3DataMessage ;
msg - > header . message_type = RTMP_MSG_AMF3DataMessage ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Decode the response failed, no transaction ID was set by request.
// Decode the response failed, no transaction ID was set by request.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -560,14 +557,13 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x17 , 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
msg - > header . message_type = RTMP_MSG_AMF3CommandMessage ;
msg - > header . message_type = RTMP_MSG_AMF3CommandMessage ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Decode the response failed, no transaction ID was set by request.
// Decode the response failed, no transaction ID was set by request.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -580,13 +576,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the response packet.
// Without enough data, it fail when decoding the response packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -599,13 +594,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the response packet.
// Without enough data, it fail when decoding the response packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -618,13 +612,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the response packet.
// Without enough data, it fail when decoding the response packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -637,13 +630,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the response packet.
// Without enough data, it fail when decoding the response packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -657,13 +649,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the response packet.
// Without enough data, it fail when decoding the response packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -677,13 +668,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages3)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' _ ' , ' r ' , ' e ' , ' s ' , ' u ' , ' l ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the response packet.
// Without enough data, it fail when decoding the response packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
}
}
@ -697,13 +687,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' c ' , ' o ' , ' n ' , ' n ' , ' e ' , ' c ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 0x07 , ' c ' , ' o ' , ' n ' , ' n ' , ' e ' , ' c ' , ' t ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -712,13 +701,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 12 , ' c ' , ' r ' , ' e ' , ' a ' , ' t ' , ' e ' , ' S ' , ' t ' , ' r ' , ' e ' , ' a ' , ' m ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 12 , ' c ' , ' r ' , ' e ' , ' a ' , ' t ' , ' e ' , ' S ' , ' t ' , ' r ' , ' e ' , ' a ' , ' m ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -727,13 +715,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 4 , ' p ' , ' l ' , ' a ' , ' y ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 4 , ' p ' , ' l ' , ' a ' , ' y ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -742,13 +729,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 5 , ' p ' , ' a ' , ' u ' , ' s ' , ' e ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 5 , ' p ' , ' a ' , ' u ' , ' s ' , ' e ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -757,13 +743,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 13 , ' r ' , ' e ' , ' l ' , ' e ' , ' a ' , ' s ' , ' e ' , ' S ' , ' t ' , ' r ' , ' e ' , ' a ' , ' m ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 13 , ' r ' , ' e ' , ' l ' , ' e ' , ' a ' , ' s ' , ' e ' , ' S ' , ' t ' , ' r ' , ' e ' , ' a ' , ' m ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -772,13 +757,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 9 , ' F ' , ' C ' , ' P ' , ' u ' , ' b ' , ' l ' , ' i ' , ' s ' , ' h ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 9 , ' F ' , ' C ' , ' P ' , ' u ' , ' b ' , ' l ' , ' i ' , ' s ' , ' h ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -787,13 +771,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 7 , ' p ' , ' u ' , ' b ' , ' l ' , ' i ' , ' s ' , ' h ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 7 , ' p ' , ' u ' , ' b ' , ' l ' , ' i ' , ' s ' , ' h ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -802,13 +785,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 11 , ' F ' , ' C ' , ' U ' , ' n ' , ' p ' , ' u ' , ' b ' , ' l ' , ' i ' , ' s ' , ' h ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 11 , ' F ' , ' C ' , ' U ' , ' n ' , ' p ' , ' u ' , ' b ' , ' l ' , ' i ' , ' s ' , ' h ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -817,13 +799,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 13 , ' @ ' , ' s ' , ' e ' , ' t ' , ' D ' , ' a ' , ' t ' , ' a ' , ' F ' , ' r ' , ' a ' , ' m ' , ' e ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 13 , ' @ ' , ' s ' , ' e ' , ' t ' , ' D ' , ' a ' , ' t ' , ' a ' , ' F ' , ' r ' , ' a ' , ' m ' , ' e ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -832,12 +813,11 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 10 , ' o ' , ' n ' , ' M ' , ' e ' , ' t ' , ' a ' , ' D ' , ' a ' , ' t ' , ' a ' , 03 , 0 , 0 , 9 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 10 , ' o ' , ' n ' , ' M ' , ' e ' , ' t ' , ' a ' , ' D ' , ' a ' , ' t ' , ' a ' , 03 , 0 , 0 , 9 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -846,13 +826,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 11 , ' c ' , ' l ' , ' o ' , ' s ' , ' e ' , ' S ' , ' t ' , ' r ' , ' e ' , ' a ' , ' m ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 11 , ' c ' , ' l ' , ' o ' , ' s ' , ' e ' , ' S ' , ' t ' , ' r ' , ' e ' , ' a ' , ' m ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
if ( true ) {
if ( true ) {
@ -862,13 +841,12 @@ VOID TEST(ProtocolRTMPTest, OnDecodeMessages4)
uint8_t bytes [ ] = { 0x02 , 0x00 , 3 , ' s ' , ' r ' , ' s ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x02 , 0x00 , 3 , ' s ' , ' r ' , ' s ' , 0x00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
SrsCommonMessage * msg = _create_amf0 ( ( char * ) bytes , sizeof ( bytes ) , 1 ) ;
msg - > header . message_type = RTMP_MSG_AMF0CommandMessage ;
msg - > header . message_type = RTMP_MSG_AMF0CommandMessage ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt ;
SrsPacket * pkt ;
SrsAutoFree ( SrsPacket , pkt ) ;
// Without enough data, it fail when decoding the request packet.
// Without enough data, it fail when decoding the request packet.
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_FAILED ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
}
}
@ -883,8 +861,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage)
uint8_t bytes [ ] = { 0x01 , 0x00 , 0x00 } ;
uint8_t bytes [ ] = { 0x01 , 0x00 , 0x00 } ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
if ( true ) {
if ( true ) {
@ -894,8 +873,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage)
uint8_t bytes [ ] = { 0x00 , 0x00 } ;
uint8_t bytes [ ] = { 0x00 , 0x00 } ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
if ( true ) {
if ( true ) {
@ -905,16 +885,18 @@ VOID TEST(ProtocolRTMPTest, RecvMessage)
uint8_t bytes [ ] = { 0x00 } ;
uint8_t bytes [ ] = { 0x00 } ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
if ( true ) {
if ( true ) {
MockBufferIO io ;
MockBufferIO io ;
SrsProtocol p ( & io ) ;
SrsProtocol p ( & io ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -929,8 +911,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage2)
uint8_t bytes [ ] = { 0x03 , 0 , 0 , 0 , 0 , 0 , 4 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 } ;
uint8_t bytes [ ] = { 0x03 , 0 , 0 , 0 , 0 , 0 , 4 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 } ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
if ( true ) {
if ( true ) {
@ -943,14 +926,16 @@ VOID TEST(ProtocolRTMPTest, RecvMessage2)
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
uint8_t bytes2 [ ] = { 0x43 , 0 , 0 , 0 , 0 , 0 , 5 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 } ;
uint8_t bytes2 [ ] = { 0x43 , 0 , 0 , 0 , 0 , 0 , 5 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 } ;
io . in_buffer . append ( ( char * ) bytes2 , sizeof ( bytes2 ) ) ;
io . in_buffer . append ( ( char * ) bytes2 , sizeof ( bytes2 ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
if ( true ) {
if ( true ) {
@ -960,8 +945,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage2)
uint8_t bytes [ ] = { 0x03 } ;
uint8_t bytes [ ] = { 0x03 } ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
if ( true ) {
if ( true ) {
@ -971,8 +957,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage2)
uint8_t bytes [ ] = { 0x43 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
uint8_t bytes [ ] = { 0x43 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
io . in_buffer . append ( ( char * ) bytes , sizeof ( bytes ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -1054,8 +1041,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage4)
io . in_buffer . append ( & io . out_buffer ) ;
io . in_buffer . append ( & io . out_buffer ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
EXPECT_EQ ( 256 , p . out_chunk_size ) ;
EXPECT_EQ ( 256 , p . out_chunk_size ) ;
}
}
@ -1071,8 +1059,9 @@ VOID TEST(ProtocolRTMPTest, RecvMessage4)
io . in_buffer . append ( & io . out_buffer ) ;
io . in_buffer . append ( & io . out_buffer ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
EXPECT_EQ ( 256 , p . in_buffer_length ) ;
EXPECT_EQ ( 256 , p . in_buffer_length ) ;
}
}
@ -1526,8 +1515,9 @@ VOID TEST(ProtocolRTMPTest, ServerCommandMessage)
SrsProtocol p ( & tio ) ;
SrsProtocol p ( & tio ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
EXPECT_EQ ( 1024 , p . in_chunk_size ) ;
EXPECT_EQ ( 1024 , p . in_chunk_size ) ;
}
}
@ -2247,8 +2237,9 @@ VOID TEST(ProtocolRTMPTest, CoverAll)
EXPECT_EQ ( 0 , r . get_recv_bytes ( ) ) ;
EXPECT_EQ ( 0 , r . get_recv_bytes ( ) ) ;
EXPECT_EQ ( 0 , r . get_send_bytes ( ) ) ;
EXPECT_EQ ( 0 , r . get_send_bytes ( ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( r . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( r . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
SrsCallPacket * pkt = new SrsCallPacket ( ) ;
SrsCallPacket * pkt = new SrsCallPacket ( ) ;
HELPER_EXPECT_SUCCESS ( r . send_and_free_packet ( pkt , 0 ) ) ;
HELPER_EXPECT_SUCCESS ( r . send_and_free_packet ( pkt , 0 ) ) ;
@ -2270,8 +2261,9 @@ VOID TEST(ProtocolRTMPTest, CoverAll)
EXPECT_EQ ( 0 , r . get_recv_bytes ( ) ) ;
EXPECT_EQ ( 0 , r . get_recv_bytes ( ) ) ;
EXPECT_EQ ( 0 , r . get_send_bytes ( ) ) ;
EXPECT_EQ ( 0 , r . get_send_bytes ( ) ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_FAILED ( r . recv_message ( & msg ) ) ;
HELPER_EXPECT_FAILED ( r . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
SrsCallPacket * pkt = new SrsCallPacket ( ) ;
SrsCallPacket * pkt = new SrsCallPacket ( ) ;
HELPER_EXPECT_SUCCESS ( r . send_and_free_packet ( pkt , 0 ) ) ;
HELPER_EXPECT_SUCCESS ( r . send_and_free_packet ( pkt , 0 ) ) ;
@ -2328,7 +2320,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
int nn = name - > total_size ( ) + arr - > total_size ( ) ;
int nn = name - > total_size ( ) + arr - > total_size ( ) ;
char * b = new char [ nn ] ;
char * b = new char [ nn ] ;
Srs AutoFreeA( char , b ) ;
Srs UniquePtr< char [ ] > cp_uptr ( b ) ;
SrsBuffer buf ( b , nn ) ;
SrsBuffer buf ( b , nn ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
@ -2336,7 +2328,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
srs_freep ( name ) ; srs_freep ( arr ) ;
srs_freep ( name ) ; srs_freep ( arr ) ;
SrsOnMetaDataPacket * p = new SrsOnMetaDataPacket ( ) ;
SrsOnMetaDataPacket * p = new SrsOnMetaDataPacket ( ) ;
Srs AutoFree( SrsOnMetaDataPacket , p ) ;
Srs UniquePtr< SrsOnMetaDataPacket > p_uptr ( p ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
@ -2405,7 +2397,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + is_pause - > total_size ( ) + ts - > total_size ( ) ;
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + is_pause - > total_size ( ) + ts - > total_size ( ) ;
char * b = new char [ nn ] ;
char * b = new char [ nn ] ;
Srs AutoFreeA( char , b ) ;
Srs UniquePtr< char [ ] > cp_uptr ( b ) ;
SrsBuffer buf ( b , nn ) ;
SrsBuffer buf ( b , nn ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
@ -2416,7 +2408,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( is_pause ) ; srs_freep ( ts ) ;
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( is_pause ) ; srs_freep ( ts ) ;
SrsPausePacket * p = new SrsPausePacket ( ) ;
SrsPausePacket * p = new SrsPausePacket ( ) ;
Srs AutoFree( SrsPausePacket , p ) ;
Srs UniquePtr< SrsPausePacket > p_uptr ( p ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
@ -2435,7 +2427,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + stream_name - > total_size ( ) + start - > total_size ( ) + duration - > total_size ( ) + reset - > total_size ( ) ;
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + stream_name - > total_size ( ) + start - > total_size ( ) + duration - > total_size ( ) + reset - > total_size ( ) ;
char * b = new char [ nn ] ;
char * b = new char [ nn ] ;
Srs AutoFreeA( char , b ) ;
Srs UniquePtr< char [ ] > cp_uptr ( b ) ;
SrsBuffer buf ( b , nn ) ;
SrsBuffer buf ( b , nn ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
@ -2448,7 +2440,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( stream_name ) ; srs_freep ( start ) ; srs_freep ( duration ) ; srs_freep ( reset ) ;
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( stream_name ) ; srs_freep ( start ) ; srs_freep ( duration ) ; srs_freep ( reset ) ;
SrsPlayPacket * p = new SrsPlayPacket ( ) ;
SrsPlayPacket * p = new SrsPlayPacket ( ) ;
Srs AutoFree( SrsPlayPacket , p ) ;
Srs UniquePtr< SrsPlayPacket > p_uptr ( p ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
@ -2469,7 +2461,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + stream_name - > total_size ( ) + start - > total_size ( ) + duration - > total_size ( ) + reset - > total_size ( ) ;
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + stream_name - > total_size ( ) + start - > total_size ( ) + duration - > total_size ( ) + reset - > total_size ( ) ;
char * b = new char [ nn ] ;
char * b = new char [ nn ] ;
Srs AutoFreeA( char , b ) ;
Srs UniquePtr< char [ ] > cp_uptr ( b ) ;
SrsBuffer buf ( b , nn ) ;
SrsBuffer buf ( b , nn ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
@ -2482,7 +2474,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( stream_name ) ; srs_freep ( start ) ; srs_freep ( duration ) ; srs_freep ( reset ) ;
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( stream_name ) ; srs_freep ( start ) ; srs_freep ( duration ) ; srs_freep ( reset ) ;
SrsPlayPacket * p = new SrsPlayPacket ( ) ;
SrsPlayPacket * p = new SrsPlayPacket ( ) ;
Srs AutoFree( SrsPlayPacket , p ) ;
Srs UniquePtr< SrsPlayPacket > p_uptr ( p ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( p - > decode ( & buf ) ) ;
@ -2503,7 +2495,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + stream_name - > total_size ( ) + start - > total_size ( ) + duration - > total_size ( ) + reset - > total_size ( ) ;
int nn = name - > total_size ( ) + tid - > total_size ( ) + null - > total_size ( ) + stream_name - > total_size ( ) + start - > total_size ( ) + duration - > total_size ( ) + reset - > total_size ( ) ;
char * b = new char [ nn ] ;
char * b = new char [ nn ] ;
Srs AutoFreeA( char , b ) ;
Srs UniquePtr< char [ ] > cp_uptr ( b ) ;
SrsBuffer buf ( b , nn ) ;
SrsBuffer buf ( b , nn ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
HELPER_ASSERT_SUCCESS ( name - > write ( & buf ) ) ;
@ -2516,7 +2508,7 @@ VOID TEST(ProtocolRTMPTest, CoverAllUnmarshal)
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( stream_name ) ; srs_freep ( start ) ; srs_freep ( duration ) ; srs_freep ( reset ) ;
srs_freep ( name ) ; srs_freep ( tid ) ; srs_freep ( null ) ; srs_freep ( stream_name ) ; srs_freep ( start ) ; srs_freep ( duration ) ; srs_freep ( reset ) ;
SrsPlayPacket * p = new SrsPlayPacket ( ) ;
SrsPlayPacket * p = new SrsPlayPacket ( ) ;
Srs AutoFree( SrsPlayPacket , p ) ;
Srs UniquePtr< SrsPlayPacket > p_uptr ( p ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
buf . skip ( - 1 * buf . pos ( ) ) ;
HELPER_EXPECT_FAILED ( p - > decode ( & buf ) ) ;
HELPER_EXPECT_FAILED ( p - > decode ( & buf ) ) ;
@ -2593,9 +2585,11 @@ VOID TEST(ProtocolRTMPTest, ConnectAppWithArgs)
if ( true ) {
if ( true ) {
tio . in_buffer . append ( & io . out_buffer ) ;
tio . in_buffer . append ( & io . out_buffer ) ;
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
SrsConnectAppPacket * pkt = NULL ; SrsAutoFree ( SrsConnectAppPacket , pkt ) ;
SrsConnectAppPacket * pkt = NULL ;
HELPER_ASSERT_SUCCESS ( p . expect_message ( & msg , & pkt ) ) ;
HELPER_ASSERT_SUCCESS ( p . expect_message ( & msg , & pkt ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
SrsUniquePtr < SrsConnectAppPacket > pkt_uptr ( pkt ) ;
SrsAmf0Any * prop = pkt - > command_object - > get_property ( " tcUrl " ) ;
SrsAmf0Any * prop = pkt - > command_object - > get_property ( " tcUrl " ) ;
ASSERT_TRUE ( prop & & prop - > is_string ( ) ) ;
ASSERT_TRUE ( prop & & prop - > is_string ( ) ) ;
@ -2624,8 +2618,9 @@ VOID TEST(ProtocolRTMPTest, AgentMessageCodec)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -2640,11 +2635,13 @@ VOID TEST(ProtocolRTMPTest, AgentMessageCodec)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_ASSERT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_ASSERT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt = NULL ; SrsAutoFree ( SrsPacket , pkt ) ;
SrsPacket * pkt = NULL ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
}
}
@ -2659,8 +2656,9 @@ VOID TEST(ProtocolRTMPTest, AgentMessageCodec)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -2675,11 +2673,13 @@ VOID TEST(ProtocolRTMPTest, AgentMessageCodec)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_ASSERT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_ASSERT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
SrsPacket * pkt = NULL ; SrsAutoFree ( SrsPacket , pkt ) ;
SrsPacket * pkt = NULL ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
HELPER_EXPECT_SUCCESS ( p . decode_message ( msg , & pkt ) ) ;
SrsUniquePtr < SrsPacket > pkt_uptr ( pkt ) ;
}
}
}
}
}
}
@ -2689,7 +2689,7 @@ srs_error_t _mock_packet_to_shared_msg(SrsPacket* packet, int stream_id, SrsShar
srs_error_t err = srs_success ;
srs_error_t err = srs_success ;
SrsCommonMessage * msg = new SrsCommonMessage ( ) ;
SrsCommonMessage * msg = new SrsCommonMessage ( ) ;
Srs AutoFree( SrsCommonMessage , msg ) ;
Srs UniquePtr< SrsCommonMessage > msg_uptr ( msg ) ;
if ( ( err = packet - > to_msg ( msg , stream_id ) ) ! = srs_success ) {
if ( ( err = packet - > to_msg ( msg , stream_id ) ) ! = srs_success ) {
srs_freep ( msg ) ;
srs_freep ( msg ) ;
@ -2714,7 +2714,7 @@ VOID TEST(ProtocolRTMPTest, CheckStreamID)
if ( true ) {
if ( true ) {
SrsSharedPtrMessage * shared_msgs [ 2 ] ;
SrsSharedPtrMessage * shared_msgs [ 2 ] ;
SrsConnectAppPacket * res = new SrsConnectAppPacket ( ) ;
SrsConnectAppPacket * res = new SrsConnectAppPacket ( ) ;
Srs AutoFree( SrsConnectAppPacket , res ) ;
Srs UniquePtr< SrsConnectAppPacket > res_uptr ( res ) ;
if ( true ) {
if ( true ) {
SrsSharedPtrMessage * shared_msg = new SrsSharedPtrMessage ( ) ;
SrsSharedPtrMessage * shared_msg = new SrsSharedPtrMessage ( ) ;
@ -2733,14 +2733,16 @@ VOID TEST(ProtocolRTMPTest, CheckStreamID)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
EXPECT_EQ ( 1 , msg - > header . stream_id ) ;
EXPECT_EQ ( 1 , msg - > header . stream_id ) ;
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
EXPECT_EQ ( 2 , msg - > header . stream_id ) ;
EXPECT_EQ ( 2 , msg - > header . stream_id ) ;
}
}
}
}
@ -2765,8 +2767,9 @@ VOID TEST(ProtocolRTMPTest, AgentMessageTransform)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -2785,8 +2788,9 @@ VOID TEST(ProtocolRTMPTest, AgentMessageTransform)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -2805,8 +2809,9 @@ VOID TEST(ProtocolRTMPTest, AgentMessageTransform)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
@ -2825,8 +2830,9 @@ VOID TEST(ProtocolRTMPTest, AgentMessageTransform)
}
}
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( p . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
}
}
}
}
@ -2859,8 +2865,9 @@ VOID TEST(ProtocolRTMPTest, MergeReadHandler)
r . set_merge_read ( true , & h ) ;
r . set_merge_read ( true , & h ) ;
if ( true ) {
if ( true ) {
SrsCommonMessage * msg = NULL ; SrsAutoFree ( SrsCommonMessage , msg ) ;
SrsCommonMessage * msg = NULL ;
HELPER_EXPECT_SUCCESS ( r . recv_message ( & msg ) ) ;
HELPER_EXPECT_SUCCESS ( r . recv_message ( & msg ) ) ;
SrsUniquePtr < SrsCommonMessage > msg_uptr ( msg ) ;
}
}
EXPECT_TRUE ( h . nn > 0 ) ;
EXPECT_TRUE ( h . nn > 0 ) ;