FilePathify some testing code

Change-Id: I3739a6eb3c2172078e9519e8186daf94ec74d99a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-12 15:30:01 +01:00
parent 2ce413112b
commit 33cdb052ba
13 changed files with 63 additions and 68 deletions

View File

@@ -84,7 +84,7 @@ static ClangDiagnosticConfig configFor(const QString &tidyChecks, const QString
void ClangToolsUnitTests::testProject()
{
QFETCH(QString, projectFilePath);
QFETCH(FilePath, projectFilePath);
QFETCH(int, expectedDiagCountClangTidy);
QFETCH(int, expectedDiagCountClazy);
QFETCH(ClangDiagnosticConfig, diagnosticConfig);
@@ -119,7 +119,7 @@ void ClangToolsUnitTests::testProject()
void ClangToolsUnitTests::testProject_data()
{
QTest::addColumn<QString>("projectFilePath");
QTest::addColumn<FilePath>("projectFilePath");
QTest::addColumn<int>("expectedDiagCountClangTidy");
QTest::addColumn<int>("expectedDiagCountClazy");
QTest::addColumn<ClangDiagnosticConfig>("diagnosticConfig");
@@ -161,8 +161,8 @@ void ClangToolsUnitTests::addTestRow(const QByteArray &relativeFilePath,
int expectedDiagCountClazy,
const ClangDiagnosticConfig &diagnosticConfig)
{
const QString absoluteFilePath = m_tmpDir->absolutePath(relativeFilePath);
const QString fileName = QFileInfo(absoluteFilePath).fileName();
const FilePath absoluteFilePath = m_tmpDir->absolutePath(QString::fromUtf8(relativeFilePath));
const QString fileName = absoluteFilePath.fileName();
QTest::newRow(fileName.toUtf8().constData())
<< absoluteFilePath << expectedDiagCountClangTidy << expectedDiagCountClazy