From 203158b2444c9eb98714292d057c0c87a037ce3b Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 7 Sep 2009 09:30:20 +1000 Subject: Unit tests for QGLFormat copy constructor and operator= Reviewed-by: trustme --- tests/auto/qgl/tst_qgl.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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) -- cgit v0.12