summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-01-08 08:22:10 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-01-08 08:22:10 (GMT)
commit6e99e7c7d772e122b0e515c1613d9a1e427181ad (patch)
tree08ba4a1db8d17bffa2a69a0538298818668e50fd /tests
parent751de8211033b40c66d88140137eef76e6b20cfa (diff)
parent118e7a807d0764dee97612589fe5d7072d271e1e (diff)
downloadQt-6e99e7c7d772e122b0e515c1613d9a1e427181ad.zip
Qt-6e99e7c7d772e122b0e515c1613d9a1e427181ad.tar.gz
Qt-6e99e7c7d772e122b0e515c1613d9a1e427181ad.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: src/multimedia/audio/qaudioformat.cpp
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp16
-rw-r--r--tests/auto/qaudioformat/tst_qaudioformat.cpp26
-rw-r--r--tests/auto/qaudioinput/tst_qaudioinput.cpp8
-rw-r--r--tests/auto/qaudiooutput/tst_qaudiooutput.cpp8
-rw-r--r--tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp17
5 files changed, 46 insertions, 29 deletions
diff --git a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
index d3d81e6..e332e11 100644
--- a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
+++ b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
@@ -128,7 +128,7 @@ void tst_QAudioDeviceInfo::codecs()
void tst_QAudioDeviceInfo::channels()
{
if(available) {
- QList<int> avail = device->supportedChannels();
+ QList<int> avail = device->supportedChannelCounts();
QVERIFY(avail.size() > 0);
}
}
@@ -160,7 +160,7 @@ void tst_QAudioDeviceInfo::sampleTypes()
void tst_QAudioDeviceInfo::frequencies()
{
if(available) {
- QList<int> avail = device->supportedFrequencies();
+ QList<int> avail = device->supportedSampleRates();
QVERIFY(avail.size() > 0);
}
}
@@ -169,8 +169,8 @@ void tst_QAudioDeviceInfo::isformat()
{
if(available) {
QAudioFormat format;
- format.setFrequency(44100);
- format.setChannels(2);
+ format.setSampleRate(44100);
+ format.setChannelCount(2);
format.setSampleType(QAudioFormat::SignedInt);
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleSize(16);
@@ -185,8 +185,8 @@ void tst_QAudioDeviceInfo::preferred()
{
if(available) {
QAudioFormat format = device->preferredFormat();
- QVERIFY(format.frequency() == 44100);
- QVERIFY(format.channels() == 2);
+ QVERIFY(format.sampleRate() == 44100);
+ QVERIFY(format.channelCount() == 2);
}
}
@@ -194,9 +194,9 @@ void tst_QAudioDeviceInfo::nearest()
{
if(available) {
QAudioFormat format1, format2;
- format1.setFrequency(8000);
+ format1.setSampleRate(8000);
format2 = device->nearestFormat(format1);
- QVERIFY(format2.frequency() == 44100);
+ QVERIFY(format2.sampleRate() == 44100);
}
}
diff --git a/tests/auto/qaudioformat/tst_qaudioformat.cpp b/tests/auto/qaudioformat/tst_qaudioformat.cpp
index 0206798..a7200c4 100644
--- a/tests/auto/qaudioformat/tst_qaudioformat.cpp
+++ b/tests/auto/qaudioformat/tst_qaudioformat.cpp
@@ -77,8 +77,8 @@ void tst_QAudioFormat::checkNull()
QAudioFormat audioFormat1(audioFormat0);
QVERIFY(!audioFormat1.isValid());
- audioFormat0.setFrequency(44100);
- audioFormat0.setChannels(2);
+ audioFormat0.setSampleRate(44100);
+ audioFormat0.setChannelCount(2);
audioFormat0.setSampleSize(16);
audioFormat0.setCodec("audio/pcm");
audioFormat0.setSampleType(QAudioFormat::SignedInt);
@@ -88,15 +88,15 @@ void tst_QAudioFormat::checkNull()
void tst_QAudioFormat::checkFrequency()
{
QAudioFormat audioFormat;
- audioFormat.setFrequency(44100);
- QVERIFY(audioFormat.frequency() == 44100);
+ audioFormat.setSampleRate(44100);
+ QVERIFY(audioFormat.sampleRate() == 44100);
}
void tst_QAudioFormat::checkChannels()
{
QAudioFormat audioFormat;
- audioFormat.setChannels(2);
- QVERIFY(audioFormat.channels() == 2);
+ audioFormat.setChannelCount(2);
+ QVERIFY(audioFormat.channelCount() == 2);
}
void tst_QAudioFormat::checkSampleSize()
@@ -137,15 +137,15 @@ void tst_QAudioFormat::checkEquality()
QVERIFY(!(audioFormat0 != audioFormat1));
// on filled formats
- audioFormat0.setFrequency(8000);
- audioFormat0.setChannels(1);
+ audioFormat0.setSampleRate(8000);
+ audioFormat0.setChannelCount(1);
audioFormat0.setSampleSize(8);
audioFormat0.setCodec("audio/pcm");
audioFormat0.setByteOrder(QAudioFormat::LittleEndian);
audioFormat0.setSampleType(QAudioFormat::UnSignedInt);
- audioFormat1.setFrequency(8000);
- audioFormat1.setChannels(1);
+ audioFormat1.setSampleRate(8000);
+ audioFormat1.setChannelCount(1);
audioFormat1.setSampleSize(8);
audioFormat1.setCodec("audio/pcm");
audioFormat1.setByteOrder(QAudioFormat::LittleEndian);
@@ -154,7 +154,7 @@ void tst_QAudioFormat::checkEquality()
QVERIFY(audioFormat0 == audioFormat1);
QVERIFY(!(audioFormat0 != audioFormat1));
- audioFormat0.setFrequency(44100);
+ audioFormat0.setSampleRate(44100);
QVERIFY(audioFormat0 != audioFormat1);
QVERIFY(!(audioFormat0 == audioFormat1));
}
@@ -164,8 +164,8 @@ void tst_QAudioFormat::checkAssignment()
QAudioFormat audioFormat0;
QAudioFormat audioFormat1;
- audioFormat0.setFrequency(8000);
- audioFormat0.setChannels(1);
+ audioFormat0.setSampleRate(8000);
+ audioFormat0.setChannelCount(1);
audioFormat0.setSampleSize(8);
audioFormat0.setCodec("audio/pcm");
audioFormat0.setByteOrder(QAudioFormat::LittleEndian);
diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp
index 40b7fbb..9468413 100644
--- a/tests/auto/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp
@@ -68,8 +68,8 @@ private:
void tst_QAudioInput::initTestCase()
{
- format.setFrequency(8000);
- format.setChannels(1);
+ format.setSampleRate(8000);
+ format.setChannelCount(1);
format.setSampleSize(8);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
@@ -94,8 +94,8 @@ void tst_QAudioInput::settings()
// Confirm the setting we added in the init function.
QAudioFormat f = audio->format();
- QVERIFY(format.channels() == f.channels());
- QVERIFY(format.frequency() == f.frequency());
+ QVERIFY(format.channelCount() == f.channelCount());
+ QVERIFY(format.sampleRate() == f.sampleRate());
QVERIFY(format.sampleSize() == f.sampleSize());
QVERIFY(format.codec() == f.codec());
QVERIFY(format.byteOrder() == f.byteOrder());
diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
index aeb2286..5005838 100644
--- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
+++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
@@ -71,8 +71,8 @@ private:
void tst_QAudioOutput::initTestCase()
{
- format.setFrequency(8000);
- format.setChannels(1);
+ format.setSampleRate(8000);
+ format.setChannelCount(1);
format.setSampleSize(8);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
@@ -95,8 +95,8 @@ void tst_QAudioOutput::settings()
// Confirm the setting we added in the init function.
QAudioFormat f = audio->format();
- QVERIFY(format.channels() == f.channels());
- QVERIFY(format.frequency() == f.frequency());
+ QVERIFY(format.channelCount() == f.channelCount());
+ QVERIFY(format.sampleRate() == f.sampleRate());
QVERIFY(format.sampleSize() == f.sampleSize());
QVERIFY(format.codec() == f.codec());
QVERIFY(format.byteOrder() == f.byteOrder());
diff --git a/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
index d2f8090..5bd07f9 100644
--- a/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -64,6 +64,7 @@ private slots:
void addItem();
void itemAt_data();
void itemAt();
+ void initialShow();
};
tst_QGraphicsScene::tst_QGraphicsScene()
@@ -227,5 +228,21 @@ void tst_QGraphicsScene::itemAt()
qApp->processEvents();
}
+void tst_QGraphicsScene::initialShow()
+{
+ QGraphicsScene scene;
+
+ QBENCHMARK {
+ for (int y = 0; y < 30000; ++y) {
+ QGraphicsRectItem *item = new QGraphicsRectItem(0, 0, 50, 50);
+ item->setPos((y/2) * item->rect().width(), (y/2) * item->rect().height());
+ scene.addItem(item);
+ }
+ scene.itemAt(0, 0); // triggers indexing
+ //This call polish the items so we bench their processing too.
+ qApp->processEvents();
+ }
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"