diff options
author | Rakesh Raghava <rakeshraghava@google.com> | 2023-01-20 05:55:58 +0000 |
---|---|---|
committer | Rakesh Raghava <rakeshraghava@google.com> | 2023-01-20 05:55:58 +0000 |
commit | 4ad5f10e3f6c2155d95e2c214e59801b4c03e5fa (patch) | |
tree | 8256025a3be41563d9a4bb709d63137754bfb335 /tests/native | |
parent | 25c0f8d957880aaf9d722b97c86d9c7871573fd4 (diff) | |
download | ImsMedia-4ad5f10e3f6c2155d95e2c214e59801b4c03e5fa.tar.gz |
Fix Failure identified by HWASan in RtcpPacketTest
Bug: 266155180
Test: atest ImsMediaNativeTests with/without HWASan
ran clang-tidy check
Change-Id: Ia958532a0edd57a26649bfed15df19711ece2a7d
Diffstat (limited to 'tests/native')
-rw-r--r-- | tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacketTest.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacketTest.cpp b/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacketTest.cpp index bb90ee84..37185728 100644 --- a/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacketTest.cpp +++ b/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpPacketTest.cpp @@ -492,7 +492,7 @@ TEST_F(RtcpPacketTest, TestDecodeByePacket) 0x00, 0x03}; RtcpConfigInfo rtcpConfigInfo; - RtpBuffer rtpBuffer(28, bufPacket); + RtpBuffer rtpBuffer(sizeof(bufPacket), bufPacket); eRTP_STATUS_CODE res = rtcpPacket.decodeRtcpPacket(&rtpBuffer, 0, &rtcpConfigInfo); EXPECT_EQ(res, RTP_SUCCESS); @@ -518,10 +518,9 @@ TEST_F(RtcpPacketTest, TestDecodeByePacket) RtpBuffer* reason = pByePacket->getReason(); ASSERT_TRUE(reason != nullptr); - EXPECT_EQ(reason->getLength(), 8); - EXPECT_EQ(strcmp(reinterpret_cast<char*>(reason->getBuffer()), - reinterpret_cast<const char*>("teardown")), - 0); + const char* leaveReason = "teardown"; + EXPECT_EQ(reason->getLength(), strlen(leaveReason)); + EXPECT_EQ(memcmp(reason->getBuffer(), leaveReason, strlen(leaveReason)), 0); } /** |