diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-07-12 12:35:49 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-07-15 11:07:51 +0200 |
commit | 8828a2fa38dd4a0f03b85e60c9ddbb74bbfa28f2 (patch) | |
tree | a7d1be782d11fa89a5737f5319b5a60f9673f127 /tests/auto/cplusplus/ast/tst_ast.cpp | |
parent | 6a179c046749e7e41c85957b97b69558e7286252 (diff) | |
download | qt-creator-8828a2fa38dd4a0f03b85e60c9ddbb74bbfa28f2.tar.gz |
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>
Diffstat (limited to 'tests/auto/cplusplus/ast/tst_ast.cpp')
-rw-r--r-- | tests/auto/cplusplus/ast/tst_ast.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp index fff4aa3ddf..6bfda0f503 100644 --- a/tests/auto/cplusplus/ast/tst_ast.cpp +++ b/tests/auto/cplusplus/ast/tst_ast.cpp @@ -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" |