From ba0f9fe10b7553f641ab389e3834940dc4835cd3 Mon Sep 17 00:00:00 2001 From: "braveyao@webrtc.org" Date: Mon, 7 May 2012 10:06:43 +0000 Subject: [PATCH] Trival fix to voe_auto_test according to the main source codes BUG = NULL TEST = voe_auto_test Review URL: https://webrtc-codereview.appspot.com/554004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2184 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/test/auto_test/voe_extended_test.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/voice_engine/main/test/auto_test/voe_extended_test.cc b/src/voice_engine/main/test/auto_test/voe_extended_test.cc index ee3e9adb7b..2cf29ddbcb 100644 --- a/src/voice_engine/main/test/auto_test/voe_extended_test.cc +++ b/src/voice_engine/main/test/auto_test/voe_extended_test.cc @@ -1881,11 +1881,17 @@ int VoEExtendedTest::TestCodec() { for (int channels = 1; channels < 4; channels++) { cinst.channels = channels; if (-1 != codec->SetSendCodec(0, cinst)) { - // valid channels (only 1 should be OK) + // Valid channels currently. + // 1 should always be OK for all codecs. + // 2 is OK for stereo codecs and some of mono codecs. TEST_LOG("%d ", channels); } else { + // Invalide channels. Currently there should be two cases: + // 2 would fail to some mono codecs with VE_CANNOT_SET_SEND_CODEC; + // 3(and higher) should always fail with VE_INVALID_ARGUMENT. err = voe_base_->LastError(); - TEST_MUSTPASS(err != VE_INVALID_ARGUMENT); + ASSERT_TRUE((err == VE_INVALID_ARGUMENT)|| + (err == VE_CANNOT_SET_SEND_CODEC)); } } cinst.channels = defaultCodec.channels; @@ -5051,10 +5057,11 @@ int VoEExtendedTest::TestHardware() { TEST_MUSTPASS(voe_base_->Terminate()); #endif // defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) - // Invalid arguments + // Invalid arguments should be ignored. wantedLayer = (AudioLayers) 17; - TEST_MUSTPASS(-1 != hardware->SetAudioDeviceLayer(wantedLayer)); - TEST_MUSTPASS(VE_INVALID_ARGUMENT != voe_base_->LastError()); + TEST_MUSTPASS(hardware->SetAudioDeviceLayer(wantedLayer)); + TEST_MUSTPASS(hardware->GetAudioDeviceLayer(givenLayer)); + ASSERT_TRUE(givenLayer == kAudioPlatformDefault); MARK(); // Basic usage