diff options
| author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-22 15:34:48 +0200 |
|---|---|---|
| committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-25 10:14:24 +0200 |
| commit | e721ec269e972ea2754cb9bd27fb73b72ed53c7b (patch) | |
| tree | b09bb4ca8fe18d528a0a88cb310ecd1f8dc9216f /tests/auto/other/compiler/tst_compiler.cpp | |
| parent | b62f32a4dd87010e4c51d33ef440e2fbba531361 (diff) | |
| download | qtbase-e721ec269e972ea2754cb9bd27fb73b72ed53c7b.tar.gz | |
Use QList instead of QVector in other tests
Task-number: QTBUG-84469
Change-Id: I656c9f73bd2364be39ee67747524e7c4a25c0935
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/other/compiler/tst_compiler.cpp')
| -rw-r--r-- | tests/auto/other/compiler/tst_compiler.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp index 4d19debd06..435bd42faf 100644 --- a/tests/auto/other/compiler/tst_compiler.cpp +++ b/tests/auto/other/compiler/tst_compiler.cpp @@ -58,7 +58,6 @@ private slots: void detectEnums(); void overrideCFunction(); void stdSortQList(); - void stdSortQVector(); void templateCallOrder(); void virtualFunctionNoLongerPureVirtual(); void charSignedness() const; @@ -422,21 +421,6 @@ void tst_Compiler::stdSortQList() QCOMPARE(slist.value(0), QString("a")); QCOMPARE(slist.value(1), QString("b")); } - -void tst_Compiler::stdSortQVector() -{ - QVector<int> vector; - vector << 4 << 2; - std::sort(vector.begin(), vector.end()); - QCOMPARE(vector.value(0), 2); - QCOMPARE(vector.value(1), 4); - - QVector<QString> strvec; - strvec << "b" << "a"; - std::sort(strvec.begin(), strvec.end()); - QCOMPARE(strvec.value(0), QString("a")); - QCOMPARE(strvec.value(1), QString("b")); -} #else void tst_Compiler::stdSortQList() { QSKIP("Compiler's STL broken"); } @@ -1063,15 +1047,16 @@ void tst_Compiler::cxx11_nullptr() namespace SomeNamespace { class AdlOnly { - QVector<int> v; + QList<int> v; + public: AdlOnly() : v(5) { std::fill_n(v.begin(), v.size(), 42); } private: - friend QVector<int>::const_iterator begin(const AdlOnly &x) { return x.v.begin(); } - friend QVector<int>::const_iterator end(const AdlOnly &x) { return x.v.end(); } - friend QVector<int>::iterator begin(AdlOnly &x) { return x.v.begin(); } - friend QVector<int>::iterator end(AdlOnly &x) { return x.v.end(); } + friend QList<int>::const_iterator begin(const AdlOnly &x) { return x.v.begin(); } + friend QList<int>::const_iterator end(const AdlOnly &x) { return x.v.end(); } + friend QList<int>::iterator begin(AdlOnly &x) { return x.v.begin(); } + friend QList<int>::iterator end(AdlOnly &x) { return x.v.end(); } }; } |
