summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoheil Armin <[email protected]>2024-11-14 11:23:46 +0200
committerSoheil Armin <[email protected]>2024-11-14 12:42:47 +0000
commit1e714bb0fc45e333d7f9f52a9586aee06e9178e8 (patch)
tree814351f6321697fc7a85d57aac3651c1448b0c01
parentafe38ba7abc4fc41b5171fcfccd70942b47e687b (diff)
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 <[email protected]>
-rw-r--r--tests/auto/corelib/platform/androiditemmodel/tst_androiditemmodel.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/corelib/platform/androiditemmodel/tst_androiditemmodel.cpp b/tests/auto/corelib/platform/androiditemmodel/tst_androiditemmodel.cpp
index a8adfaa4d32..baa808a9046 100644
--- a/tests/auto/corelib/platform/androiditemmodel/tst_androiditemmodel.cpp
+++ b/tests/auto/corelib/platform/androiditemmodel/tst_androiditemmodel.cpp
@@ -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()