Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
3ec7f9d3
Commit
3ec7f9d3
authored
Oct 20, 2009
by
Roberto Raggi
Browse files
Added tests for the new regressions in the C++ parser.
parent
ad092d11
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/auto/cplusplus/ast/tst_ast.cpp
View file @
3ec7f9d3
...
...
@@ -62,8 +62,10 @@ private slots:
void
function_call_1
();
void
function_call_2
();
void
function_call_3
();
void
function_call_4
();
void
nested_deref_expression
();
void
assignment_1
();
void
assignment_2
();
// objc++
void
objc_attributes_followed_by_at_keyword
();
...
...
@@ -215,7 +217,15 @@ void tst_AST::function_call_2()
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
();
QVERIFY
(
ast
!=
0
);
QVERIFY
(
ast
->
asExpressionStatement
());
...
...
@@ -237,6 +247,14 @@ void tst_AST::assignment_1()
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
()
{
QSharedPointer
<
TranslationUnit
>
unit
(
parseStatement
(
"if (a) b;"
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment