Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/javaduchaintest.cpp
Show All 24 Lines | |||||
25 | #include <tests/autotestshell.h> | 25 | #include <tests/autotestshell.h> | ||
26 | #include <tests/testcore.h> | 26 | #include <tests/testcore.h> | ||
27 | #include <language/codegen/coderepresentation.h> | 27 | #include <language/codegen/coderepresentation.h> | ||
28 | #include <language/duchain/duchain.h> | 28 | #include <language/duchain/duchain.h> | ||
29 | #include <language/duchain/declaration.h> | 29 | #include <language/duchain/declaration.h> | ||
30 | #include <language/duchain/duchainlock.h> | 30 | #include <language/duchain/duchainlock.h> | ||
31 | #include <language/duchain/use.h> | 31 | #include <language/duchain/use.h> | ||
32 | 32 | | |||
33 | #include <QtTest> | 33 | #include <QtTest/QTest> | ||
34 | #include <KUrl> | 34 | #include <QUrl> | ||
35 | 35 | | |||
36 | QTEST_MAIN(JavaDUChainTest); | 36 | QTEST_MAIN(JavaDUChainTest); | ||
37 | 37 | | |||
38 | using namespace KDevelop; | 38 | using namespace KDevelop; | ||
39 | 39 | | |||
40 | using qsl = QStringList; | 40 | using qsl = QStringList; | ||
41 | 41 | | |||
42 | void JavaDUChainTest::initShell() | 42 | void JavaDUChainTest::initShell() | ||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 190 | { | |||
194 | QTest::newRow("lvalue") << codeInMainWithDeclaration("x = 5;") << QStringList{"x"}; | 194 | QTest::newRow("lvalue") << codeInMainWithDeclaration("x = 5;") << QStringList{"x"}; | ||
195 | QTest::newRow("for") << codeInMainWithDeclaration("for ( x = 0; x < 20; x++ ) ;") << QStringList{"x", "x", "x"}; | 195 | QTest::newRow("for") << codeInMainWithDeclaration("for ( x = 0; x < 20; x++ ) ;") << QStringList{"x", "x", "x"}; | ||
196 | QTest::newRow("rvalue") << codeInMainWithDeclaration("int y = x;") << QStringList{"x"}; | 196 | QTest::newRow("rvalue") << codeInMainWithDeclaration("int y = x;") << QStringList{"x"}; | ||
197 | QTest::newRow("increment") << codeInMainWithDeclaration("x++;") << QStringList{"x"}; | 197 | QTest::newRow("increment") << codeInMainWithDeclaration("x++;") << QStringList{"x"}; | ||
198 | 198 | | |||
199 | QTest::newRow("function_call") << "public class Foo {\npublic static void main() {\nfunc();\n}\nvoid func() {\n}\n}" << QStringList{"func"}; | 199 | QTest::newRow("function_call") << "public class Foo {\npublic static void main() {\nfunc();\n}\nvoid func() {\n}\n}" << QStringList{"func"}; | ||
200 | } | 200 | } | ||
201 | 201 | | |||
202 | #include "javaduchaintest.moc" | | |||
203 | | ||||
204 | // kate: space-indent on; indent-width 4 | 202 | // kate: space-indent on; indent-width 4 |