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

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: Added missing sha1 files. 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..09df04691f5560c08b138ea4b11193b4fa68110d 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);
+#ifdef WEBRTC_ANDROID
+ // Payload type 104 is not supported on android.
+ if (rtp_header.header.payloadType != 104)
+#endif
ASSERT_EQ(0, neteq_->InsertPacket(
rtp_header,
rtc::ArrayView<const uint8_t>(
@@ -510,14 +514,14 @@ 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
#define MAYBE_TestBitExactness DISABLED_TestBitExactness
#endif
+
TEST_F(NetEqDecodingTest, MAYBE_TestBitExactness) {
const std::string input_rtp_file = webrtc::test::ProjectRootPath() +
"resources/audio_coding/neteq_universal_new.rtp";
@@ -902,7 +906,7 @@ TEST_F(NetEqDecodingTest, UnknownPayloadType) {
#define IF_ISAC(x) DISABLED_##x
#endif
-TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(IF_ISAC(DecoderError))) {
+TEST_F(NetEqDecodingTest, IF_ISAC(DecoderError)) {
minyue-webrtc 2015/12/17 14:32:58 may you change this to MAYBE_? #if defined(WEBRTC
ivoc 2015/12/17 15:06:28 Good idea, done.
const size_t kPayloadBytes = 100;
uint8_t payload[kPayloadBytes] = {0};
WebRtcRTPHeader rtp_info;
@@ -922,8 +926,12 @@ 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.
+
+#if defined(WEBRTC_CODEC_ISAC)
EXPECT_EQ(6730, neteq_->LastDecoderError());
minyue-webrtc 2015/12/17 14:32:58 would you use enum (see below) or const for these
ivoc 2015/12/17 15:06:28 Thanks for the suggestion, looks more clear.
+#else
minyue-webrtc 2015/12/17 14:32:58 maybe use #elif defined(WEBRTC_CODEC_ISACFX)
ivoc 2015/12/17 15:06:27 Done.
+ EXPECT_EQ(6640, 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.

Powered by Google App Engine
This is Rietveld 408576698