Commit 8e5af55b authored by David Schulz's avatar David Schulz Committed by Christian Stenger

AutoTest: Add convenient function to modify line and column.

Change-Id: Ica5fe4a8048b8faf75767bddb36a062ec438fcfe
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 36f6a558
......@@ -138,7 +138,7 @@ bool TestTreeItem::modifyTestCaseContent(const QString &name, unsigned line, uns
bool TestTreeItem::modifyTestFunctionContent(const TestCodeLocationAndType &location)
{
bool hasBeenModified = modifyFilePath(location.m_name);
hasBeenModified |= modifyLineAndColumn(location.m_line, location.m_column);
hasBeenModified |= modifyLineAndColumn(location);
return hasBeenModified;
}
......@@ -147,10 +147,15 @@ bool TestTreeItem::modifyDataTagContent(const QString &fileName,
{
bool hasBeenModified = modifyFilePath(fileName);
hasBeenModified |= modifyName(location.m_name);
hasBeenModified |= modifyLineAndColumn(location.m_line, location.m_column);
hasBeenModified |= modifyLineAndColumn(location);
return hasBeenModified;
}
bool TestTreeItem::modifyLineAndColumn(const TestCodeLocationAndType &location)
{
return modifyLineAndColumn(location.m_line, location.m_column);
}
bool TestTreeItem::modifyLineAndColumn(unsigned line, unsigned column)
{
bool hasBeenModified = false;
......@@ -420,7 +425,7 @@ bool GoogleTestTreeItem::modifyTestSetContent(const QString &fileName,
const TestCodeLocationAndType &location)
{
bool hasBeenModified = modifyFilePath(fileName);
hasBeenModified |= modifyLineAndColumn(location.m_line, location.m_column);
hasBeenModified |= modifyLineAndColumn(location);
if (m_state != location.m_state) {
m_state = location.m_state;
hasBeenModified = true;
......
......@@ -72,6 +72,7 @@ public:
bool modifyTestCaseContent(const QString &name, unsigned line, unsigned column);
bool modifyTestFunctionContent(const TestCodeLocationAndType &location);
bool modifyDataTagContent(const QString &fileName, const TestCodeLocationAndType &location);
bool modifyLineAndColumn(const TestCodeLocationAndType &location);
bool modifyLineAndColumn(unsigned line, unsigned column);
const QString name() const { return m_name; }
......
......@@ -723,7 +723,7 @@ void TestTreeModel::handleUnnamedQuickParseResult(const TestParseResult &result)
func, result));
continue;
}
functionItem->modifyLineAndColumn(location.m_line, location.m_column);
functionItem->modifyLineAndColumn(location);
functionItem->markForRemoval(false);
}
}
......
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