@@ -519,13 +519,36 @@ TEST(TargetTest, SoundEffects)
519519 ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pan), 0 );
520520
521521 auto s1 = std::make_shared<SoundMock>();
522+ EXPECT_CALL (*s1, setVolume);
523+ target.addSound (s1);
524+
525+ EXPECT_CALL (*s1, setEffect (Sound::Effect::Pitch, -360 ));
526+ target.setSoundEffectValue (Sound::Effect::Pitch, -400 );
527+ ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pitch), -360 );
528+
529+ EXPECT_CALL (*s1, setEffect (Sound::Effect::Pitch, 360 ));
530+ target.setSoundEffectValue (Sound::Effect::Pitch, 400 );
531+ ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pitch), 360 );
532+
533+ EXPECT_CALL (*s1, setEffect (Sound::Effect::Pan, -100 ));
534+ target.setSoundEffectValue (Sound::Effect::Pan, -200 );
535+ ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pan), -100 );
536+
537+ EXPECT_CALL (*s1, setEffect (Sound::Effect::Pan, 100 ));
538+ target.setSoundEffectValue (Sound::Effect::Pan, 200 );
539+ ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pan), 100 );
540+
541+ EXPECT_CALL (*s1, setEffect (Sound::Effect::Pitch, 0 ));
542+ EXPECT_CALL (*s1, setEffect (Sound::Effect::Pan, 0 ));
543+ target.clearSoundEffects ();
544+ ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pitch), 0 );
545+ ASSERT_EQ (target.soundEffectValue (Sound::Effect::Pan), 0 );
546+
522547 auto s2 = std::make_shared<SoundMock>();
523548 auto s3 = std::make_shared<SoundMock>();
524549
525- EXPECT_CALL (*s1, setVolume);
526550 EXPECT_CALL (*s2, setVolume);
527551 EXPECT_CALL (*s3, setVolume);
528- target.addSound (s1);
529552 target.addSound (s2);
530553 target.addSound (s3);
531554
0 commit comments