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
Marco Bubke
flatpak-qt-creator
Commits
e6d0f2ca
Commit
e6d0f2ca
authored
Jun 19, 2009
by
Roberto Raggi
Browse files
Fixed the auto tests.
parent
aed93679
Changes
6
Hide whitespace changes
Inline
Side-by-side
tests/auto/cplusplus/ast/tst_ast.cpp
View file @
e6d0f2ca
...
...
@@ -18,7 +18,7 @@ public:
TranslationUnit
*
parse
(
const
QByteArray
&
source
,
TranslationUnit
::
ParseMode
mode
)
{
StringLiteral
*
fileId
=
control
.
findOrInsert
FileName
(
"<stdin>"
);
StringLiteral
*
fileId
=
control
.
findOrInsert
StringLiteral
(
"<stdin>"
);
TranslationUnit
*
unit
=
new
TranslationUnit
(
&
control
,
fileId
);
unit
->
setObjCEnabled
(
true
);
unit
->
setSource
(
source
.
constData
(),
source
.
length
());
...
...
@@ -88,7 +88,7 @@ void tst_AST::template_id()
QVERIFY
(
ast
->
asTemplateId
()
->
template_arguments
!=
0
);
QVERIFY
(
ast
->
asTemplateId
()
->
template_arguments
->
template_argument
!=
0
);
QVERIFY
(
ast
->
asTemplateId
()
->
template_arguments
->
template_argument
->
asNumericLiteral
()
!=
0
);
QCOMPARE
(
ast
->
asTemplateId
()
->
template_arguments
->
template_argument
->
asNumericLiteral
()
->
token
,
3U
);
QCOMPARE
(
ast
->
asTemplateId
()
->
template_arguments
->
template_argument
->
asNumericLiteral
()
->
literal_
token
,
3U
);
QVERIFY
(
ast
->
asTemplateId
()
->
template_arguments
->
next
==
0
);
QCOMPARE
(
ast
->
asTemplateId
()
->
greater_token
,
4U
);
}
...
...
@@ -358,7 +358,13 @@ void tst_AST::cpp_initializer_or_function_declaration()
QCOMPARE
(
param_clause
->
dot_dot_dot_token
,
0U
);
// check the parameter
ParameterDeclarationAST
*
param
=
param_clause
->
parameter_declarations
->
asParameterDeclaration
();
DeclarationListAST
*
declarations
=
param_clause
->
parameter_declarations
->
asDeclarationList
();
QVERIFY
(
declarations
);
QVERIFY
(
declarations
->
declaration
);
QVERIFY
(
!
declarations
->
next
);
ParameterDeclarationAST
*
param
=
declarations
->
declaration
->
asParameterDeclaration
();
QVERIFY
(
param
);
QVERIFY
(
param
->
type_specifier
!=
0
);
QVERIFY
(
param
->
type_specifier
->
next
==
0
);
QVERIFY
(
param
->
type_specifier
->
asNamedTypeSpecifier
()
!=
0
);
...
...
tests/auto/cplusplus/preprocessor/preprocessor.pro
View file @
e6d0f2ca
...
...
@@ -2,7 +2,6 @@ TEMPLATE = app
CONFIG
+=
qt
warn_on
console
depend_includepath
QT
=
core
testlib
TARGET
=
tst_
$$
TARGET
DEFINES
+=
CPLUSPLUS_WITH_NAMESPACE
include
(..
/../../../
src
/
libs
/
cplusplus
/
cplusplus
-
lib
.
pri
)
...
...
tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
View file @
e6d0f2ca
...
...
@@ -19,9 +19,9 @@ void tst_Preprocessor::pp_with_no_client()
Environment
env
;
Preprocessor
preprocess
(
client
,
&
env
);
QByteArray
preprocessed
=
preprocess
(
"<stdin>"
,
"
\n
#define foo(a,b) a + b"
"
\n
foo(1, 2)
\n
"
);
QByteArray
preprocessed
=
preprocess
(
QLatin1String
(
"<stdin>"
)
,
QByteArray
(
"
\n
#define foo(a,b) a + b"
"
\n
foo(1, 2)
\n
"
)
)
;
QByteArray
expected
=
"1 + 2"
;
QCOMPARE
(
preprocessed
.
trimmed
(),
expected
);
}
...
...
@@ -32,9 +32,9 @@ void tst_Preprocessor::unfinished_function_like_macro_call()
Environment
env
;
Preprocessor
preprocess
(
client
,
&
env
);
QByteArray
preprocessed
=
preprocess
(
"<stdin>"
,
"
\n
#define foo(a,b) a + b"
"
\n
foo(1, 2
\n
"
);
QByteArray
preprocessed
=
preprocess
(
QLatin1String
(
"<stdin>"
)
,
QByteArray
(
"
\n
#define foo(a,b) a + b"
"
\n
foo(1, 2
\n
"
)
)
;
QByteArray
expected
=
"foo"
;
QCOMPARE
(
preprocessed
.
trimmed
(),
expected
);
}
...
...
tests/auto/cplusplus/semantic/tst_semantic.cpp
View file @
e6d0f2ca
...
...
@@ -28,7 +28,7 @@ public:
TranslationUnit
*
parse
(
const
QByteArray
&
source
,
TranslationUnit
::
ParseMode
mode
)
{
StringLiteral
*
fileId
=
control
.
findOrInsert
FileName
(
"<stdin>"
);
StringLiteral
*
fileId
=
control
.
findOrInsert
StringLiteral
(
"<stdin>"
);
TranslationUnit
*
unit
=
new
TranslationUnit
(
&
control
,
fileId
);
unit
->
setSource
(
source
.
constData
(),
source
.
length
());
unit
->
parse
(
mode
);
...
...
@@ -53,8 +53,8 @@ public:
Semantic
sem
(
unit
->
control
());
TranslationUnitAST
*
ast
=
unit
->
ast
()
->
asTranslationUnit
();
QVERIFY
(
ast
);
for
(
DeclarationAST
*
decl
=
ast
->
declarations
;
decl
;
decl
=
decl
->
next
)
{
sem
.
check
(
decl
,
globals
);
for
(
Declaration
List
AST
*
decl
=
ast
->
declarations
;
decl
;
decl
=
decl
->
next
)
{
sem
.
check
(
decl
->
declaration
,
globals
);
}
}
...
...
tests/auto/cplusplus/shared/shared.pri
View file @
e6d0f2ca
DEFINES += CPLUSPLUS_WITH_NAMESPACE
INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus
DEPENDPATH += $$INCLUDEPATH .
LIBS += -L$$PWD -lCPlusPlusTestSupport
tests/auto/cplusplus/shared/shared.pro
View file @
e6d0f2ca
...
...
@@ -5,5 +5,4 @@ CONFIG += static
QT
=
core
DESTDIR
=
$$
PWD
DEFINES
+=
CPLUSPLUS_WITH_NAMESPACE
include
(
$$
PWD
/../../../../
src
/
shared
/
cplusplus
/
cplusplus
.
pri
)
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