summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-21 12:56:11 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-02 22:44:27 +0200
commite638e8a28d74af8129aaaf6b67fabbb5dbdf31e4 (patch)
treeba14567e009d57f417ae326eb346d6b1fd350212 /tests
parent0c89721716d9be43675358cbdb9c3170fd5936af (diff)
Cleanups: Rename some classes
Rename QPropertyBase to QPropertyBindingData, as it contains the data related to bindings. The new name fits better, as the data can now also live somewhere else than the data strored in the property. Change-Id: I489efb86ad2e0bad2740c9d1aa74506fe103d343 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
index ebb8980d61..97c5a755db 100644
--- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
+++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
@@ -108,30 +108,30 @@ void tst_QProperty::multipleDependencies()
QProperty<int> sum;
sum = Qt::makePropertyBinding([&]() { return firstDependency + secondDependency; });
- QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 0);
- QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 0);
+ QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 0);
+ QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 0);
QCOMPARE(sum.value(), int(3));
- QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1);
- QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1);
firstDependency = 10;
QCOMPARE(sum.value(), int(12));
- QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1);
- QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1);
secondDependency = 20;
QCOMPARE(sum.value(), int(30));
- QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1);
- QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1);
firstDependency = 1;
secondDependency = 1;
QCOMPARE(sum.value(), int(2));
- QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1);
- QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1);
}
void tst_QProperty::bindingWithDeletedDependency()
@@ -190,13 +190,13 @@ void tst_QProperty::bindingAfterUse()
propThatUsesFirstProp = Qt::makePropertyBinding(propWithBindingLater);
QCOMPARE(propThatUsesFirstProp.value(), int(1));
- QCOMPARE(QPropertyBasePointer::get(propWithBindingLater).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(propWithBindingLater).observerCount(), 1);
QProperty<int> injectedValue(42);
propWithBindingLater = Qt::makePropertyBinding(injectedValue);
QCOMPARE(propThatUsesFirstProp.value(), int(42));
- QCOMPARE(QPropertyBasePointer::get(propWithBindingLater).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(propWithBindingLater).observerCount(), 1);
}
void tst_QProperty::switchBinding()
@@ -227,12 +227,12 @@ void tst_QProperty::avoidDependencyAllocationAfterFirstEval()
QCOMPARE(propWithBinding.value(), int(11));
- QVERIFY(QPropertyBasePointer::get(propWithBinding).bindingPtr());
- QCOMPARE(QPropertyBasePointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u);
+ QVERIFY(QPropertyBindingDataPointer::get(propWithBinding).bindingPtr());
+ QCOMPARE(QPropertyBindingDataPointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u);
firstDependency = 100;
QCOMPARE(propWithBinding.value(), int(110));
- QCOMPARE(QPropertyBasePointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u);
+ QCOMPARE(QPropertyBindingDataPointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u);
}
void tst_QProperty::propertyArrays()
@@ -348,18 +348,18 @@ void tst_QProperty::moveNotifies()
QCOMPARE(finalProp1.value(), 1);
QCOMPARE(finalProp2.value(), 1);
- QCOMPARE(QPropertyBasePointer::get(propertyInTheMiddle).observerCount(), 2);
+ QCOMPARE(QPropertyBindingDataPointer::get(propertyInTheMiddle).observerCount(), 2);
QProperty<int> other = Qt::makePropertyBinding(second);
QCOMPARE(other.value(), 2);
QProperty<int> otherDep = Qt::makePropertyBinding(other);
QCOMPARE(otherDep.value(), 2);
- QCOMPARE(QPropertyBasePointer::get(other).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(other).observerCount(), 1);
propertyInTheMiddle = std::move(other);
- QCOMPARE(QPropertyBasePointer::get(other).observerCount(), 0);
+ QCOMPARE(QPropertyBindingDataPointer::get(other).observerCount(), 0);
QCOMPARE(finalProp1.value(), 2);
QCOMPARE(finalProp2.value(), 2);
@@ -371,11 +371,11 @@ void tst_QProperty::moveCtor()
QProperty<int> intermediate = Qt::makePropertyBinding(first);
QCOMPARE(intermediate.value(), 1);
- QCOMPARE(QPropertyBasePointer::get(first).observerCount(), 1);
+ QCOMPARE(QPropertyBindingDataPointer::get(first).observerCount(), 1);
QProperty<int> targetProp(std::move(first));
- QCOMPARE(QPropertyBasePointer::get(targetProp).observerCount(), 0);
+ QCOMPARE(QPropertyBindingDataPointer::get(targetProp).observerCount(), 0);
}
void tst_QProperty::changeHandler()