Skip to content

Commit

Permalink
Fix some random bugs in cpp tests (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
Equod authored and jcague committed Sep 6, 2018
1 parent 5b49a12 commit c0c50a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions erizo/src/test/LibNiceConnectionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,16 @@ TEST_F(LibNiceConnectionTest, queuePacket_QueuedPackets_Can_Be_getPacket_When_Re
nice_connection->updateIceState(erizo::IceState::READY);
EXPECT_CALL(*nice_listener, onPacketReceived(_)).WillOnce(SaveArg<0>(&packet));

nice_connection->onData(0, test_packet, sizeof(test_packet));
nice_connection->onData(0, test_packet, strlen(test_packet));

ASSERT_THAT(packet.get(), Not(Eq(nullptr)));
EXPECT_EQ(static_cast<unsigned int>(packet->length), sizeof(test_packet));
EXPECT_EQ(static_cast<unsigned int>(packet->length), strlen(test_packet));
EXPECT_EQ(0, strcmp(test_packet, packet->data));
}

TEST_F(LibNiceConnectionTest, sendData_Succeed_When_Ice_Ready) {
const unsigned int kCompId = 1;
const int kLength = sizeof(test_packet);
const int kLength = strlen(test_packet);

EXPECT_CALL(*nice_listener, updateIceState(erizo::IceState::READY , _)).Times(1);
nice_connection->updateIceState(erizo::IceState::READY);
Expand All @@ -370,7 +370,7 @@ TEST_F(LibNiceConnectionTest, sendData_Succeed_When_Ice_Ready) {

TEST_F(LibNiceConnectionTest, sendData_Fail_When_Ice_Not_Ready) {
const unsigned int kCompId = 1;
const unsigned int kLength = sizeof(test_packet);
const unsigned int kLength = strlen(test_packet);

EXPECT_CALL(*libnice, NiceAgentSend(_, _, kCompId, kLength, _)).Times(0);
EXPECT_EQ(-1, nice_connection->sendData(kCompId, test_packet, kLength));
Expand Down
8 changes: 4 additions & 4 deletions erizo/src/test/NicerConnectionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,16 @@ TEST_F(NicerConnectionTest, queuePacket_QueuedPackets_Can_Be_getPacket_When_Read
nicer_connection->updateIceState(erizo::IceState::READY);
EXPECT_CALL(*nicer_listener, onPacketReceived(_)).WillOnce(SaveArg<0>(&packet));

nicer_connection->onData(0, test_packet, sizeof(test_packet));
nicer_connection->onData(0, test_packet, strlen(test_packet));

ASSERT_THAT(packet.get(), Not(Eq(nullptr)));
EXPECT_EQ(static_cast<unsigned int>(packet->length), sizeof(test_packet));
EXPECT_EQ(static_cast<unsigned int>(packet->length), strlen(test_packet));
EXPECT_EQ(0, strcmp(test_packet, packet->data));
}

TEST_F(NicerConnectionTest, sendData_Succeed_When_Ice_Ready) {
const unsigned int kCompId = 1;
const int kLength = sizeof(test_packet);
const int kLength = strlen(test_packet);

EXPECT_CALL(*nicer_listener, updateIceState(erizo::IceState::READY , _)).Times(1);
nicer_connection->updateIceState(erizo::IceState::READY);
Expand All @@ -377,7 +377,7 @@ TEST_F(NicerConnectionTest, sendData_Succeed_When_Ice_Ready) {

TEST_F(NicerConnectionTest, sendData_Fail_When_Ice_Not_Ready) {
const unsigned int kCompId = 1;
const unsigned int kLength = sizeof(test_packet);
const unsigned int kLength = strlen(test_packet);

EXPECT_CALL(*nicer, IceMediaStreamSend(_, _, kCompId, _, kLength)).Times(0);
EXPECT_EQ(-1, nicer_connection->sendData(kCompId, test_packet, kLength));
Expand Down

0 comments on commit c0c50a0

Please sign in to comment.