diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-06 23:30:20 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-06 23:30:20 (GMT) |
commit | 203158b2444c9eb98714292d057c0c87a037ce3b (patch) | |
tree | e1e0dccf0796c19dcd34b08f84dc50878de2ffee /tests/auto/qgl | |
parent | a470652c5ffadfa039dde48a88348e8314a6bc9a (diff) | |
download | Qt-203158b2444c9eb98714292d057c0c87a037ce3b.zip Qt-203158b2444c9eb98714292d057c0c87a037ce3b.tar.gz Qt-203158b2444c9eb98714292d057c0c87a037ce3b.tar.bz2 |
Unit tests for QGLFormat copy constructor and operator=
Reviewed-by: trustme
Diffstat (limited to 'tests/auto/qgl')
-rw-r--r-- | tests/auto/qgl/tst_qgl.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 6c444e4..0fefbf3 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -485,6 +485,20 @@ void tst_QGL::getSetCheck() QVERIFY(format1 == format2); QVERIFY(!(format1 != format2)); + // Copy constructor and assignment for QGLFormat. + QGLFormat format3(format1); + QGLFormat format4; + QVERIFY(format1 == format3); + QVERIFY(format1 != format4); + format4 = format1; + QVERIFY(format1 == format4); + + // Check that modifying a copy doesn't affect the original. + format3.setRedBufferSize(16); + format4.setPlane(16); + QCOMPARE(format1.redBufferSize(), 8); + QCOMPARE(format1.plane(), 8); + MyGLContext obj2(obj1); // bool QGLContext::windowCreated() // void QGLContext::setWindowCreated(bool) |