summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-16 16:40:42 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-18 10:36:17 +0000
commitce7fb157f0b8f74025e6927e7b61b1d79de0581c (patch)
tree7804db4059066144711d00f3fc4ae9134951814d /tests
parent524ae251bb1039b688b8c3fa3192f7465436c961 (diff)
Tests: Do not rely on qCompare(bool, int,...).
The overload was added for NokiaX86 and RVCT and is bound for removal. Task-number: QTBUG-47260 Change-Id: Ic67cee8769847956e16cd0470ebcd663a9e98a40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp58
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp12
2 files changed, 35 insertions, 35 deletions
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
index e8c58a9fa5..72ae68f81a 100644
--- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
@@ -479,34 +479,34 @@ void tst_QAtomicInt::testAndSet_data()
QTest::addColumn<int>("value");
QTest::addColumn<int>("expected");
QTest::addColumn<int>("newval");
- QTest::addColumn<int>("result");
+ QTest::addColumn<bool>("result");
// these should succeed
- QTest::newRow("success0") << 0 << 0 << 0 << 1;
- QTest::newRow("success1") << 0 << 0 << 1 << 1;
- QTest::newRow("success2") << 0 << 0 << -1 << 1;
- QTest::newRow("success3") << 1 << 1 << 0 << 1;
- QTest::newRow("success4") << 1 << 1 << 1 << 1;
- QTest::newRow("success5") << 1 << 1 << -1 << 1;
- QTest::newRow("success6") << -1 << -1 << 0 << 1;
- QTest::newRow("success7") << -1 << -1 << 1 << 1;
- QTest::newRow("success8") << -1 << -1 << -1 << 1;
- QTest::newRow("success9") << INT_MIN+1 << INT_MIN+1 << INT_MIN+1 << 1;
- QTest::newRow("successA") << INT_MIN+1 << INT_MIN+1 << 1 << 1;
- QTest::newRow("successB") << INT_MIN+1 << INT_MIN+1 << -1 << 1;
- QTest::newRow("successC") << INT_MAX << INT_MAX << INT_MAX << 1;
- QTest::newRow("successD") << INT_MAX << INT_MAX << 1 << 1;
- QTest::newRow("successE") << INT_MAX << INT_MAX << -1 << 1;
+ QTest::newRow("success0") << 0 << 0 << 0 << true;
+ QTest::newRow("success1") << 0 << 0 << 1 << true;
+ QTest::newRow("success2") << 0 << 0 << -1 << true;
+ QTest::newRow("success3") << 1 << 1 << 0 << true;
+ QTest::newRow("success4") << 1 << 1 << 1 << true;
+ QTest::newRow("success5") << 1 << 1 << -1 << true;
+ QTest::newRow("success6") << -1 << -1 << 0 << true;
+ QTest::newRow("success7") << -1 << -1 << 1 << true;
+ QTest::newRow("success8") << -1 << -1 << -1 << true;
+ QTest::newRow("success9") << INT_MIN+1 << INT_MIN+1 << INT_MIN+1 << true;
+ QTest::newRow("successA") << INT_MIN+1 << INT_MIN+1 << 1 << true;
+ QTest::newRow("successB") << INT_MIN+1 << INT_MIN+1 << -1 << true;
+ QTest::newRow("successC") << INT_MAX << INT_MAX << INT_MAX << true;
+ QTest::newRow("successD") << INT_MAX << INT_MAX << 1 << true;
+ QTest::newRow("successE") << INT_MAX << INT_MAX << -1 << true;
// these should fail
- QTest::newRow("failure0") << 0 << 1 << ~0 << 0;
- QTest::newRow("failure1") << 0 << -1 << ~0 << 0;
- QTest::newRow("failure2") << 1 << 0 << ~0 << 0;
- QTest::newRow("failure3") << -1 << 0 << ~0 << 0;
- QTest::newRow("failure4") << 1 << -1 << ~0 << 0;
- QTest::newRow("failure5") << -1 << 1 << ~0 << 0;
- QTest::newRow("failure6") << INT_MIN+1 << INT_MAX << ~0 << 0;
- QTest::newRow("failure7") << INT_MAX << INT_MIN+1 << ~0 << 0;
+ QTest::newRow("failure0") << 0 << 1 << ~0 << false;
+ QTest::newRow("failure1") << 0 << -1 << ~0 << false;
+ QTest::newRow("failure2") << 1 << 0 << ~0 << false;
+ QTest::newRow("failure3") << -1 << 0 << ~0 << false;
+ QTest::newRow("failure4") << 1 << -1 << ~0 << false;
+ QTest::newRow("failure5") << -1 << 1 << ~0 << false;
+ QTest::newRow("failure6") << INT_MIN+1 << INT_MAX << ~0 << false;
+ QTest::newRow("failure7") << INT_MAX << INT_MIN+1 << ~0 << false;
}
void tst_QAtomicInt::testAndSet()
@@ -517,26 +517,26 @@ void tst_QAtomicInt::testAndSet()
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetRelaxed(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetRelaxed(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetAcquire(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetAcquire(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetRelease(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetRelease(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetOrdered(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetOrdered(expected, newval), "result");
}
#ifdef Q_ATOMIC_INT32_IS_SUPPORTED
- QFETCH(int, result);
+ QFETCH(bool, result);
// the new implementation has the version that loads the current value
{
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 9bd82559b7..5a65719380 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -2115,25 +2115,25 @@ void tst_QGL::qglContextDefaultBindTexture()
QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
// Make sure the texture IDs returned are valid:
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_TRUE);
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_TRUE));
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_TRUE));
// Make sure the textures are still valid after we delete the image/pixmap:
// Also check that although the textures are left intact, the cache entries are removed:
delete boundImage;
boundImage = 0;
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_TRUE));
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
delete boundPixmap;
boundPixmap = 0;
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_TRUE));
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
// Finally, make sure QGLContext::deleteTexture deletes the texture IDs:
ctx->deleteTexture(boundImageTextureId);
ctx->deleteTexture(boundPixmapTextureId);
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_FALSE);
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_FALSE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_FALSE));
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_FALSE));
}
#endif