diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-06 23:17:08 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-06 23:17:08 (GMT) |
commit | a470652c5ffadfa039dde48a88348e8314a6bc9a (patch) | |
tree | 0f32d5b6f65e162bb99638f88e6ccc6414209dad /tests/auto | |
parent | d7bae8cd7684dd509fee56415f823b0c19b5d879 (diff) | |
download | Qt-a470652c5ffadfa039dde48a88348e8314a6bc9a.zip Qt-a470652c5ffadfa039dde48a88348e8314a6bc9a.tar.gz Qt-a470652c5ffadfa039dde48a88348e8314a6bc9a.tar.bz2 |
Update QGLFormat::operator== to include all fields.
The documentation says "Returns true if all the options of the
two QGLFormats are equal", but that's not what it was doing.
Reviewed-by: Sarah Smith
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qgl/tst_qgl.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
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) |