Fix flaky QtAbstractItemModel setData test case
The Java callback function onDataChanged() gets called from Android UI thread. QTRY_COMPARE on the result of a JNI call does not make sense because it actually does not retry to reinvoke the JNI call to read the related counter. This change puts the JNI call to QTRY_COMPARE to make sure the Android thread have to to process the Runnable. Fixes: QTBUG-131253 Change-Id: Icdff8f8f37b33968f5a3f6e545ce753907305e74 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
parent
afe38ba7ab
commit
1e714bb0fc
@ -249,8 +249,7 @@ void tst_AndroidItemModel::setData()
|
||||
QCOMPARE(bottomRight, qProxy->index(row, column, QModelIndex()));
|
||||
QCOMPARE(roles, QList<int>{role});
|
||||
|
||||
jint jDataChangedCount = jModel.getField<jint>("m_dataChangedCount");
|
||||
QTRY_COMPARE(jDataChangedCount, 1);
|
||||
QTRY_COMPARE(jModel.getField<jint>("m_dataChangedCount"), 1);
|
||||
}
|
||||
|
||||
void tst_AndroidItemModel::resetModel()
|
||||
|
Loading…
x
Reference in New Issue
Block a user