diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp index 5141bda4c2..73266205af 100644 --- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp +++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp @@ -599,9 +599,10 @@ void tst_QAtomicPointer::fetchAndAdd() { QAtomicPointer pointer1 = pc; - QCOMPARE(pointer1.fetchAndAddRelaxed(valueToAdd), pc); - QCOMPARE(pointer1.fetchAndAddRelaxed(-valueToAdd), pc + valueToAdd); - QCOMPARE(pointer1.load(), pc); + // cast to void* in order to avoid QCOMPARE to compare string content of the char* + QCOMPARE(static_cast(pointer1.fetchAndAddRelaxed(valueToAdd)), static_cast(pc)); + QCOMPARE(static_cast(pointer1.fetchAndAddRelaxed(-valueToAdd)), static_cast(pc + valueToAdd)); + QCOMPARE(static_cast(pointer1.load()), static_cast(pc)); QAtomicPointer pointer2 = ps; QCOMPARE(pointer2.fetchAndAddRelaxed(valueToAdd), ps); QCOMPARE(pointer2.fetchAndAddRelaxed(-valueToAdd), ps + valueToAdd); @@ -614,9 +615,9 @@ void tst_QAtomicPointer::fetchAndAdd() { QAtomicPointer pointer1 = pc; - QCOMPARE(pointer1.fetchAndAddAcquire(valueToAdd), pc); - QCOMPARE(pointer1.fetchAndAddAcquire(-valueToAdd), pc + valueToAdd); - QCOMPARE(pointer1.load(), pc); + QCOMPARE(static_cast(pointer1.fetchAndAddAcquire(valueToAdd)), static_cast(pc)); + QCOMPARE(static_cast(pointer1.fetchAndAddAcquire(-valueToAdd)), static_cast(pc + valueToAdd)); + QCOMPARE(static_cast(pointer1.load()), static_cast(pc)); QAtomicPointer pointer2 = ps; QCOMPARE(pointer2.fetchAndAddAcquire(valueToAdd), ps); QCOMPARE(pointer2.fetchAndAddAcquire(-valueToAdd), ps + valueToAdd); @@ -629,9 +630,9 @@ void tst_QAtomicPointer::fetchAndAdd() { QAtomicPointer pointer1 = pc; - QCOMPARE(pointer1.fetchAndAddRelease(valueToAdd), pc); - QCOMPARE(pointer1.fetchAndAddRelease(-valueToAdd), pc + valueToAdd); - QCOMPARE(pointer1.load(), pc); + QCOMPARE(static_cast(pointer1.fetchAndAddRelease(valueToAdd)), static_cast(pc)); + QCOMPARE(static_cast(pointer1.fetchAndAddRelease(-valueToAdd)), static_cast(pc + valueToAdd)); + QCOMPARE(static_cast(pointer1.load()), static_cast(pc)); QAtomicPointer pointer2 = ps; QCOMPARE(pointer2.fetchAndAddRelease(valueToAdd), ps); QCOMPARE(pointer2.fetchAndAddRelease(-valueToAdd), ps + valueToAdd); @@ -644,9 +645,9 @@ void tst_QAtomicPointer::fetchAndAdd() { QAtomicPointer pointer1 = pc; - QCOMPARE(pointer1.fetchAndAddOrdered(valueToAdd), pc); - QCOMPARE(pointer1.fetchAndAddOrdered(-valueToAdd), pc + valueToAdd); - QCOMPARE(pointer1.load(), pc); + QCOMPARE(static_cast(pointer1.fetchAndAddOrdered(valueToAdd)), static_cast(pc)); + QCOMPARE(static_cast(pointer1.fetchAndAddOrdered(-valueToAdd)), static_cast(pc + valueToAdd)); + QCOMPARE(static_cast(pointer1.load()), static_cast(pc)); QAtomicPointer pointer2 = ps; QCOMPARE(pointer2.fetchAndAddOrdered(valueToAdd), ps); QCOMPARE(pointer2.fetchAndAddOrdered(-valueToAdd), ps + valueToAdd);