summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opengl/qgl.cpp7
-rw-r--r--tests/auto/qgl/tst_qgl.cpp83
2 files changed, 89 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index dde4eba..ef07447 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1256,7 +1256,12 @@ bool operator==(const QGLFormat& a, const QGLFormat& b)
{
return (int) a.d->opts == (int) b.d->opts && a.d->pln == b.d->pln && a.d->alphaSize == b.d->alphaSize
&& a.d->accumSize == b.d->accumSize && a.d->stencilSize == b.d->stencilSize
- && a.d->depthSize == b.d->depthSize;
+ && a.d->depthSize == b.d->depthSize
+ && a.d->redSize == b.d->redSize
+ && a.d->greenSize == b.d->greenSize
+ && a.d->blueSize == b.d->blueSize
+ && a.d->numSamples == b.d->numSamples
+ && a.d->swapInterval == b.d->swapInterval;
}
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 77e32ef..6c444e4 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -402,6 +402,89 @@ void tst_QGL::getSetCheck()
obj1.setPlane(TEST_INT_MAX);
QCOMPARE(TEST_INT_MAX, obj1.plane());
+ // operator== and operator!= for QGLFormat
+ QGLFormat format1;
+ QGLFormat format2;
+
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+ format1.setDoubleBuffer(false);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setDoubleBuffer(false);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setDepthBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setDepthBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setAccumBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setAccumBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setRedBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setRedBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setGreenBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setGreenBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setBlueBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setBlueBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setAlphaBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setAlphaBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setStencilBufferSize(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setStencilBufferSize(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setSamples(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setSamples(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setSwapInterval(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setSwapInterval(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setPlane(8);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setPlane(8);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
MyGLContext obj2(obj1);
// bool QGLContext::windowCreated()
// void QGLContext::setWindowCreated(bool)