diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-11-07 13:39:35 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-16 10:32:10 +0100 |
commit | 6fcfae99d3615c7a850e4933691763097078c8e4 (patch) | |
tree | 52267f0f8a8c42c8bd07a7f624934f0919fa97e4 /tests/auto/corelib/thread/qthread | |
parent | 2f90c4e40ec3e15ba4aeaad178e154a3538c46c2 (diff) |
Remove warnings from deprecated atomic operators in autotests
Use QAtomic*::load() and ::store() instead of the deprecated
cast, assignment, and comparison operators. These will be removed
in the near future.
The tests for these particular operators have not been changed,
though, as the change to remove the operators will also remove
the respective tests.
Change-Id: I2f24d18992af0c6e0f487d707218e4e84f4bdd12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/corelib/thread/qthread')
-rw-r--r-- | tests/auto/corelib/thread/qthread/tst_qthread.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index fcf993bb7b..7c0d8cdc48 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -123,10 +123,11 @@ public: QAtomicInt activationCount; inline SignalRecorder() - { activationCount = 0; } + : activationCount(0) + { } bool wasActivated() - { return activationCount > 0; } + { return activationCount.load() > 0; } public slots: void slot(); @@ -907,7 +908,7 @@ void tst_QThread::adoptMultipleThreads() QTestEventLoop::instance().enterLoop(5); QVERIFY(!QTestEventLoop::instance().timeout()); - QCOMPARE(int(recorder.activationCount), numThreads); + QCOMPARE(recorder.activationCount.load(), numThreads); } void tst_QThread::adoptMultipleThreadsOverlap() @@ -949,7 +950,7 @@ void tst_QThread::adoptMultipleThreadsOverlap() QTestEventLoop::instance().enterLoop(5); QVERIFY(!QTestEventLoop::instance().timeout()); - QCOMPARE(int(recorder.activationCount), numThreads); + QCOMPARE(recorder.activationCount.load(), numThreads); } // Disconnects on WinCE, so skip this test. |