diff options
author | Sergio Martins <smartins@kde.org> | 2019-05-08 14:16:53 +0100 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2019-05-08 14:16:53 +0100 |
commit | 68daa24912ef0d0791826eec4a2ea93cde840fa0 (patch) | |
tree | a6d8b83487258644b4fa70ca2a86158881bb525c | |
parent | 9c8ade0c72a9ca371a0333bccdc297dc20f0643f (diff) |
range-loop: Add unit-test
-rw-r--r-- | tests/range-loop/main.cpp | 9 | ||||
-rw-r--r-- | tests/range-loop/main.cpp.fixed.expected | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/range-loop/main.cpp b/tests/range-loop/main.cpp index 39520039..b5980b3f 100644 --- a/tests/range-loop/main.cpp +++ b/tests/range-loop/main.cpp @@ -4,7 +4,7 @@ #include <QtCore/QSequentialIterable> #include <QtCore/QVarLengthArray> #include <QtCore/QString> - +#include <QtCore/QJsonArray> @@ -237,3 +237,10 @@ void test_add_qasconst_fixits() for (const auto &s : f.getList()) {} // Warn } + + +void test_json_array() +{ + QJsonArray array; + for (const auto a : array) {} // OK +} diff --git a/tests/range-loop/main.cpp.fixed.expected b/tests/range-loop/main.cpp.fixed.expected index 09e9a255..b8bc3682 100644 --- a/tests/range-loop/main.cpp.fixed.expected +++ b/tests/range-loop/main.cpp.fixed.expected @@ -4,7 +4,7 @@ #include <QtCore/QSequentialIterable> #include <QtCore/QVarLengthArray> #include <QtCore/QString> - +#include <QtCore/QJsonArray> @@ -237,3 +237,10 @@ void test_add_qasconst_fixits() for (const auto &s : f.getList()) {} // Warn } + + +void test_json_array() +{ + QJsonArray array; + for (const auto a : array) {} +} |