summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-03-24 20:37:33 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-03-24 20:37:33 +0100
commit487844fc62bdf048224d6fc3b7eaae6347d4457b (patch)
tree763dc03ad77fd5b43ef74e817423540caa015e4b /tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
parent4ed048dded34dbe2ce2842f0d40d9f54cd7571b0 (diff)
parent6cacd19db56b632964c3b2453bc273dac50446c9 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp')
-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);