[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdevelop/languages/cpp/tests
From: David Nolden <david.nolden.kde () art-master ! de>
Date: 2007-09-19 1:26:54
Message-ID: 1190165214.320563.13563.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 714250 by zwabel:
- Correct the last commit I did here
- Add a currently failing test for forward-declarations together with included files. \
Will need to be investigated.
M +1 -1 CMakeLists.txt
M +17 -2 test_cppcodecompletion.cpp
M +1 -0 test_cppcodecompletion.h
--- trunk/KDE/kdevelop/languages/cpp/tests/CMakeLists.txt #714249:714250
@@ -6,7 +6,7 @@
########### next target ###############
-add_definitions(-DTEST)
+add_definitions(-DTEST_COMPLETION)
set(cppcodecompletiontest_SRCS test_cppcodecompletion.cpp \
../codecompletioncontext.cpp ../stringhelpers.cpp)
--- trunk/KDE/kdevelop/languages/cpp/tests/test_cppcodecompletion.cpp #714249:714250
@@ -16,8 +16,6 @@
Boston, MA 02110-1301, USA.
*/
-#define TEST_COMPLETION
-
#include "test_cppcodecompletion.h"
#include <QtTest/QtTest>
@@ -456,6 +454,23 @@
includes.clear();
}
+void TestCppCodeCompletion::testForwardDeclaration()
+{
+ addInclude( "testdeclaration.h", "class Test{ };" );
+ QByteArray method("class Test; #include \"testdeclaration.h\"\n class Test; ");
+
+ DUContext* top = parse(method, DumpNone);
+
+ DUChainWriteLocker lock(DUChain::lock());
+
+
+ Declaration* decl = findDeclaration(top, Identifier("Test"), \
top->textRange().end()); + QVERIFY(decl);
+ QVERIFY(!decl->isForwardDeclaration());
+
+ release(top);
+}
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- trunk/KDE/kdevelop/languages/cpp/tests/test_cppcodecompletion.h #714249:714250
@@ -65,6 +65,7 @@
void testUpdateChain();
void testHeaderSections();
void cleanupTestCase();
+ void testForwardDeclaration();
public:
enum DumpArea {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic