Changeset View
Changeset View
Standalone View
Standalone View
addons/filetree/autotests/filetree_model_test.cpp
Show All 23 Lines | |||||
24 | #include <QtTest> | 24 | #include <QtTest> | ||
25 | QTEST_GUILESS_MAIN(FileTreeModelTest) | 25 | QTEST_GUILESS_MAIN(FileTreeModelTest) | ||
26 | 26 | | |||
27 | 27 | | |||
28 | //BEGIN ResultNode | 28 | //BEGIN ResultNode | ||
29 | class ResultNode | 29 | class ResultNode | ||
30 | { | 30 | { | ||
31 | public: | 31 | public: | ||
32 | ResultNode() : name(), dir(true), children() {} // root node | 32 | ResultNode() = default; // root node | ||
33 | ResultNode(const ResultNode &other) : name(other.name), dir(other.dir), children(other.children) {} | 33 | ResultNode(const ResultNode &other) : name(other.name), dir(other.dir), children(other.children) {} | ||
34 | ResultNode(const char *_name, const bool _dir = false) : ResultNode(QString::fromLatin1(_name), _dir) {} | 34 | ResultNode(const char *_name, const bool _dir = false) : ResultNode(QString::fromLatin1(_name), _dir) {} | ||
35 | ResultNode(const QString &_name, const bool _dir = false) : name(_name), dir(_dir), children() {} | 35 | ResultNode(const QString &_name, const bool _dir = false) : name(_name), dir(_dir), children() {} | ||
36 | 36 | | |||
37 | ResultNode &operator<<(const ResultNode &node) { children << node; return *this; } | 37 | ResultNode &operator<<(const ResultNode &node) { children << node; return *this; } | ||
38 | 38 | | |||
39 | bool operator!=(const ResultNode &other) const { return !(*this == other); } | 39 | bool operator!=(const ResultNode &other) const { return !(*this == other); } | ||
40 | bool operator==(const ResultNode &other) const | 40 | bool operator==(const ResultNode &other) const | ||
Show All 37 Lines | |||||
78 | QString toString() const | 78 | QString toString() const | ||
79 | { | 79 | { | ||
80 | QString out; | 80 | QString out; | ||
81 | debugOutput(out, *this, 0); | 81 | debugOutput(out, *this, 0); | ||
82 | return out; | 82 | return out; | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | QString name; | 85 | QString name; | ||
86 | bool dir; | 86 | bool dir = true; | ||
87 | QList<ResultNode> children; | 87 | QList<ResultNode> children; | ||
88 | }; | 88 | }; | ||
89 | 89 | | |||
90 | Q_DECLARE_METATYPE(ResultNode) | 90 | Q_DECLARE_METATYPE(ResultNode) | ||
91 | 91 | | |||
92 | namespace QTest { | 92 | namespace QTest { | ||
93 | inline bool qCompare(const ResultNode &t1, const ResultNode &t2, const char *actual, const char *expected, | 93 | inline bool qCompare(const ResultNode &t1, const ResultNode &t2, const char *actual, const char *expected, | ||
94 | const char *file, int line) | 94 | const char *file, int line) | ||
▲ Show 20 Lines • Show All 821 Lines • Show Last 20 Lines |