From 201d4b61d1f0447916970a19c494956a50b14ff1 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 2 Jan 2013 19:59:53 +0000 Subject: [PATCH] Fix implicit conversion error in mixing test. TBR=mikhal Review URL: https://webrtc-codereview.appspot.com/1020004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3328 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../test/auto_test/standard/mixing_test.cc | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/webrtc/voice_engine/test/auto_test/standard/mixing_test.cc b/webrtc/voice_engine/test/auto_test/standard/mixing_test.cc index 31d71dd7fc..1d36b82d7c 100644 --- a/webrtc/voice_engine/test/auto_test/standard/mixing_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/mixing_test.cc @@ -194,8 +194,9 @@ class MixingTest : public AfterInitializationFixture { TEST_F(MixingTest, FourChannelsWithOnlyThreeMixed) { const int16_t kInputValue = 1000; const int16_t kExpectedOutput = kInputValue * 3; - RunMixingTest(4, 0, 4, kInputValue, 1.15 * kExpectedOutput, - 0.85 * kExpectedOutput); + RunMixingTest(4, 0, 4, kInputValue, + static_cast(1.15 * kExpectedOutput), + static_cast(0.85 * kExpectedOutput)); } // Ensure the mixing saturation protection is working. We can do this because @@ -207,8 +208,9 @@ TEST_F(MixingTest, VerifySaturationProtection) { // If this isn't satisfied, we're not testing anything. ASSERT_GT(kInputValue * 3, kInt16Max); ASSERT_LT(1.1 * kExpectedOutput, kInt16Max); - RunMixingTest(3, 0, 3, kInputValue, 1.15 * kExpectedOutput, - 0.85 * kExpectedOutput); + RunMixingTest(3, 0, 3, kInputValue, + static_cast(1.15 * kExpectedOutput), + static_cast(0.85 * kExpectedOutput)); } TEST_F(MixingTest, SaturationProtectionHasNoEffectOnOneChannel) { @@ -218,28 +220,31 @@ TEST_F(MixingTest, SaturationProtectionHasNoEffectOnOneChannel) { ASSERT_GT(0.95 * kExpectedOutput, kLimiterHeadroom); // Tighter constraints are required here to properly test this. RunMixingTest(1, 0, 1, kInputValue, kExpectedOutput, - 0.95 * kExpectedOutput); + static_cast(0.95 * kExpectedOutput)); } TEST_F(MixingTest, VerifyAnonymousAndNormalParticipantMixing) { const int16_t kInputValue = 1000; const int16_t kExpectedOutput = kInputValue * 2; - RunMixingTest(1, 1, 1, kInputValue, 1.15 * kExpectedOutput, - 0.85 * kExpectedOutput); + RunMixingTest(1, 1, 1, kInputValue, + static_cast(1.15 * kExpectedOutput), + static_cast(0.85 * kExpectedOutput)); } TEST_F(MixingTest, AnonymousParticipantsAreAlwaysMixed) { const int16_t kInputValue = 1000; const int16_t kExpectedOutput = kInputValue * 4; - RunMixingTest(3, 1, 3, kInputValue, 1.15 * kExpectedOutput, - 0.85 * kExpectedOutput); + RunMixingTest(3, 1, 3, kInputValue, + static_cast(1.15 * kExpectedOutput), + static_cast(0.85 * kExpectedOutput)); } TEST_F(MixingTest, VerifyStereoAndMonoMixing) { const int16_t kInputValue = 1000; const int16_t kExpectedOutput = kInputValue * 2; - RunMixingTest(2, 0, 1, kInputValue, 1.15 * kExpectedOutput, - 0.85 * kExpectedOutput); + RunMixingTest(2, 0, 1, kInputValue, + static_cast(1.15 * kExpectedOutput), + static_cast(0.85 * kExpectedOutput)); } } // namespace webrtc