aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-01-12 15:25:01 -0600
committerCharles Kerr <charles.kerr@canonical.com>2016-01-12 15:25:01 -0600
commit6896873e00be36984e1fa467e6becef5d6cdc1dc (patch)
tree86b0e39297005955ccc4faf7249ce5b960fcaced
parentab794272cf6c367b9d1414415589cd4079a736f4 (diff)
downloadayatana-indicator-sound-6896873e00be36984e1fa467e6becef5d6cdc1dc.tar.gz
ayatana-indicator-sound-6896873e00be36984e1fa467e6becef5d6cdc1dc.tar.bz2
ayatana-indicator-sound-6896873e00be36984e1fa467e6becef5d6cdc1dc.zip
in the integration tests, clamp the random volume selection to a range that won't cause the loud-volume-warning code to interfere with the test
-rw-r--r--tests/integration/test-indicator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/integration/test-indicator.cpp b/tests/integration/test-indicator.cpp
index dca0bb6..679ec2a 100644
--- a/tests/integration/test-indicator.cpp
+++ b/tests/integration/test-indicator.cpp
@@ -46,11 +46,11 @@ TEST_F(TestIndicator, PhoneChangeRoleVolume)
// start now the indicator, so it picks the new volumes
ASSERT_NO_THROW(startIndicator());
- // Generate a random volume
+ // Generate a random volume in the range [0...0.33]
QTime now = QTime::currentTime();
qsrand(now.msec());
- int randInt = qrand() % 100;
- double randomVolume = randInt / 100.0;
+ int randInt = qrand() % 33;
+ const double randomVolume = randInt / 100.0;
QSignalSpy &userAccountsSpy = *signal_spy_volume_changed_;
// set an initial volume to the alert role
@@ -557,11 +557,11 @@ TEST_F(TestIndicator, DesktopChangeRoleVolume)
// start now the indicator, so it picks the new volumes
ASSERT_NO_THROW(startIndicator());
- // Generate a random volume
+ // Generate a random volume in the range [0...0.33]
QTime now = QTime::currentTime();
qsrand(now.msec());
- int randInt = qrand() % 100;
- double randomVolume = randInt / 100.0;
+ int randInt = qrand() % 33;
+ const double randomVolume = randInt / 100.0;
// play a test sound, it should NOT change the role in the indicator
EXPECT_TRUE(startTestSound("multimedia"));