diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-12-02 20:22:44 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-12-03 09:07:40 +0000 |
commit | 00e0783992a4326fcca93e118edb9a3ed09fd5a4 (patch) | |
tree | e1865bd057bea2de962ed37afa63283390fd7713 /tests/auto/core | |
parent | 568b2d62e6e07b40d602bcd2a1c2e8e566c41b9f (diff) |
Fix compile warnings
Change-Id: Idb253d8cb42809ae21cfbbda70d6b6c75891070f
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/core')
-rw-r--r-- | tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp | 12 | ||||
-rw-r--r-- | tests/auto/core/threadpooler/tst_threadpooler.cpp | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp b/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp index 4bc04fafa..7d8f6eed6 100644 --- a/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp +++ b/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp @@ -166,13 +166,13 @@ void tst_QCircularBuffer::construction() QVERIFY(circ4.size() == 2); QVERIFY(circ4.at(0) == 10); QVERIFY(circ4.at(1) == 10); - QVERIFY(circ4.refCount().load() == 1); + QVERIFY(circ4.refCount().loadRelaxed() == 1); // Copy construct from circ4. Both circ4 and circ5 should now have a // refCount() of 2 since we are using implicit sharing. QCircularBuffer<int> circ5(circ4); - QVERIFY(circ4.refCount().load() == 2); - QVERIFY(circ5.refCount().load() == 2); + QVERIFY(circ4.refCount().loadRelaxed() == 2); + QVERIFY(circ5.refCount().loadRelaxed() == 2); QVERIFY(circ5.capacity() == 5); QVERIFY(circ5.size() == 2); QVERIFY(circ5.at(0) == 10); @@ -199,7 +199,7 @@ void tst_QCircularBuffer::destruction() cir->append(MyComplexType(2)); cir->append(MyComplexType(3)); cir->remove(0); - Q_UNUSED(cir); + Q_UNUSED(cir) // Check that the dtor was called 2 times fewer than the constructor. // At this stage will still have 2 items in the circular buffer. @@ -208,7 +208,7 @@ void tst_QCircularBuffer::destruction() // Destroy the circular buffer and check that the active count // is 0. (Same number of calls to dtor as have been made to the constructors) delete cir; - cir = 0; + cir = nullptr; QVERIFY(MyComplexType::ms_activeCount == 0); } @@ -273,7 +273,7 @@ void tst_QCircularBuffer::clear() circ.clear(); QVERIFY(circ.size() == 0); QVERIFY(circ.capacity() == 3); - QVERIFY(circ.refCount().load() == 1); + QVERIFY(circ.refCount().loadRelaxed() == 1); } void tst_QCircularBuffer::contains() diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index a656c25c1..cfe3480ee 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -195,13 +195,13 @@ void tst_ThreadPooler::defaultPerThread() // GIVEN QAtomicInt callCounter; int maxThreadCount = QThread::idealThreadCount(); - callCounter.store(0); + callCounter.storeRelaxed(0); // WHEN m_jobManager->waitForPerThreadFunction(perThreadFunction, &callCounter); // THEN - QVERIFY(maxThreadCount == callCounter.load()); + QVERIFY(maxThreadCount == callCounter.loadRelaxed()); } void tst_ThreadPooler::defaultAspectQueue() @@ -210,7 +210,7 @@ void tst_ThreadPooler::defaultAspectQueue() QAtomicInt callCounter; int value = 0; // Not used in this test QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; - callCounter.store(0); + callCounter.storeRelaxed(0); const int jobCount = 5; // WHEN @@ -223,7 +223,7 @@ void tst_ThreadPooler::defaultAspectQueue() m_jobManager->waitForAllJobs(); // THEN - QVERIFY(jobCount == callCounter.load()); + QVERIFY(jobCount == callCounter.loadRelaxed()); } /* @@ -236,7 +236,7 @@ void tst_ThreadPooler::doubleAspectQueue() QAtomicInt callCounter; int value = 0; // Not used in this test QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; - callCounter.store(0); + callCounter.storeRelaxed(0); const int jobCount = 3; // WHEN @@ -258,7 +258,7 @@ void tst_ThreadPooler::doubleAspectQueue() m_jobManager->waitForAllJobs(); // THEN - QVERIFY(jobCount * 2 == callCounter.load()); + QVERIFY(jobCount * 2 == callCounter.loadRelaxed()); } /* @@ -335,7 +335,7 @@ public: quint64 globalAtomicValue() const { - return m_globalAtomic.load(); + return m_globalAtomic.loadRelaxed(); } private: |