winlin

fix bug of utest

@@ -4635,7 +4635,10 @@ VOID TEST(ProtocolStackTest, ProtocolSendVMessage) @@ -4635,7 +4635,10 @@ VOID TEST(ProtocolStackTest, ProtocolSendVMessage)
4635 msg->payload = new char[msg->size]; 4635 msg->payload = new char[msg->size];
4636 memcpy(msg->payload, data, msg->size); 4636 memcpy(msg->payload, data, msg->size);
4637 4637
4638 - EXPECT_TRUE(ERROR_SUCCESS == proto.send_and_free_message(msg, 0)); 4638 + SrsSharedPtrMessage m;
  4639 + ASSERT_TRUE(ERROR_SUCCESS == m.create(msg));
  4640 +
  4641 + EXPECT_TRUE(ERROR_SUCCESS == proto.send_and_free_message(m.copy(), 0));
4639 EXPECT_EQ(16, bio.out_buffer.length()); 4642 EXPECT_EQ(16, bio.out_buffer.length());
4640 } 4643 }
4641 4644
@@ -5346,8 +5349,11 @@ VOID TEST(ProtocolStackTest, ProtocolAckSizeFlow) @@ -5346,8 +5349,11 @@ VOID TEST(ProtocolStackTest, ProtocolAckSizeFlow)
5346 5349
5347 msg->header.message_type = 9; 5350 msg->header.message_type = 9;
5348 EXPECT_TRUE(msg->header.is_video()); 5351 EXPECT_TRUE(msg->header.is_video());
  5352 +
  5353 + SrsSharedPtrMessage m;
  5354 + ASSERT_TRUE(ERROR_SUCCESS == m.create(msg));
5349 5355
5350 - EXPECT_TRUE(ERROR_SUCCESS == proto.send_and_free_message(msg, 1)); 5356 + EXPECT_TRUE(ERROR_SUCCESS == proto.send_and_free_message(m.copy(), 1));
5351 } 5357 }
5352 5358
5353 // copy output to input 5359 // copy output to input
@@ -5392,8 +5398,11 @@ VOID TEST(ProtocolStackTest, ProtocolAckSizeFlow) @@ -5392,8 +5398,11 @@ VOID TEST(ProtocolStackTest, ProtocolAckSizeFlow)
5392 5398
5393 msg->header.message_type = 9; 5399 msg->header.message_type = 9;
5394 EXPECT_TRUE(msg->header.is_video()); 5400 EXPECT_TRUE(msg->header.is_video());
  5401 +
  5402 + SrsSharedPtrMessage m;
  5403 + ASSERT_TRUE(ERROR_SUCCESS == m.create(msg));
5395 5404
5396 - EXPECT_TRUE(ERROR_SUCCESS == proto.send_and_free_message(msg, 1)); 5405 + EXPECT_TRUE(ERROR_SUCCESS == proto.send_and_free_message(m.copy(), 1));
5397 } 5406 }
5398 // copy output to input 5407 // copy output to input
5399 if (true) { 5408 if (true) {