From 0853fa077bbf90acca5efd5dd4f90f2276afb178 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 1 Jun 2012 18:51:33 +0200 Subject: [PATCH 1/5] Squish: Added tst_simple_debug to suite_debugger Change-Id: I2b13562e774780b0ccb15decdd84f32a08e1f60a Reviewed-by: Christian Stenger --- tests/system/suite_debugger/suite.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_debugger/suite.conf b/tests/system/suite_debugger/suite.conf index d776d72c7a0..17d36a99df2 100644 --- a/tests/system/suite_debugger/suite.conf +++ b/tests/system/suite_debugger/suite.conf @@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAP=../objects.map -TEST_CASES=tst_build_new_project tst_cli_output_console +TEST_CASES=tst_build_new_project tst_cli_output_console tst_simple_debug VERSION=2 WRAPPERS=Qt From 046f42b2821b3c595c318af1ec088b7df104b01f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 1 Jun 2012 17:58:56 +0200 Subject: [PATCH 2/5] Squish: Removed unused code and data Change-Id: I20df2aa148002ecb9b1526df125daf04bc76010e Reviewed-by: Bill King Reviewed-by: Christian Stenger --- tests/system/objects.map | 2 -- .../suite_general/shared/testdata/creator_tree.tsv | 1 - .../system/suite_general/shared/testdata/qt_tree.tsv | 3 --- .../shared/testdata/speedcrunch_tree.tsv | 1 - .../suite_general/tst_build_speedcrunch/test.py | 6 ------ .../suite_general/tst_cmake_speedcrunch/test.py | 6 ------ tests/system/suite_general/tst_openqt_creator/test.py | 11 ----------- 7 files changed, 30 deletions(-) delete mode 100644 tests/system/suite_general/shared/testdata/creator_tree.tsv delete mode 100644 tests/system/suite_general/shared/testdata/qt_tree.tsv delete mode 100644 tests/system/suite_general/shared/testdata/speedcrunch_tree.tsv diff --git a/tests/system/objects.map b/tests/system/objects.map index a1c33375355..c57d9f278ea 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -57,8 +57,6 @@ :formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} :frame.templateDescription_QTextBrowser {container=':New.frame_QFrame' name='templateDescription' type='QTextBrowser' visible='1'} :headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} -:projects.projects.pro_QModelIndex {column='0' container=':projects_QModelIndex' text='projects.pro' type='QModelIndex'} -:projects_QModelIndex {column='0' container=':Qt Creator_Utils::NavigationTreeView' text='projects' type='QModelIndex'} :qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='QtSupport__Internal__QtVersionManager' type='QtSupport::Internal::QtOptionsPageWidget' visible='1'} :scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'} :scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create build configurations:' type='QLabel' unnamed='1' visible='1'} diff --git a/tests/system/suite_general/shared/testdata/creator_tree.tsv b/tests/system/suite_general/shared/testdata/creator_tree.tsv deleted file mode 100644 index 7c31458f157..00000000000 --- a/tests/system/suite_general/shared/testdata/creator_tree.tsv +++ /dev/null @@ -1 +0,0 @@ -"node" "value" diff --git a/tests/system/suite_general/shared/testdata/qt_tree.tsv b/tests/system/suite_general/shared/testdata/qt_tree.tsv deleted file mode 100644 index e40c8e78f3b..00000000000 --- a/tests/system/suite_general/shared/testdata/qt_tree.tsv +++ /dev/null @@ -1,3 +0,0 @@ -"node" "value" -":projects.projects.pro_QModelIndex" "projects.pro" -":projects_QModelIndex" "projects" diff --git a/tests/system/suite_general/shared/testdata/speedcrunch_tree.tsv b/tests/system/suite_general/shared/testdata/speedcrunch_tree.tsv deleted file mode 100644 index 7c31458f157..00000000000 --- a/tests/system/suite_general/shared/testdata/speedcrunch_tree.tsv +++ /dev/null @@ -1 +0,0 @@ -"node" "value" diff --git a/tests/system/suite_general/tst_build_speedcrunch/test.py b/tests/system/suite_general/tst_build_speedcrunch/test.py index 147cc967fc8..bb10b13c714 100644 --- a/tests/system/suite_general/tst_build_speedcrunch/test.py +++ b/tests/system/suite_general/tst_build_speedcrunch/test.py @@ -18,12 +18,6 @@ def main(): openQmakeProject(SpeedCrunchPath) waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") - # Test that some of the expected items are in the navigation tree - for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")): - node = testData.field(record, "node") - value = testData.field(record, "value") - test.compare(waitForObject(node).text, value) - fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton") qtVerPattern = re.compile("\d\.\d(\.\d+)?") diff --git a/tests/system/suite_general/tst_cmake_speedcrunch/test.py b/tests/system/suite_general/tst_cmake_speedcrunch/test.py index 76244acb2d5..da99b28e5df 100644 --- a/tests/system/suite_general/tst_cmake_speedcrunch/test.py +++ b/tests/system/suite_general/tst_cmake_speedcrunch/test.py @@ -23,12 +23,6 @@ def main(): return waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") - # Test that some of the expected items are in the navigation tree - for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")): - node = testData.field(record, "node") - value = testData.field(record, "value") - test.compare(findObject(node).text, value) - # Invoke a rebuild of the application invokeMenuItem("Build", "Rebuild All") diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index 77966b3eaad..2fd8983796a 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -15,17 +15,6 @@ def main(): # Wait for parsing to complete waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000) - # Test that some of the expected items are in the navigation tree - for row, record in enumerate(testData.dataset("creator_tree.tsv")): - node = testData.field(record, "node") - value = testData.field(record, "value") - test.compare(waitForObject(node).text, value) - - for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")): - node = testData.field(record, "node") - value = testData.field(record, "value") - test.compare(waitForObject(node).text, value) - # Now check some basic lookups in the search box selectFromLocator(": Qlist::QList", "QList::QList") test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList") From 5d01b60d56a97254aa7de9842b412fae15dc6c54 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 4 Jun 2012 18:53:56 +0200 Subject: [PATCH 3/5] Squish: Avoid warning about missing Harmattan target in APTW01 Change-Id: Ibeb0477a8283d229888c4744beecfc6bd8252f3c Reviewed-by: Christian Stenger --- tests/system/shared/project.py | 4 +++- tests/system/shared/workarounds.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index de59f8a74a1..ac8a7add4ae 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -153,7 +153,9 @@ def __verifyFileCreation__(path, expectedFiles): # created for this version. If it is None, all Qt versions will be used # param checks turns tests in the function on if set to True def createProject_Qt_GUI(path, projectName, qtVersion = None, checks = True): - available = __createProjectSelectType__(" Applications", "Qt Gui Application") + template = "Qt Gui Application" + available = __createProjectSelectType__(" Applications", template) + JIRA.performWorkaroundIfStillOpen(6994, JIRA.Bug.CREATOR, template, available) __createProjectSetNameAndPath__(path, projectName, checks) __selectQtVersionDesktop__(qtVersion, checks, available) diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 3b2e6f8da1f..dc8a8c7c12f 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -187,7 +187,10 @@ class JIRA: def _workaroundCreator6994_(self, *args): if args[0] in ('Mobile Qt Application', 'Qt Gui Application', 'Qt Custom Designer Widget'): - args[1].remove('Harmattan') + if QtQuickConstants.Targets.HARMATTAN in args[1]: + args[1].remove(QtQuickConstants.Targets.HARMATTAN) + else: + args[1].remove(QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN)) test.xverify(False, "Removed Harmattan from expected targets.") def _workaroundCreator6853_(self, *args): From ec5c280e21ea159287621ab564a14c74582588a5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Jun 2012 10:39:35 +0200 Subject: [PATCH 4/5] Fix commit to mercurial repositories Tasknumber: QTCREATORBUG-7511 Change-Id: I07991c1d96b3239e66d47d9c7d5c85f8fdc14af4 Reviewed-by: Hugues Delorme --- src/plugins/mercurial/mercurialplugin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index e91fad15ed3..3dd9bb42940 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -552,8 +552,8 @@ void MercurialPlugin::commit() m_submitRepository = state.topLevel(); - connect(m_client, SIGNAL(parsedStatus(QList)), - this, SLOT(showCommitWidget(QList))); + connect(m_client, SIGNAL(parsedStatus(QList)), + this, SLOT(showCommitWidget(QList))); m_client->emitParsedStatus(m_submitRepository); } @@ -562,8 +562,8 @@ void MercurialPlugin::showCommitWidget(const QList &s VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance(); //Once we receive our data release the connection so it can be reused elsewhere - disconnect(m_client, SIGNAL(parsedStatus(QList)), - this, SLOT(showCommitWidget(QList))); + disconnect(m_client, SIGNAL(parsedStatus(QList)), + this, SLOT(showCommitWidget(QList))); if (status.isEmpty()) { outputWindow->appendError(tr("There are no changes to commit.")); From a66e344b424643fce71c127fdfb0a21103ca0171 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Fri, 8 Jun 2012 11:52:45 +0200 Subject: [PATCH 5/5] C++: Fix crash on invalid class name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTCREATORBUG-7462 Change-Id: Ic1df4b535c5a617efa707110138c76e6e7ef1e4b Reviewed-by: Robert Löhning Reviewed-by: Leandro Melo --- src/libs/3rdparty/cplusplus/Bind.cpp | 35 +++++++++++++++++----------- src/libs/3rdparty/cplusplus/Bind.h | 2 ++ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index 0d006911e4b..6df1951b660 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -1851,6 +1851,8 @@ bool Bind::visit(SimpleDeclarationAST *ast) name = elabTypeSpec->name->name; } + ensureValidClassName(&name, sourceLocation); + ForwardClassDeclaration *decl = control()->newForwardClassDeclaration(sourceLocation, name); setDeclSpecifiers(decl, type); _scope->addMember(decl); @@ -2882,20 +2884,7 @@ bool Bind::visit(ClassSpecifierAST *ast) } } - // get the unqualified class name - const QualifiedNameId *q = className->asQualifiedNameId(); - const Name *unqualifiedClassName = q ? q->name() : className; - - if (! unqualifiedClassName) // paranoia check - className = 0; - else if (! (unqualifiedClassName->isNameId() || unqualifiedClassName->isTemplateNameId())) { - translationUnit()->error(sourceLocation, "expected a class-name"); - - className = unqualifiedClassName->identifier(); - - if (q && className) - className = control()->qualifiedNameId(q->base(), className); - } + ensureValidClassName(&className, sourceLocation); } Class *klass = control()->newClass(sourceLocation, className); @@ -3124,6 +3113,24 @@ bool Bind::visit(ArrayDeclaratorAST *ast) return false; } +void Bind::ensureValidClassName(const Name **name, unsigned sourceLocation) +{ + if (!*name) + return; + + const QualifiedNameId *qName = (*name)->asQualifiedNameId(); + if (qName) + *name = qName->name(); + + if (!(*name)->isNameId() && !(*name)->isTemplateNameId()) { + translationUnit()->error(sourceLocation, "expected a class-name"); + + *name = (*name)->identifier(); + if (qName) + *name = control()->qualifiedNameId(qName->base(), *name); + } +} + int Bind::visibilityForAccessSpecifier(int tokenKind) { switch (tokenKind) { diff --git a/src/libs/3rdparty/cplusplus/Bind.h b/src/libs/3rdparty/cplusplus/Bind.h index d1fff79ea50..de0cf125573 100644 --- a/src/libs/3rdparty/cplusplus/Bind.h +++ b/src/libs/3rdparty/cplusplus/Bind.h @@ -274,6 +274,8 @@ protected: private: static const int kMaxDepth; + void ensureValidClassName(const Name **name, unsigned sourceLocation); + Scope *_scope; ExpressionTy _expression; const Name *_name;