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

@@ -25,8 +25,7 @@ using namespace CppEditor;
using namespace ProjectExplorer;
using namespace Utils;
namespace CompilationDatabaseProjectManager {
namespace Internal {
namespace CompilationDatabaseProjectManager::Internal {
CompilationDatabaseTests::CompilationDatabaseTests(QObject *parent)
: QObject(parent)
@@ -57,7 +56,7 @@ void CompilationDatabaseTests::cleanupTestCase()
void CompilationDatabaseTests::testProject()
{
QFETCH(QString, projectFilePath);
QFETCH(FilePath, projectFilePath);
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
const CppEditor::ProjectInfo::ConstPtr projectInfo = projectManager.open(projectFilePath, true);
@@ -263,12 +262,11 @@ void CompilationDatabaseTests::testSkipOutputFiles()
QVERIFY(testData.getFilteredFlags().isEmpty());
}
void CompilationDatabaseTests::addTestRow(const QByteArray &relativeFilePath)
void CompilationDatabaseTests::addTestRow(const QString &relativeFilePath)
{
const QString absoluteFilePath = m_tmpDir->absolutePath(relativeFilePath);
const FilePath absoluteFilePath = m_tmpDir->absolutePath(relativeFilePath);
QTest::newRow(relativeFilePath.constData()) << absoluteFilePath;
QTest::newRow(qPrintable(relativeFilePath)) << absoluteFilePath;
}
} // namespace Internal
} // namespace CompilationDatabaseProjectManager
} // CompilationDatabaseProjectManager::Internal

View File

@@ -8,8 +8,7 @@
namespace CppEditor { namespace Tests { class TemporaryCopiedDir; } }
namespace CompilationDatabaseProjectManager {
namespace Internal {
namespace CompilationDatabaseProjectManager::Internal {
class CompilationDatabaseTests : public QObject
{
@@ -34,10 +33,9 @@ private slots:
void testSkipOutputFiles();
private:
void addTestRow(const QByteArray &relativeFilePath);
void addTestRow(const QString &relativeFilePath);
std::unique_ptr<CppEditor::Tests::TemporaryCopiedDir> m_tmpDir;
};
} // namespace Internal
} // namespace CompilationDatabaseProjectManager
} // CompilationDatabaseProjectManager::Internal