forked from qt-creator/qt-creator
C++: add test for TranslationUnit::getPosition bug
This test is marked as failing, because the bug is still there. To be fixed when we re-use the generated token stream of the preprocessor as input for the parser. Task-number: QTCREATORBUG-9799 Change-Id: I454a9939aa188a6ff934a11699232f39c828bc7b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
6a179c0467
commit
8828a2fa38
@@ -94,6 +94,10 @@ public:
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
|
||||
// line/column positions
|
||||
void line_and_column_1();
|
||||
|
||||
// declarations
|
||||
void gcc_attributes_1();
|
||||
void gcc_attributes_2();
|
||||
@@ -1609,5 +1613,19 @@ void tst_AST::initTestCase()
|
||||
control.setDiagnosticClient(&diag);
|
||||
}
|
||||
|
||||
void tst_AST::line_and_column_1()
|
||||
{
|
||||
QSharedPointer<TranslationUnit> unit(parseDeclaration("\n"
|
||||
"int i;\n",
|
||||
false, true));
|
||||
unsigned line, column = 0;
|
||||
QVERIFY(unit->ast());
|
||||
QVERIFY(unit->tokenAt(1).is(T_INT));
|
||||
unit->getTokenPosition(1, &line, &column);
|
||||
QEXPECT_FAIL("", "See QTCREATORBUG-9799.", Continue);
|
||||
QCOMPARE(line, 2U);
|
||||
QCOMPARE(column, 1U);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_AST)
|
||||
#include "tst_ast.moc"
|
||||
|
||||
Reference in New Issue
Block a user