Exemplo n.º 1
0
        public void EnableTurbo()
        {
            // Act
            _machine.EnableTurbo(true);
            _machine.Start();
            if (!RunUntilAudioOverrun(_machine.Core, 10000))
            {
                Assert.Fail("Failed to wait for audio overrun.");
            }

            UInt64 turboDuration = _machine.Core.Ticks;

            // Empty out the audio buffer.
            _machine.AdvancePlayback(1000000);

            _machine.EnableTurbo(false);
            if (!RunUntilAudioOverrun(_machine.Core, 10000))
            {
                Assert.Fail("Failed to wait for audio overrun.");
            }

            UInt64 normalDuration = _machine.Core.Ticks - turboDuration;

            // Verify - speed should be at least doubled.
            double actualSpeedFactor = ((double)turboDuration) / ((double)normalDuration);

            Assert.Greater(actualSpeedFactor, 2);
        }