forked from qt-creator/qt-creator
Fixed the auto tests.
This commit is contained in:
@@ -18,7 +18,7 @@ public:
|
||||
TranslationUnit *parse(const QByteArray &source,
|
||||
TranslationUnit::ParseMode mode)
|
||||
{
|
||||
StringLiteral *fileId = control.findOrInsertFileName("<stdin>");
|
||||
StringLiteral *fileId = control.findOrInsertStringLiteral("<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);
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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"
|
||||
"\nfoo(1, 2)\n");
|
||||
QByteArray preprocessed = preprocess(QLatin1String("<stdin>"),
|
||||
QByteArray("\n#define foo(a,b) a + b"
|
||||
"\nfoo(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"
|
||||
"\nfoo(1, 2\n");
|
||||
QByteArray preprocessed = preprocess(QLatin1String("<stdin>"),
|
||||
QByteArray("\n#define foo(a,b) a + b"
|
||||
"\nfoo(1, 2\n"));
|
||||
QByteArray expected = "foo";
|
||||
QCOMPARE(preprocessed.trimmed(), expected);
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ public:
|
||||
TranslationUnit *parse(const QByteArray &source,
|
||||
TranslationUnit::ParseMode mode)
|
||||
{
|
||||
StringLiteral *fileId = control.findOrInsertFileName("<stdin>");
|
||||
StringLiteral *fileId = control.findOrInsertStringLiteral("<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 (DeclarationListAST *decl = ast->declarations; decl; decl = decl->next) {
|
||||
sem.check(decl->declaration, globals);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
|
||||
DEFINES += CPLUSPLUS_WITH_NAMESPACE
|
||||
INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus
|
||||
DEPENDPATH += $$INCLUDEPATH .
|
||||
LIBS += -L$$PWD -lCPlusPlusTestSupport
|
||||
|
@@ -5,5 +5,4 @@ CONFIG += static
|
||||
QT = core
|
||||
DESTDIR = $$PWD
|
||||
|
||||
DEFINES += CPLUSPLUS_WITH_NAMESPACE
|
||||
include($$PWD/../../../../src/shared/cplusplus/cplusplus.pri)
|
||||
|
Reference in New Issue
Block a user