Commit bad4bac2 authored by Christian Stenger's avatar Christian Stenger

AutoTest: Do not use special members in base class

Change-Id: I9e110039ea886f6b0c3e6ddc7361bc9fac387abe
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent aaf7181c
......@@ -588,7 +588,7 @@ static bool handleGTest(QFutureInterface<TestParseResultPtr> futureInterface, co
GTestVisitor visitor(document);
visitor.accept(ast);
QMap<GTestCaseSpec, TestCodeLocationList> result = visitor.gtestFunctions();
QMap<GTestCaseSpec, GTestCodeLocationList> result = visitor.gtestFunctions();
QString proFile;
const CppTools::CppModelManager *cppMM = CppTools::CppModelManager::instance();
QList<CppTools::ProjectPart::Ptr> ppList = cppMM->projectPart(filePath);
......@@ -605,7 +605,7 @@ static bool handleGTest(QFutureInterface<TestParseResultPtr> futureInterface, co
parseResult->disabled = testSpec.disabled;
parseResult->proFile = proFile;
foreach (const TestCodeLocationAndType &location, result.value(testSpec)) {
foreach (const GTestCodeLocationAndType &location, result.value(testSpec)) {
GoogleTestParseResult *testSet = new GoogleTestParseResult;
testSet->name = location.m_name;
testSet->fileName = filePath;
......
......@@ -43,7 +43,6 @@ namespace {
namespace Autotest {
namespace Internal {
struct TestCodeLocationAndType;
class AutoTestTreeItem;
class QuickTestTreeItem;
class GoogleTestTreeItem;
......@@ -138,8 +137,6 @@ private:
Status m_status;
};
typedef QVector<TestCodeLocationAndType> TestCodeLocationList;
class AutoTestTreeItem : public TestTreeItem
{
public:
......@@ -213,14 +210,24 @@ private:
GoogleTestTreeItem::TestStates m_state;
};
struct TestCodeLocationAndType {
class TestCodeLocationAndType
{
public:
QString m_name; // tag name for m_type == TEST_DATATAG, file name for other values
unsigned m_line;
unsigned m_column;
TestTreeItem::Type m_type;
};
class GTestCodeLocationAndType : public TestCodeLocationAndType
{
public:
GoogleTestTreeItem::TestStates m_state;
};
typedef QVector<TestCodeLocationAndType> TestCodeLocationList;
typedef QVector<GTestCodeLocationAndType> GTestCodeLocationList;
struct GTestCaseSpec
{
QString testCaseName;
......
......@@ -405,7 +405,7 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
unsigned token = id->firstToken();
m_document->translationUnit()->getTokenStartPosition(token, &line, &column);
TestCodeLocationAndType locationAndType;
GTestCodeLocationAndType locationAndType;
locationAndType.m_name = testName;
locationAndType.m_line = line;
locationAndType.m_column = column - 1;
......
......@@ -155,12 +155,12 @@ public:
GTestVisitor(CPlusPlus::Document::Ptr doc);
bool visit(CPlusPlus::FunctionDefinitionAST *ast);
QMap<GTestCaseSpec, TestCodeLocationList> gtestFunctions() const { return m_gtestFunctions; }
QMap<GTestCaseSpec, GTestCodeLocationList> gtestFunctions() const { return m_gtestFunctions; }
private:
CPlusPlus::Document::Ptr m_document;
CPlusPlus::Overview m_overview;
QMap<GTestCaseSpec, TestCodeLocationList> m_gtestFunctions;
QMap<GTestCaseSpec, GTestCodeLocationList> m_gtestFunctions;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment