VoEVolumeTest: Adds error return tests.
BUG=367
TESTED=trybots, voe_auto_test
R=henrikg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/19469006
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6139 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/voice_engine/test/auto_test/standard/volume_test.cc b/voice_engine/test/auto_test/standard/volume_test.cc
index e4a9bd2..3e79430 100644
--- a/voice_engine/test/auto_test/standard/volume_test.cc
+++ b/voice_engine/test/auto_test/standard/volume_test.cc
@@ -31,6 +31,23 @@
// investigation in
// http://code.google.com/p/webrtc/issues/detail?id=367
+TEST_F(VolumeTest, VerifyCorrectErrorReturns) {
+ // All tests run on correct initialization which eliminates one possible error
+ // return. In addition, we assume the audio_device returning values without
+ // error, which eliminates another potential error.
+ // Left to verify are sanity checks of set parameters.
+
+ // Valid volume range: [0, 255]
+ EXPECT_EQ(-1, voe_volume_control_->SetSpeakerVolume(256));
+ EXPECT_EQ(-1, voe_volume_control_->SetMicVolume(256));
+
+ // Valid panning rage: [0, 1]
+ EXPECT_EQ(-1, voe_volume_control_->SetOutputVolumePan(channel_, -0.1f, 0.5f));
+ EXPECT_EQ(-1, voe_volume_control_->SetOutputVolumePan(channel_, 1.1f, 0.5f));
+ EXPECT_EQ(-1, voe_volume_control_->SetOutputVolumePan(channel_, 0.5f, -0.1f));
+ EXPECT_EQ(-1, voe_volume_control_->SetOutputVolumePan(channel_, 0.5f, 1.1f));
+}
+
TEST_F(VolumeTest, DefaultSpeakerVolumeIsAtMost255) {
unsigned int volume = 1000;
EXPECT_EQ(0, voe_volume_control_->GetSpeakerVolume(volume));