summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-08-24 14:10:57 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-28 00:33:19 +0200
commit2750ad7f862cedc7600637c442eea0caf29b1fd8 (patch)
tree11b068070d3203e2cbfac31311c1a5b3e5a0c450 /tests/auto
parenta1637c935a0c7055cfc905c02d072af8e54fc948 (diff)
Pass through invalid data rates to the backend instead of ignoring them
This gives the backend the chance to do something sensible with it, at the expense of the data rate not being reported correctly in those cases. Change-Id: Iadf72b4448145f2454bc9422dde094ad799cb17a Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qsensor/tst_qsensor.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/auto/qsensor/tst_qsensor.cpp b/tests/auto/qsensor/tst_qsensor.cpp
index 38c32e76..534a14d9 100644
--- a/tests/auto/qsensor/tst_qsensor.cpp
+++ b/tests/auto/qsensor/tst_qsensor.cpp
@@ -364,14 +364,14 @@ private slots:
QCOMPARE(actual, expected);
}
- // Test that a previously-set, invalid data rate is reset to 0
+ // Test that a previously-set, invalid data rate is retained
{
TestSensor sensor;
sensor.setDataRate(50);
sensor.setProperty("doThis", "rates");
sensor.connectToBackend();
int actual = sensor.dataRate();
- int expected = 0;
+ int expected = 50;
QCOMPARE(actual, expected);
}
@@ -533,13 +533,11 @@ private slots:
TestSensor sensor;
sensor.connectToBackend();
- QTest::ignoreMessage(QtWarningMsg, "setDataRate: 1 is not supported by the sensor. ");
sensor.setDataRate(1);
- QCOMPARE(sensor.dataRate(), 0);
+ QCOMPARE(sensor.dataRate(), 1);
- QTest::ignoreMessage(QtWarningMsg, "setDataRate: 1000 is not supported by the sensor. ");
sensor.setDataRate(1000);
- QCOMPARE(sensor.dataRate(), 0);
+ QCOMPARE(sensor.dataRate(), 1000);
}
void testSetBadDataRateWhenNotConnected()
@@ -550,9 +548,8 @@ private slots:
sensor.setDataRate(300);
QCOMPARE(sensor.dataRate(), 300);
sensor.setDataRate(350);
- QTest::ignoreMessage(QtWarningMsg, "setDataRate: 350 is not supported by the sensor. ");
sensor.connectToBackend();
- QCOMPARE(sensor.dataRate(), 0);
+ QCOMPARE(sensor.dataRate(), 350);
}
void testSetBadOutputRange()