summaryrefslogtreecommitdiff
path: root/tests/native
diff options
context:
space:
mode:
authorRakesh Raghava <rakeshraghava@google.com>2023-01-11 18:42:32 +0000
committerRakesh Raghava <rakeshraghava@google.com>2023-01-11 18:45:23 +0000
commitff70823a262940092bef366656218938dfc23f04 (patch)
tree72b28a48c2af7f3d48b9c42b46e81b96708e8457 /tests/native
parent2d74614f5b629c563b16304ad4183fddf86478c1 (diff)
downloadImsMedia-ff70823a262940092bef366656218938dfc23f04.tar.gz
Fix ImsMedia clang issues
- issues observed with Clang-Tidy Checks such as cert-oop54-cpp, performance-unnecessary-value-param, bugprone-macro-parentheses, bugprone-integer-division, bugprone-undefined-memory-manipulation, clang-analyzer-cplusplus.NewDeleteLeaks are resolved Bug: 265030400 Test: atest ImsMediaNativeTests Verified VoLTE calls with device Change-Id: Ib277ca20c155e82dc205213957df100fb8646f22
Diffstat (limited to 'tests/native')
-rw-r--r--tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpChunkTest.cpp8
-rw-r--r--tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpSdesPacketTest.cpp7
2 files changed, 0 insertions, 15 deletions
diff --git a/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpChunkTest.cpp b/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpChunkTest.cpp
index 5b2ece14..acfb1579 100644
--- a/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpChunkTest.cpp
+++ b/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpChunkTest.cpp
@@ -54,7 +54,6 @@ TEST_F(RtcpChunkTest, decodeChunkItem)
chunkItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[chunkItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", chunkItem->ucLength);
@@ -110,7 +109,6 @@ TEST_F(RtcpChunkTest, decodeMultichunkItem)
chunkItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[chunkItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", chunkItem->ucLength);
@@ -127,8 +125,6 @@ TEST_F(RtcpChunkTest, decodeMultichunkItem)
chunkItemSec->ucType = 1;
chunkItemSec->ucLength = 18;
- ASSERT_TRUE(pcBuffer != nullptr);
-
memcpy(pcBuffer, "google@example.com", chunkItemSec->ucLength);
chunkItemSec->pValue = pcBuffer;
@@ -175,7 +171,6 @@ TEST_F(RtcpChunkTest, decodeSdesChunkWithInvalidType)
chunkItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[chunkItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", chunkItem->ucLength);
@@ -192,8 +187,6 @@ TEST_F(RtcpChunkTest, decodeSdesChunkWithInvalidType)
chunkItemSec->ucType = 2;
chunkItemSec->ucLength = 18;
- ASSERT_TRUE(pcBuffer != nullptr);
-
memcpy(pcBuffer, "google@example.com", chunkItemSec->ucLength);
chunkItemSec->pValue = pcBuffer;
@@ -242,7 +235,6 @@ TEST_F(RtcpChunkTest, decodeSdesChunkWithInvalidLength)
chunkItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[chunkItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", chunkItem->ucLength);
diff --git a/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpSdesPacketTest.cpp b/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpSdesPacketTest.cpp
index 00346eb4..306d0430 100644
--- a/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpSdesPacketTest.cpp
+++ b/tests/native/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/rtp/core/RtcpSdesPacketTest.cpp
@@ -55,7 +55,6 @@ TEST_F(RtcpSdesPacketTest, decodeSdesPacketSingleSdesItem)
sdesItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[sdesItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", sdesItem->ucLength);
@@ -117,7 +116,6 @@ TEST_F(RtcpSdesPacketTest, decodeSdesPacketMultiSdesItem)
sdesItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[sdesItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", sdesItem->ucLength);
@@ -133,8 +131,6 @@ TEST_F(RtcpSdesPacketTest, decodeSdesPacketMultiSdesItem)
sdesItemSec->ucType = 1;
sdesItemSec->ucLength = 18;
- ASSERT_TRUE(pcBuffer != nullptr);
-
memcpy(pcBuffer, "google@example.com", sdesItemSec->ucLength);
sdesItemSec->pValue = pcBuffer;
@@ -191,7 +187,6 @@ TEST_F(RtcpSdesPacketTest, decodeSdesPacketDiffSdesType)
sdesItem->ucLength = 18;
RtpDt_UChar* pcBuffer = new RtpDt_UChar[sdesItem->ucLength];
- ASSERT_TRUE(pcBuffer != nullptr);
memcpy(pcBuffer, "sleepy@example.com", sdesItem->ucLength);
@@ -208,8 +203,6 @@ TEST_F(RtcpSdesPacketTest, decodeSdesPacketDiffSdesType)
sdesItemSec->ucType = 2;
sdesItemSec->ucLength = 18;
- ASSERT_TRUE(pcBuffer != nullptr);
-
memcpy(pcBuffer, "google@example.com", sdesItemSec->ucLength);
sdesItemSec->pValue = pcBuffer;