diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-08 03:00:43 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-08 03:00:43 (GMT) |
commit | 2ed2632acec45ce4979ce21a0fe93d286a16613c (patch) | |
tree | 58e5a824f874fffcf533e04dae1845ace2667cd0 /tests/auto | |
parent | 79ad2c1d4f5205245c929be1c0db2c678d185038 (diff) | |
download | Qt-2ed2632acec45ce4979ce21a0fe93d286a16613c.zip Qt-2ed2632acec45ce4979ce21a0fe93d286a16613c.tar.gz Qt-2ed2632acec45ce4979ce21a0fe93d286a16613c.tar.bz2 |
Add operator== and != to QGLFramebufferObjectFormat
Reviewed-by: Sarah Smith
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qgl/tst_qgl.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 650c1ca..43f4227 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1432,6 +1432,55 @@ void tst_QGL::fboFormat() QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil); QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D)); QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16)); + + // operator== and operator!= for QGLFramebufferObjectFormat. + QGLFramebufferObjectFormat format1c; + QGLFramebufferObjectFormat format2c; + + QVERIFY(format1c == format2c); + QVERIFY(!(format1c != format2c)); + format1c.setSamples(8); + QVERIFY(!(format1c == format2c)); + QVERIFY(format1c != format2c); + format2c.setSamples(8); + QVERIFY(format1c == format2c); + QVERIFY(!(format1c != format2c)); + + format1c.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + QVERIFY(!(format1c == format2c)); + QVERIFY(format1c != format2c); + format2c.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + QVERIFY(format1c == format2c); + QVERIFY(!(format1c != format2c)); + + format1c.setTextureTarget(GL_TEXTURE_3D); + QVERIFY(!(format1c == format2c)); + QVERIFY(format1c != format2c); + format2c.setTextureTarget(GL_TEXTURE_3D); + QVERIFY(format1c == format2c); + QVERIFY(!(format1c != format2c)); + + format1c.setInternalTextureFormat(GL_RGB16); + QVERIFY(!(format1c == format2c)); + QVERIFY(format1c != format2c); + format2c.setInternalTextureFormat(GL_RGB16); + QVERIFY(format1c == format2c); + QVERIFY(!(format1c != format2c)); + + QGLFramebufferObjectFormat format3c(format1c); + QGLFramebufferObjectFormat format4c; + QVERIFY(format1c == format3c); + QVERIFY(!(format1c != format3c)); + format3c.setInternalTextureFormat(DEFAULT_FORMAT); + QVERIFY(!(format1c == format3c)); + QVERIFY(format1c != format3c); + + format4c = format1c; + QVERIFY(format1c == format4c); + QVERIFY(!(format1c != format4c)); + format4c.setInternalTextureFormat(DEFAULT_FORMAT); + QVERIFY(!(format1c == format4c)); + QVERIFY(format1c != format4c); } QTEST_MAIN(tst_QGL) |