diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-15 22:04:46 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-15 22:13:09 (GMT) |
commit | 0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3 (patch) | |
tree | b5917c87769d657b16d6b726d59c4e3ae1839d96 /tests/auto/qgl/tst_qgl.cpp | |
parent | bb818bf70cef00bbdcafaac1bf017575baeab8dc (diff) | |
download | Qt-0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3.zip Qt-0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3.tar.gz Qt-0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3.tar.bz2 |
Make isSharing() reset to false when context no longer sharing
The documentation for QGLContext::isSharing() indicates that
the function returns true only when the context is sharing.
However, previously the sharing flag would stay on if the
context was created as sharing but is no longer sharing.
Task-number: QTBUG-5578
Reviewed-by: Sarah Smith
Diffstat (limited to 'tests/auto/qgl/tst_qgl.cpp')
-rw-r--r-- | tests/auto/qgl/tst_qgl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index ccb08c3..5dc072d 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1842,6 +1842,7 @@ void tst_QGL::shareRegister() QVERIFY(qt_shared_test()->value(glw1->context()) == res1); // Create another context that shares with the first. + QVERIFY(!glw1->isSharing()); QGLWidget *glw2 = new QGLWidget(0, glw1); if (!glw2->isSharing()) { delete glw2; @@ -1880,6 +1881,7 @@ void tst_QGL::shareRegister() // Create a third context, not sharing with the others. QGLWidget *glw3 = new QGLWidget(); + QVERIFY(!glw3->isSharing()); // Create a guard on the standalone context. QGLSharedResourceGuard guard3(glw3->context()); @@ -1928,6 +1930,9 @@ void tst_QGL::shareRegister() // Delete the first context. delete glw1; + // The second context should no longer register as sharing. + QVERIFY(!glw2->isSharing()); + // The first context's resource should transfer to the second context. QCOMPARE(tst_QGLResource::deletions, 0); QVERIFY(qt_shared_test()->value(glw2->context()) == res1); |