forked from qt-creator/qt-creator
AutoTest: Improve type safety in TestTreeItem
Ensures that the static_cast<>() in framework() always succeeds. Change-Id: I6aff0cf12a565bd6f9791c67979698729d7143e5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -48,11 +48,11 @@ public:
|
||||
Q_FLAGS(TestState)
|
||||
Q_DECLARE_FLAGS(TestStates, TestState)
|
||||
|
||||
explicit BoostTestTreeItem(ITestBase *base,
|
||||
explicit BoostTestTreeItem(ITestFramework *framework,
|
||||
const QString &name = QString(),
|
||||
const QString &filePath = QString(),
|
||||
Type type = Root)
|
||||
: TestTreeItem(base, name, filePath, type)
|
||||
: TestTreeItem(framework, name, filePath, type)
|
||||
{}
|
||||
|
||||
public:
|
||||
|
@@ -41,9 +41,9 @@ public:
|
||||
Q_FLAGS(TestState)
|
||||
Q_DECLARE_FLAGS(TestStates, TestState)
|
||||
|
||||
explicit CatchTreeItem(ITestBase *testBase, const QString &name = QString(),
|
||||
explicit CatchTreeItem(ITestFramework *testFramework, const QString &name = QString(),
|
||||
const QString &filePath = QString(), Type type = Root)
|
||||
: TestTreeItem(testBase, name, filePath, type) {}
|
||||
: TestTreeItem(testFramework, name, filePath, type) {}
|
||||
|
||||
void setStates(CatchTreeItem::TestStates state) { m_state = state; }
|
||||
CatchTreeItem::TestStates states() const { return m_state; }
|
||||
|
@@ -46,11 +46,11 @@ public:
|
||||
Q_FLAGS(TestState)
|
||||
Q_DECLARE_FLAGS(TestStates, TestState)
|
||||
|
||||
explicit GTestTreeItem(ITestBase *testBase,
|
||||
explicit GTestTreeItem(ITestFramework *testFramework,
|
||||
const QString &name = QString(),
|
||||
const QString &filePath = QString(),
|
||||
Type type = Root)
|
||||
: TestTreeItem(testBase, name, filePath, type), m_state(Enabled)
|
||||
: TestTreeItem(testFramework, name, filePath, type), m_state(Enabled)
|
||||
{}
|
||||
|
||||
TestTreeItem *copyWithoutChildren() override;
|
||||
|
@@ -34,9 +34,9 @@
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
QtTestTreeItem::QtTestTreeItem(ITestBase *testBase, const QString &name,
|
||||
QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name,
|
||||
const QString &filePath, TestTreeItem::Type type)
|
||||
: TestTreeItem(testBase, name, filePath, type)
|
||||
: TestTreeItem(testFramework, name, filePath, type)
|
||||
{
|
||||
if (type == TestDataTag)
|
||||
setData(0, Qt::Checked, Qt::CheckStateRole);
|
||||
|
@@ -33,7 +33,7 @@ namespace Internal {
|
||||
class QtTestTreeItem : public TestTreeItem
|
||||
{
|
||||
public:
|
||||
explicit QtTestTreeItem(ITestBase *framework, const QString &name = QString(),
|
||||
explicit QtTestTreeItem(ITestFramework *framework, const QString &name = QString(),
|
||||
const QString &filePath = QString(), Type type = Root);
|
||||
|
||||
TestTreeItem *copyWithoutChildren() override;
|
||||
|
@@ -33,11 +33,11 @@ namespace Internal {
|
||||
class QuickTestTreeItem : public TestTreeItem
|
||||
{
|
||||
public:
|
||||
explicit QuickTestTreeItem(ITestBase *testBase,
|
||||
explicit QuickTestTreeItem(ITestFramework *testFramework,
|
||||
const QString &name = QString(),
|
||||
const QString &filePath = QString(),
|
||||
Type type = Root)
|
||||
: TestTreeItem(testBase, name, filePath, type)
|
||||
: TestTreeItem(testFramework, name, filePath, type)
|
||||
{}
|
||||
|
||||
TestTreeItem *copyWithoutChildren() override;
|
||||
|
@@ -164,9 +164,9 @@ ITestConfiguration *ITestTreeItem::asConfiguration(TestRunMode mode) const
|
||||
|
||||
/****************************** TestTreeItem ********************************************/
|
||||
|
||||
TestTreeItem::TestTreeItem(ITestBase *testBase, const QString &name,
|
||||
TestTreeItem::TestTreeItem(ITestFramework *testFramework, const QString &name,
|
||||
const QString &filePath, Type type)
|
||||
: ITestTreeItem(testBase, name, filePath, type)
|
||||
: ITestTreeItem(testFramework, name, filePath, type)
|
||||
{
|
||||
switch (type) {
|
||||
case Root:
|
||||
|
@@ -120,7 +120,7 @@ private:
|
||||
class TestTreeItem : public ITestTreeItem
|
||||
{
|
||||
public:
|
||||
explicit TestTreeItem(ITestBase *testBase,
|
||||
explicit TestTreeItem(ITestFramework *testFramework,
|
||||
const QString &name = QString(),
|
||||
const QString &filePath = QString(),
|
||||
Type type = Root);
|
||||
|
Reference in New Issue
Block a user