forked from qt-creator/qt-creator
Added tests for the new regressions in the C++ parser.
This commit is contained in:
@@ -62,8 +62,10 @@ private slots:
|
|||||||
void function_call_1();
|
void function_call_1();
|
||||||
void function_call_2();
|
void function_call_2();
|
||||||
void function_call_3();
|
void function_call_3();
|
||||||
|
void function_call_4();
|
||||||
void nested_deref_expression();
|
void nested_deref_expression();
|
||||||
void assignment_1();
|
void assignment_1();
|
||||||
|
void assignment_2();
|
||||||
|
|
||||||
// objc++
|
// objc++
|
||||||
void objc_attributes_followed_by_at_keyword();
|
void objc_attributes_followed_by_at_keyword();
|
||||||
@@ -215,7 +217,15 @@ void tst_AST::function_call_2()
|
|||||||
|
|
||||||
void tst_AST::function_call_3()
|
void tst_AST::function_call_3()
|
||||||
{
|
{
|
||||||
QSharedPointer<TranslationUnit> unit(parseStatement("(*blah) = 10;"));
|
QSharedPointer<TranslationUnit> unit(parseStatement("advance();"));
|
||||||
|
AST *ast = unit->ast();
|
||||||
|
QVERIFY(ast != 0);
|
||||||
|
QVERIFY(ast->asExpressionStatement());
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_AST::function_call_4()
|
||||||
|
{
|
||||||
|
QSharedPointer<TranslationUnit> unit(parseStatement("checkPropertyAttribute(attrAst, propAttrs, ReadWrite);"));
|
||||||
AST *ast = unit->ast();
|
AST *ast = unit->ast();
|
||||||
QVERIFY(ast != 0);
|
QVERIFY(ast != 0);
|
||||||
QVERIFY(ast->asExpressionStatement());
|
QVERIFY(ast->asExpressionStatement());
|
||||||
@@ -237,6 +247,14 @@ void tst_AST::assignment_1()
|
|||||||
QVERIFY(ast->asExpressionStatement());
|
QVERIFY(ast->asExpressionStatement());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_AST::assignment_2()
|
||||||
|
{
|
||||||
|
QSharedPointer<TranslationUnit> unit(parseStatement("(*blah) = 10;"));
|
||||||
|
AST *ast = unit->ast();
|
||||||
|
QVERIFY(ast != 0);
|
||||||
|
QVERIFY(ast->asExpressionStatement());
|
||||||
|
}
|
||||||
|
|
||||||
void tst_AST::if_statement()
|
void tst_AST::if_statement()
|
||||||
{
|
{
|
||||||
QSharedPointer<TranslationUnit> unit(parseStatement("if (a) b;"));
|
QSharedPointer<TranslationUnit> unit(parseStatement("if (a) b;"));
|
||||||
|
Reference in New Issue
Block a user