diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-12-08 11:57:41 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-12-09 06:22:06 +0000 |
commit | 1ecbab76b6e04f9eec9dfc6e1d63d587f3d8fc12 (patch) | |
tree | f012eb7caf8576d1150734e304efbc30acff0fc5 /tests/auto/corelib/tools | |
parent | 4d43b995bf2d1f059704e45d64c38b3238cc64a3 (diff) |
QOffsetStringArray: add contains() method
... use it in QNetworkReplyWasmImpl.
Change-Id: I648f02fcafda43af7ed9771cc1c7e2e2a6d38504
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp b/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp index 16c687bf89..669f14cc92 100644 --- a/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp +++ b/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp @@ -13,6 +13,7 @@ class tst_QOffsetStringArray : public QObject private slots: void init(); void access(); + void contains(); }; @@ -89,6 +90,16 @@ void tst_QOffsetStringArray::access() QCOMPARE(messages[6], ""); } +void tst_QOffsetStringArray::contains() +{ + QVERIFY(!messages.contains("")); + QVERIFY( messages.contains("level - 0")); + std::string l2 = "level - 2"; // make sure we don't compare pointer values + QVERIFY( messages.contains(l2)); + QByteArray L4 = "Level - 4"; + QVERIFY( messages.contains(L4, Qt::CaseInsensitive)); + QVERIFY(!messages.contains(L4, Qt::CaseSensitive)); +} QTEST_APPLESS_MAIN(tst_QOffsetStringArray) #include "tst_qoffsetstringarray.moc" |