summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2024-01-22 16:06:17 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2024-01-29 16:06:47 +0100
commitcc5251ed59ea6ecf0cc666ae5321be6de5383e90 (patch)
treeddf9eed4d3c11ad9e2aecf48e5200c0312108133 /tests
parente5074cd3540e165f771aa5bfea36d09553eadc77 (diff)
QJniArray: make reverse-iterable
Add rbeing/rend overload, relevant typedefs, and decrement operators. As a drive-by, add noexcept to begin/end functions. Found during header review. Pick-to: 6.7 Task-number: QTBUG-119952 Change-Id: I32d9a7d50a1f03550944c2247516c455d4822fe7 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp b/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp
index 65dd832e92..bbbec2fc90 100644
--- a/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp
+++ b/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp
@@ -104,6 +104,17 @@ void tst_QJniArray::operators()
QCOMPARE(++it, array.end());
}
{
+ auto it = array.rbegin();
+ QCOMPARE(*it, 'e');
+ QCOMPARE(*++it, 'd');
+ QCOMPARE(*it++, 'd');
+ QCOMPARE(*it, 'c');
+ ++it;
+ it++;
+ QCOMPARE(*it, 'a');
+ QCOMPARE(++it, array.rend());
+ }
+ {
QJniArray<jbyte>::const_iterator it = {};
QCOMPARE(it, QJniArray<jbyte>::const_iterator{});
QCOMPARE_NE(array.begin(), array.end());