Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
d21de8c6
Commit
d21de8c6
authored
Aug 13, 2010
by
Roberto Raggi
Browse files
Fixed the objc auto tests
parent
ae5db839
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/Bind.cpp
View file @
d21de8c6
...
...
@@ -953,7 +953,6 @@ ObjCMethod *Bind::objCMethodPrototype(ObjCMethodPrototypeAST *ast)
if
(
isObjCClassMethod
(
tokenKind
(
ast
->
method_type_token
)))
method
->
setStorage
(
Symbol
::
Static
);
method
->
setVisibility
(
_objcVisibility
);
_scope
->
addMember
(
method
);
ast
->
symbol
=
method
;
Scope
*
previousScope
=
switchScope
(
method
);
...
...
@@ -969,7 +968,7 @@ ObjCMethod *Bind::objCMethodPrototype(ObjCMethodPrototypeAST *ast)
for
(
SpecifierListAST
*
it
=
ast
->
attribute_list
;
it
;
it
=
it
->
next
)
{
specifiers
=
this
->
specifier
(
it
->
value
,
specifiers
);
}
setDeclSpecifiers
(
method
,
specifiers
);
//
setDeclSpecifiers(method, specifiers);
return
method
;
}
...
...
@@ -2285,10 +2284,17 @@ bool Bind::visit(ObjCMethodDeclarationAST *ast)
{
ObjCMethod
*
method
=
this
->
objCMethodPrototype
(
ast
->
method_prototype
);
if
(
!
_skipFunctionBodies
&&
ast
->
function_body
)
{
if
(
!
ast
->
function_body
)
{
const
Name
*
name
=
method
->
name
();
unsigned
sourceLocation
=
ast
->
firstToken
();
Declaration
*
decl
=
control
()
->
newDeclaration
(
sourceLocation
,
name
);
decl
->
setType
(
method
);
_scope
->
addMember
(
decl
);
}
else
if
(
!
_skipFunctionBodies
&&
ast
->
function_body
)
{
Scope
*
previousScope
=
switchScope
(
method
);
this
->
statement
(
ast
->
function_body
);
(
void
)
switchScope
(
previousScope
);
_scope
->
addMember
(
method
);
}
return
false
;
...
...
tests/auto/cplusplus/lookup/tst_lookup.cpp
View file @
d21de8c6
...
...
@@ -334,19 +334,25 @@ void tst_Lookup::iface_impl_scoping()
QCOMPARE
(
method1Impl
->
identifier
()
->
chars
(),
"method1"
);
// get the body of method1
QCOMPARE
(
method1Impl
->
memberCount
(),
1U
);
Block
*
method1Body
=
method1Impl
->
memberAt
(
0
)
->
asBlock
();
QCOMPARE
(
method1Impl
->
memberCount
(),
2U
);
Argument
*
method1Arg
=
method1Impl
->
memberAt
(
0
)
->
asArgument
();
QVERIFY
(
method1Arg
);
QCOMPARE
(
method1Arg
->
identifier
()
->
chars
(),
"arg"
);
QVERIFY
(
method1Arg
->
type
()
->
isIntegerType
());
Block
*
method1Body
=
method1Impl
->
memberAt
(
1
)
->
asBlock
();
QVERIFY
(
method1Body
);
const
LookupContext
context
(
doc
,
snapshot
);
{
// verify if we can resolve "arg" in the body
QCOMPARE
(
method1Impl
->
argumentCount
(),
1
U
);
QCOMPARE
(
method1Impl
->
argumentCount
(),
2
U
);
Argument
*
arg
=
method1Impl
->
argumentAt
(
0
)
->
asArgument
();
QVERIFY
(
arg
);
QVERIFY
(
arg
->
name
());
QVERIFY
(
arg
->
name
()
->
identifier
());
QCOMPARE
(
arg
->
name
()
->
identifier
()
->
chars
(),
"arg"
);
QVERIFY
(
arg
->
type
()
->
isIntegerType
());
const
QList
<
LookupItem
>
candidates
=
context
.
lookup
(
arg
->
name
(),
method1Body
->
scope
());
QCOMPARE
(
candidates
.
size
(),
1
);
...
...
tests/auto/cplusplus/semantic/tst_semantic.cpp
View file @
d21de8c6
...
...
@@ -565,7 +565,7 @@ void tst_Semantic::objcSelector_1()
{
QSharedPointer
<
Document
>
doc
=
document
(
"
\n
"
"@interface A {}
\n
"
"-(void)a:(int)a b:(int)b c:(int)c;
\n
"
"-(void)
a:(int)a
b:(int)b c:(int)c;
\n
"
"@end
\n
"
,
true
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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