Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_unittest.cc

Issue 1532903002: Reenables several NetEq unittests on android. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/neteq_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
index 04cef8aa99e7f1de8f2fbce8a7f3004aeaada010..f4b9e79397971f7f95162beb13352b14dbfeec0f 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
@@ -408,6 +408,10 @@ void NetEqDecodingTest::Process(size_t* out_len) {
if (packet_->payload_length_bytes() > 0) {
WebRtcRTPHeader rtp_header;
packet_->ConvertHeader(&rtp_header);
+#ifndef WEBRTC_CODEC_ISAC
+ // Ignore payload type 104 (iSAC-swb) if ISAC is not supported.
+ if (rtp_header.header.payloadType != 104)
+#endif
ASSERT_EQ(0, neteq_->InsertPacket(
rtp_header,
rtc::ArrayView<const uint8_t>(
@@ -510,9 +514,8 @@ void NetEqDecodingTest::PopulateCng(int frame_index,
*payload_len = 1; // Only noise level, no spectral parameters.
}
-#if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID) && \
- defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \
- (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
+#if !defined(WEBRTC_IOS) && defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \
+ (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722)
#define MAYBE_TestBitExactness TestBitExactness
#else
@@ -897,12 +900,12 @@ TEST_F(NetEqDecodingTest, UnknownPayloadType) {
}
#if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
-#define IF_ISAC(x) x
+#define MAYBE_DecoderError DecoderError
#else
-#define IF_ISAC(x) DISABLED_##x
+#define MAYBE_DecoderError DISABLED_DecoderError
#endif
-TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(IF_ISAC(DecoderError))) {
+TEST_F(NetEqDecodingTest, MAYBE_DecoderError) {
const size_t kPayloadBytes = 100;
uint8_t payload[kPayloadBytes] = {0};
WebRtcRTPHeader rtp_info;
@@ -922,8 +925,16 @@ TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(IF_ISAC(DecoderError))) {
&samples_per_channel, &num_channels, &type));
// Verify that there is a decoder error to check.
EXPECT_EQ(NetEq::kDecoderErrorCode, neteq_->LastError());
- // Code 6730 is an iSAC error code.
- EXPECT_EQ(6730, neteq_->LastDecoderError());
+
+ enum NetEqDecoderError {
+ ISAC_LENGTH_MISMATCH = 6730,
+ ISAC_RANGE_ERROR_DECODE_FRAME_LENGTH = 6640
+ };
+#if defined(WEBRTC_CODEC_ISAC)
+ EXPECT_EQ(ISAC_LENGTH_MISMATCH, neteq_->LastDecoderError());
+#elif defined(WEBRTC_CODEC_ISACFX)
+ EXPECT_EQ(ISAC_RANGE_ERROR_DECODE_FRAME_LENGTH, neteq_->LastDecoderError());
+#endif
// Verify that the first 160 samples are set to 0, and that the remaining
// samples are left unmodified.
static const int kExpectedOutputLength = 160; // 10 ms at 16 kHz sample rate.
@@ -1137,7 +1148,12 @@ TEST_F(NetEqBgnTestFade, RunTest) {
CheckBgn(32000);
}
-TEST_F(NetEqDecodingTest, IF_ISAC(SyncPacketInsert)) {
+#if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
+#define MAYBE_SyncPacketInsert SyncPacketInsert
+#else
+#define MAYBE_SyncPacketInsert DISABLED_SyncPacketInsert
+#endif
+TEST_F(NetEqDecodingTest, MAYBE_SyncPacketInsert) {
WebRtcRTPHeader rtp_info;
uint32_t receive_timestamp = 0;
// For the readability use the following payloads instead of the defaults of

Powered by Google App Engine
This is Rietveld 408576698