summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-28 02:27:22 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-28 02:27:22 (GMT)
commitbc3c50513a8f8cdb07029ec363a3f2fce9a425b1 (patch)
tree9b26f985ccaab422bfa37bbfb0735fd604cac985
parent4ab6abe2d460cd9c36b92ad7c390fcad9edb5b35 (diff)
parent802a2929a4218987a7a351802f63d2c0f2300bb2 (diff)
downloadQt-bc3c50513a8f8cdb07029ec363a3f2fce9a425b1.zip
Qt-bc3c50513a8f8cdb07029ec363a3f2fce9a425b1.tar.gz
Qt-bc3c50513a8f8cdb07029ec363a3f2fce9a425b1.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--doc/src/examples/hellogl.qdoc12
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.h4
-rw-r--r--tests/auto/qaudioinput/tst_qaudioinput.cpp34
-rw-r--r--tests/auto/qaudiooutput/tst_qaudiooutput.cpp34
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp4
5 files changed, 72 insertions, 16 deletions
diff --git a/doc/src/examples/hellogl.qdoc b/doc/src/examples/hellogl.qdoc
index 77deefe..5fd2c6f 100644
--- a/doc/src/examples/hellogl.qdoc
+++ b/doc/src/examples/hellogl.qdoc
@@ -203,14 +203,14 @@
This class encapsulates the OpenGL geometry data which will be rendered
in the basic 3D scene.
- \snippet examples/opengl/hellogl/qtlogo.h 0
+ \snippet examples/opengl/shared/qtlogo.h 0
The geometry is divided into a list of parts which may be rendered in
different ways. The data itself is contained in a Geometry structure that
includes the vertices, their lighting normals and index values which
point into the vertices, grouping them into faces.
- \snippet examples/opengl/hellogl/qtlogo.cpp 0
+ \snippet examples/opengl/shared/qtlogo.cpp 0
The data in the Geometry class is stored in QVector<QVector3D> members
which are convenient for use with OpenGL because they expose raw
@@ -218,7 +218,7 @@
are included for adding new vertex data, either with smooth normals, or
facetted normals; and for enabling the geometry ready for rendering.
- \snippet examples/opengl/hellogl/qtlogo.cpp 1
+ \snippet examples/opengl/shared/qtlogo.cpp 1
The higher level Patch class has methods for accumulating the geometry
one face at a time, and treating collections of faces or "patches" with
@@ -226,14 +226,14 @@
may be added as triangles or quads, at the OpenGL level all data is
treated as triangles for compatibility with OpenGL/ES.
- \snippet examples/opengl/hellogl/qtlogo.cpp 2
+ \snippet examples/opengl/shared/qtlogo.cpp 2
Drawing a Patch is simply acheived by applying any transformation,
and material effect, then drawing the data using the index range for
the patch. The model-view matrix is saved and then restored so that
any transformation does not affect other parts of the scene.
- \snippet examples/opengl/hellogl/qtlogo.cpp 3
+ \snippet examples/opengl/shared/qtlogo.cpp 3
The geometry is built once on construction of the QtLogo, and it is
paramaterized on a number of divisions - which controls how "chunky" the
@@ -245,7 +245,7 @@
details) which only exist during the build phase, to assemble the parts
of the scene.
- \snippet examples/opengl/hellogl/qtlogo.cpp 4
+ \snippet examples/opengl/shared/qtlogo.cpp 4
Finally the complete QtLogo scene is simply drawn by enabling the data arrays
and then iterating over the parts, calling draw() on each one.
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h
index 68f418e..5c08bf4 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.h
+++ b/src/multimedia/audio/qaudiooutput_win32_p.h
@@ -104,10 +104,6 @@ private slots:
void feedback();
bool deviceReady();
-signals:
- void stateChanged(QAudio::State);
- void notify();
-
private:
QByteArray m_device;
bool resuming;
diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp
index 7331072..69b507d 100644
--- a/tests/auto/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp
@@ -56,6 +56,7 @@ public:
private slots:
void initTestCase();
void settings();
+ void buffers();
void notifyInterval();
void pullFile();
@@ -90,6 +91,7 @@ void tst_QAudioInput::initTestCase()
void tst_QAudioInput::settings()
{
if(available) {
+ // Confirm the setting we added in the init function.
QAudioFormat f = audio->format();
QVERIFY(format.channels() == f.channels());
@@ -101,6 +103,18 @@ void tst_QAudioInput::settings()
}
}
+void tst_QAudioInput::buffers()
+{
+ if(available) {
+ // Should always have a buffer size greater than zero.
+ int store = audio->bufferSize();
+ audio->setBufferSize(4096);
+ QVERIFY(audio->bufferSize() > 0);
+ audio->setBufferSize(store);
+ QVERIFY(audio->bufferSize() == store);
+ }
+}
+
void tst_QAudioInput::notifyInterval()
{
if(available) {
@@ -120,14 +134,32 @@ void tst_QAudioInput::pullFile()
filename.open( QIODevice::WriteOnly | QIODevice::Truncate );
QSignalSpy readSignal(audio, SIGNAL(notify()));
- audio->start(&filename);
+ QSignalSpy stateSignal(audio, SIGNAL(stateChanged(QAudio::State)));
+
+ // Always have default states, before start
+ QVERIFY(audio->state() == QAudio::StopState);
+ QVERIFY(audio->error() == QAudio::NoError);
+ audio->start(&filename);
+ QTest::qWait(20);
+ // Check state and periodSize() are valid non-zero values.
+ QVERIFY(audio->state() == QAudio::ActiveState);
+ QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->periodSize() > 0);
+ QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
+
+ // Wait until finished...
QTest::qWait(5000);
QVERIFY(readSignal.count() > 0);
QVERIFY(audio->totalTime() > 0);
audio->stop();
+ QTest::qWait(20);
+ QVERIFY(audio->state() == QAudio::StopState);
+ // Can only check to make sure we got at least 1 more signal, but can be more.
+ QVERIFY(stateSignal.count() > 1);
+
filename.close();
}
}
diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
index b45a57e..f1c75dc 100644
--- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
+++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
@@ -58,6 +58,7 @@ public:
private slots:
void initTestCase();
void settings();
+ void buffers();
void notifyInterval();
void pullFile();
void pushFile();
@@ -91,6 +92,7 @@ void tst_QAudioOutput::initTestCase()
void tst_QAudioOutput::settings()
{
if(available) {
+ // Confirm the setting we added in the init function.
QAudioFormat f = audio->format();
QVERIFY(format.channels() == f.channels());
@@ -102,6 +104,18 @@ void tst_QAudioOutput::settings()
}
}
+void tst_QAudioOutput::buffers()
+{
+ if(available) {
+ // Should always have a buffer size greater than zero.
+ int store = audio->bufferSize();
+ audio->setBufferSize(4096);
+ QVERIFY(audio->bufferSize() > 0);
+ audio->setBufferSize(store);
+ QVERIFY(audio->bufferSize() == store);
+ }
+}
+
void tst_QAudioOutput::notifyInterval()
{
if(available) {
@@ -122,15 +136,33 @@ void tst_QAudioOutput::pullFile()
file.open(QIODevice::ReadOnly);
QSignalSpy readSignal(audio, SIGNAL(notify()));
+ QSignalSpy stateSignal(audio, SIGNAL(stateChanged(QAudio::State)));
audio->setNotifyInterval(100);
- audio->start(&file);
+ // Always have default states, before start
+ QVERIFY(audio->state() == QAudio::StopState);
+ QVERIFY(audio->error() == QAudio::NoError);
+
+ audio->start(&file);
+ QTest::qWait(20); // wait 20ms
+ // Check state, bytesFree() and periodSize() are valid non-zero values.
+ QVERIFY(audio->state() == QAudio::ActiveState);
+ QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->periodSize() > 0);
+ QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
+
+ // Wait until finished...
QTestEventLoop::instance().enterLoop(1);
QCOMPARE(audio->totalTime(), qint64(692250));
// 4.wav is a little less than 700ms, so notify should fire 6 times!
QVERIFY(readSignal.count() >= 6);
audio->stop();
+ QTest::qWait(20); // wait 20ms
+ QVERIFY(audio->state() == QAudio::StopState);
+ // Can only check to make sure we got at least 1 more signal, but can be more.
+ QVERIFY(stateSignal.count() > 1);
+
file.close();
}
}
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 4198bfc..ce2396d 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1705,8 +1705,6 @@ void tst_QSqlDatabase::precisionPolicy()
QEXPECT_FAIL("QOCI", "Oracle fails here, to retrieve next", Continue);
QVERIFY_SQL(q, exec(query));
QVERIFY_SQL(q, next());
- if(db.driverName().startsWith("QSQLITE"))
- QEXPECT_FAIL("", "SQLite returns this value as determined by contents of the field, not the declaration", Continue);
QCOMPARE(q.value(0).type(), QVariant::LongLong);
QSql::NumericalPrecisionPolicy oldPrecision= db.numericalPrecisionPolicy();
@@ -1715,8 +1713,6 @@ void tst_QSqlDatabase::precisionPolicy()
q2.exec(QString("SELECT num FROM %1 WHERE id = 2").arg(tableName));
QVERIFY_SQL(q2, exec(query));
QVERIFY_SQL(q2, next());
- if(db.driverName().startsWith("QSQLITE"))
- QEXPECT_FAIL("", "SQLite returns this value as determined by contents of the field, not the declaration", Continue);
QCOMPARE(q2.value(0).type(), QVariant::LongLong);
db.setNumericalPrecisionPolicy(oldPrecision);
}