summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-04-05 14:22:45 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2016-04-05 14:22:45 +0200
commitf2856875843efce9a00e90dad05bde358ab82197 (patch)
tree93346c38504ce04f0bf02dfe4a21299feb1be8ed /tests/auto/corelib/thread
parenta7b04275082d065f392e7f18c54ea9b41507ae40 (diff)
parenta2970719c26c946fd6fea7d902aad6706a4ca6ea (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: examples/corelib/ipc/ipc.pro src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp Change-Id: Ia006e10ff1732fe78f90138c41f05b59b49486cf
Diffstat (limited to 'tests/auto/corelib/thread')
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp93
1 files changed, 0 insertions, 93 deletions
diff --git a/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp b/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
index fe465df395..5f5252aa96 100644
--- a/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
+++ b/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
@@ -174,9 +174,6 @@ private Q_SLOTS:
void fetchAndSub_data() { addData(); }
void fetchAndSub();
- void addSub_data() { addData(); }
- void addSub();
-
void fetchAndOr_data() { addData(); }
void fetchAndOr();
@@ -656,96 +653,6 @@ void tst_QAtomicIntegerXX::fetchAndSub()
}
}
-void tst_QAtomicIntegerXX::addSub()
-{
- QFETCH(LargeInt, value);
- QAtomicInteger<T> atomic(value);
-
- // note: this test has undefined behavior for signed max and min
- T parcel1 = 42;
- T parcel2 = T(0-parcel1);
- T newValue1 = T(value) + parcel1;
- T newValue2 = T(value) - parcel1;
-
- QCOMPARE(atomic.fetchAndAddRelaxed(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndSubRelaxed(parcel1), newValue1);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubRelaxed(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndAddRelaxed(parcel1), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndAddRelaxed(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndSubRelaxed(parcel2), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubRelaxed(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndAddRelaxed(parcel2), newValue1);
- QCOMPARE(atomic.load(), T(value));
-
- QCOMPARE(atomic.fetchAndAddAcquire(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndSubAcquire(parcel1), newValue1);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubAcquire(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndAddAcquire(parcel1), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndAddAcquire(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndSubAcquire(parcel2), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubAcquire(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndAddAcquire(parcel2), newValue1);
- QCOMPARE(atomic.load(), T(value));
-
- QCOMPARE(atomic.fetchAndAddRelease(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndSubRelease(parcel1), newValue1);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubRelease(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndAddRelease(parcel1), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndAddRelease(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndSubRelease(parcel2), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubRelease(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndAddRelease(parcel2), newValue1);
- QCOMPARE(atomic.load(), T(value));
-
- QCOMPARE(atomic.fetchAndAddOrdered(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndSubOrdered(parcel1), newValue1);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubOrdered(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndAddOrdered(parcel1), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndAddOrdered(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
- QCOMPARE(atomic.fetchAndSubOrdered(parcel2), newValue2);
- QCOMPARE(atomic.load(), T(value));
- QCOMPARE(atomic.fetchAndSubOrdered(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue1);
- QCOMPARE(atomic.fetchAndAddOrdered(parcel2), newValue1);
- QCOMPARE(atomic.load(), T(value));
-
- // operator+= and operator-=
- QCOMPARE(atomic += parcel1, newValue1);
- QCOMPARE(atomic -= parcel1, T(value));
- QCOMPARE(atomic -= parcel1, newValue2);
- QCOMPARE(atomic += parcel1, T(value));
- QCOMPARE(atomic += parcel2, newValue2);
- QCOMPARE(atomic -= parcel2, T(value));
- QCOMPARE(atomic -= parcel2, newValue1);
- QCOMPARE(atomic += parcel2, T(value));
-}
-
void tst_QAtomicIntegerXX::fetchAndOr()
{
QFETCH(LargeInt, value);