[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdevelop/languages/cpp/parser/tests
From: Hamish Rodda <rodda () kde ! org>
Date: 2006-07-11 21:24:19
Message-ID: 1152653059.613515.26678.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 561328 by rodda:
Implement correctness test for third testcase
M +18 -2 test_duchain.cpp
--- trunk/KDE/kdevelop/languages/cpp/parser/tests/test_duchain.cpp #561327:561328
@@ -254,12 +254,28 @@
DUContext* top = parse(method, DumpDUChain);
- /*QCOMPARE(top->childContexts().count(), 0);
+ QCOMPARE(top->childContexts().count(), 1);
QCOMPARE(top->localDefinitions().count(), 1);
Definition* def = top->localDefinitions().first();
- QCOMPARE(def->identifier(), QString("i"));*/
+ QCOMPARE(def->identifier(), QString("main"));
+ DUContext* main = top->childContexts().first();
+ QCOMPARE(main->childContexts().count(), 1);
+ QCOMPARE(main->localDefinitions().count(), 0);
+
+ DUContext* forCtx = main->childContexts().first();
+ QCOMPARE(forCtx->childContexts().count(), 1);
+ QCOMPARE(forCtx->localDefinitions().count(), 1);
+
+ def = forCtx->localDefinitions().first();
+ QCOMPARE(def->identifier(), QString("i"));
+ QCOMPARE(def->uses().count(), 2);
+
+ DUContext* insideFor = forCtx->childContexts().first();
+ QCOMPARE(insideFor->childContexts().count(), 0);
+ QCOMPARE(insideFor->localDefinitions().count(), 0);
+
//delete top;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic