From fdc6738036ed11049c645a231e2936c5364f9175 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 12 Apr 2024 09:12:45 +0200 Subject: [PATCH] added `PathWithDetails` to store input path in and use it in `FileSettings` --- Makefile | 4 +++ cli/cmdlineparser.cpp | 6 ++-- cli/cppcheckexecutor.cpp | 2 +- cli/processexecutor.cpp | 4 +-- gui/checkthread.cpp | 8 ++--- gui/compliancereportdialog.cpp | 2 +- gui/threadresult.cpp | 2 +- lib/analyzerinfo.cpp | 4 +-- lib/cppcheck.cpp | 10 +++---- lib/filesettings.h | 26 +++++++++++++++- lib/importproject.cpp | 24 +++++++-------- test/testcppcheck.cpp | 2 +- test/testfilesettings.cpp | 55 ++++++++++++++++++++++++++++++++++ test/testimportproject.cpp | 14 ++++----- test/testprocessexecutor.cpp | 4 +-- test/testrunner.vcxproj | 1 + test/testsingleexecutor.cpp | 4 +-- test/testsuppressions.cpp | 6 ++-- test/testthreadexecutor.cpp | 4 +-- 19 files changed, 133 insertions(+), 49 deletions(-) create mode 100644 test/testfilesettings.cpp diff --git a/Makefile b/Makefile index f482051b8fac..c35d69a0afe8 100644 --- a/Makefile +++ b/Makefile @@ -293,6 +293,7 @@ TESTOBJ = test/fixture.o \ test/testerrorlogger.o \ test/testexceptionsafety.o \ test/testfilelister.o \ + test/testfilesettings.o \ test/testfunctions.o \ test/testgarbage.o \ test/testimportproject.o \ @@ -753,6 +754,9 @@ test/testexceptionsafety.o: test/testexceptionsafety.cpp lib/addoninfo.h lib/che test/testfilelister.o: test/testfilelister.cpp cli/filelister.h lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/pathmatch.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilelister.cpp +test/testfilesettings.o: test/testfilesettings.cpp lib/addoninfo.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/filesettings.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h + $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfilesettings.cpp + test/testfunctions.o: test/testfunctions.cpp lib/addoninfo.h lib/check.h lib/checkfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/tokenize.h lib/tokenlist.h lib/utils.h test/fixture.h test/helpers.h $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testfunctions.cpp diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 503d3f7ff328..b85d0f84ede6 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -204,7 +204,7 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) if (!mSettings.fileFilters.empty()) { // filter only for the selected filenames from all project files std::copy_if(fileSettingsRef.cbegin(), fileSettingsRef.cend(), std::back_inserter(fileSettings), [&](const FileSettings &fs) { - return matchglobs(mSettings.fileFilters, fs.filename); + return matchglobs(mSettings.fileFilters, fs.filename()); }); if (fileSettings.empty()) { mLogger.printError("could not find any files matching the filter."); @@ -219,11 +219,11 @@ bool CmdLineParser::fillSettingsFromArgs(int argc, const char* const argv[]) // sort the markup last std::copy_if(fileSettings.cbegin(), fileSettings.cend(), std::back_inserter(mFileSettings), [&](const FileSettings &fs) { - return !mSettings.library.markupFile(fs.filename) || !mSettings.library.processMarkupAfterCode(fs.filename); + return !mSettings.library.markupFile(fs.filename()) || !mSettings.library.processMarkupAfterCode(fs.filename()); }); std::copy_if(fileSettings.cbegin(), fileSettings.cend(), std::back_inserter(mFileSettings), [&](const FileSettings &fs) { - return mSettings.library.markupFile(fs.filename) && mSettings.library.processMarkupAfterCode(fs.filename); + return mSettings.library.markupFile(fs.filename()) && mSettings.library.processMarkupAfterCode(fs.filename()); }); if (mFileSettings.empty()) { diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 82673af9c14d..d1407fe77994 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -237,7 +237,7 @@ bool CppCheckExecutor::reportSuppressions(const Settings &settings, const Suppre for (std::list::const_iterator i = fileSettings.cbegin(); i != fileSettings.cend(); ++i) { err |= SuppressionList::reportUnmatchedSuppressions( - suppressions.getUnmatchedLocalSuppressions(i->filename, unusedFunctionCheckEnabled), errorLogger); + suppressions.getUnmatchedLocalSuppressions(i->filename(), unusedFunctionCheckEnabled), errorLogger); } } err |= SuppressionList::reportUnmatchedSuppressions(suppressions.getUnmatchedGlobalSuppressions(unusedFunctionCheckEnabled), errorLogger); diff --git a/cli/processexecutor.cpp b/cli/processexecutor.cpp index 651152c46eec..fa08ba4bd015 100644 --- a/cli/processexecutor.cpp +++ b/cli/processexecutor.cpp @@ -297,8 +297,8 @@ unsigned int ProcessExecutor::check() close(pipes[1]); rpipes.push_back(pipes[0]); if (iFileSettings != mFileSettings.end()) { - childFile[pid] = iFileSettings->filename + ' ' + iFileSettings->cfg; - pipeFile[pipes[0]] = iFileSettings->filename + ' ' + iFileSettings->cfg; + childFile[pid] = iFileSettings->filename() + ' ' + iFileSettings->cfg; + pipeFile[pipes[0]] = iFileSettings->filename() + ' ' + iFileSettings->cfg; ++iFileSettings; } else { childFile[pid] = iFile->first; diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp index 971a1b4cdc39..12ee8b173c06 100644 --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -133,11 +133,11 @@ void CheckThread::run() } FileSettings fileSettings = mResult.getNextFileSettings(); - while (!fileSettings.filename.empty() && mState == Running) { - file = QString::fromStdString(fileSettings.filename); + while (!fileSettings.filename().empty() && mState == Running) { + file = QString::fromStdString(fileSettings.filename()); qDebug() << "Checking file" << file; mCppcheck.check(fileSettings); - runAddonsAndTools(&fileSettings, QString::fromStdString(fileSettings.filename)); + runAddonsAndTools(&fileSettings, QString::fromStdString(fileSettings.filename())); emit fileChecked(file); if (mState == Running) @@ -214,7 +214,7 @@ void CheckThread::runAddonsAndTools(const FileSettings *fileSettings, const QStr const std::string &buildDir = mCppcheck.settings().buildDir; if (!buildDir.empty()) { - analyzerInfoFile = QString::fromStdString(AnalyzerInformation::getAnalyzerInfoFile(buildDir, fileSettings->filename, fileSettings->cfg)); + analyzerInfoFile = QString::fromStdString(AnalyzerInformation::getAnalyzerInfoFile(buildDir, fileSettings->filename(), fileSettings->cfg)); QStringList args2(args); args2.insert(0,"-E"); diff --git a/gui/compliancereportdialog.cpp b/gui/compliancereportdialog.cpp index 30f18dd316cf..1914755e8d87 100644 --- a/gui/compliancereportdialog.cpp +++ b/gui/compliancereportdialog.cpp @@ -177,7 +177,7 @@ void ComplianceReportDialog::save() QDir dir(inf.absoluteDir()); for (const FileSettings& fs: p.fileSettings) - fileList.addFile(dir.relativeFilePath(QString::fromStdString(fs.filename))); + fileList.addFile(dir.relativeFilePath(QString::fromStdString(fs.filename()))); } QSet allFiles; diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index 1dbec569eb61..e4eb99e6747a 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -107,7 +107,7 @@ void ThreadResult::setProject(const ImportProject &prj) // Determine the total size of all of the files to check, so that we can // show an accurate progress estimate mMaxProgress = std::accumulate(prj.fileSettings.begin(), prj.fileSettings.end(), quint64{ 0 }, [](quint64 v, const FileSettings& fs) { - return v + QFile(QString::fromStdString(fs.filename)).size(); + return v + QFile(QString::fromStdString(fs.filename())).size(); }); } diff --git a/lib/analyzerinfo.cpp b/lib/analyzerinfo.cpp index 784521074320..3f34a8c52116 100644 --- a/lib/analyzerinfo.cpp +++ b/lib/analyzerinfo.cpp @@ -59,8 +59,8 @@ void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std:: } for (const FileSettings &fs : fileSettings) { - const std::string afile = getFilename(fs.filename); - fout << afile << ".a" << (++fileCount[afile]) << ":" << fs.cfg << ":" << Path::simplifyPath(Path::fromNativeSeparators(fs.filename)) << std::endl; + const std::string afile = getFilename(fs.filename()); + fout << afile << ".a" << (++fileCount[afile]) << ":" << fs.cfg << ":" << Path::simplifyPath(Path::fromNativeSeparators(fs.filename())) << std::endl; } } diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index cfe7b624fbec..b39f9898412d 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -593,12 +593,12 @@ unsigned int CppCheck::check(const FileSettings &fs) if (mSettings.clang) { temp.mSettings.includePaths.insert(temp.mSettings.includePaths.end(), fs.systemIncludePaths.cbegin(), fs.systemIncludePaths.cend()); // TODO: propagate back suppressions - const unsigned int returnValue = temp.check(Path::simplifyPath(fs.filename)); + const unsigned int returnValue = temp.check(Path::simplifyPath(fs.filename())); if (mUnusedFunctionsCheck) mUnusedFunctionsCheck->updateFunctionData(*temp.mUnusedFunctionsCheck); return returnValue; } - const unsigned int returnValue = temp.checkFile(Path::simplifyPath(fs.filename), fs.cfg); + const unsigned int returnValue = temp.checkFile(Path::simplifyPath(fs.filename()), fs.cfg); mSettings.supprs.nomsg.addSuppressions(temp.mSettings.supprs.nomsg.getSuppressions()); if (mUnusedFunctionsCheck) mUnusedFunctionsCheck->updateFunctionData(*temp.mUnusedFunctionsCheck); @@ -1683,7 +1683,7 @@ void CppCheck::analyseClangTidy(const FileSettings &fileSettings) constexpr char exe[] = "clang-tidy"; #endif - const std::string args = "-quiet -checks=*,-clang-analyzer-*,-llvm* \"" + fileSettings.filename + "\" -- " + allIncludes + allDefines; + const std::string args = "-quiet -checks=*,-clang-analyzer-*,-llvm* \"" + fileSettings.filename() + "\" -- " + allIncludes + allDefines; std::string output; if (const int exitcode = mExecuteCommand(exe, split(args), emptyString, output)) { std::cerr << "Failed to execute '" << exe << "' (exitcode: " << std::to_string(exitcode) << ")" << std::endl; @@ -1695,7 +1695,7 @@ void CppCheck::analyseClangTidy(const FileSettings &fileSettings) std::string line; if (!mSettings.buildDir.empty()) { - const std::string analyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile(mSettings.buildDir, fileSettings.filename, emptyString); + const std::string analyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile(mSettings.buildDir, fileSettings.filename(), emptyString); std::ofstream fcmd(analyzerInfoFile + ".clang-tidy-cmd"); fcmd << istr.str(); } @@ -1847,7 +1847,7 @@ void CppCheck::removeCtuInfoFiles(const std::list #include #include +#include + +class PathWithDetails +{ +public: + PathWithDetails() = default; + + explicit PathWithDetails(std::string path) + : mPath(std::move(path)) + {} + + const std::string& path() const + { + return mPath; + } +private: + std::string mPath; +}; /** File settings. Multiple configurations for a file is allowed. */ struct CPPCHECKLIB FileSettings { + FileSettings() = default; // TODO: call PathWithDetails c'tor + std::string cfg; - std::string filename; + PathWithDetails path; + const std::string& filename() const + { + return path.path(); + } std::string defines; // TODO: handle differently std::string cppcheckDefines() const { diff --git a/lib/importproject.cpp b/lib/importproject.cpp index b0516f343503..f375b088f13c 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -46,17 +46,17 @@ void ImportProject::ignorePaths(const std::vector &ipaths) for (std::list::iterator it = fileSettings.begin(); it != fileSettings.end();) { bool ignore = false; for (std::string i : ipaths) { - if (it->filename.size() > i.size() && it->filename.compare(0,i.size(),i)==0) { + if (it->filename().size() > i.size() && it->filename().compare(0,i.size(),i)==0) { ignore = true; break; } - if (isValidGlobPattern(i) && matchglob(i, it->filename)) { + if (isValidGlobPattern(i) && matchglob(i, it->filename())) { ignore = true; break; } if (!Path::isAbsolute(i)) { i = mPath + i; - if (it->filename.size() > i.size() && it->filename.compare(0,i.size(),i)==0) { + if (it->filename().size() > i.size() && it->filename().compare(0,i.size(),i)==0) { ignore = true; break; } @@ -400,7 +400,7 @@ bool ImportProject::importCompileCommands(std::istream &istr) FileSettings fs; if (Path::isAbsolute(file)) - fs.filename = Path::simplifyPath(file); + fs.path = PathWithDetails{Path::simplifyPath(file)}; #ifdef _WIN32 else if (file[0] == '/' && directory.size() > 2 && std::isalpha(directory[0]) && directory[1] == ':') // directory: C:\foo\bar @@ -409,9 +409,9 @@ bool ImportProject::importCompileCommands(std::istream &istr) fs.filename = Path::simplifyPath(directory.substr(0,2) + file); #endif else - fs.filename = Path::simplifyPath(directory + file); - if (!sourceFileExists(fs.filename)) { - printError("'" + fs.filename + "' from compilation database does not exist"); + fs.path = PathWithDetails{Path::simplifyPath(directory + file)}; + if (!sourceFileExists(fs.filename())) { + printError("'" + fs.filename() + "' from compilation database does not exist"); return false; } fsParseCommand(fs, command); // read settings; -D, -I, -U, -std, -m*, -f* @@ -760,7 +760,7 @@ bool ImportProject::importVcxproj(const std::string &filename, std::map basePaths{Path::fromNativeSeparators(Path::getCurrentPath())}; for (auto &fs: fileSettings) { - fs.filename = Path::getRelativePath(fs.filename, basePaths); + fs.path = PathWithDetails{Path::getRelativePath(fs.filename(), basePaths)}; for (auto &includePath: fs.includePaths) includePath = Path::getRelativePath(includePath, basePaths); } diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index 8c09abef984e..2acd846b7b92 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -123,7 +123,7 @@ class TestCppcheck : public TestFixture { ErrorLogger2 errorLogger; CppCheck cppcheck(errorLogger, false, {}); FileSettings fs; - fs.filename = file.path(); + fs.path = PathWithDetails{file.path()}; ASSERT_EQUALS(1, cppcheck.check(fs)); // TODO: how to properly disable these warnings? errorLogger.ids.erase(std::remove_if(errorLogger.ids.begin(), errorLogger.ids.end(), [](const std::string& id) { diff --git a/test/testfilesettings.cpp b/test/testfilesettings.cpp new file mode 100644 index 000000000000..c9a442b9a216 --- /dev/null +++ b/test/testfilesettings.cpp @@ -0,0 +1,55 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2024 Cppcheck team. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "filesettings.h" +#include "fixture.h" + +class TestFileSettings : public TestFixture { +public: + TestFileSettings() : TestFixture("TestFileSettings") {} + +private: + void run() override { + TEST_CASE(path); + } + + void path() const { + { + const PathWithDetails p{"file.cpp"}; + ASSERT_EQUALS("file.cpp", p.path()); + } + { + const PathWithDetails p{"in/file.cpp"}; + ASSERT_EQUALS("in/file.cpp", p.path()); + } + { + const PathWithDetails p{"in\\file.cpp"}; + ASSERT_EQUALS("in\\file.cpp", p.path()); + } + { + const PathWithDetails p{"in/../file.cpp"}; + ASSERT_EQUALS("in/../file.cpp", p.path()); + } + { + const PathWithDetails p{"in\\..\\file.cpp"}; + ASSERT_EQUALS("in\\..\\file.cpp", p.path()); + } + } +}; + +REGISTER_TEST(TestFileSettings) diff --git a/test/testimportproject.cpp b/test/testimportproject.cpp index 577faf0c493c..78967a946866 100644 --- a/test/testimportproject.cpp +++ b/test/testimportproject.cpp @@ -140,7 +140,7 @@ class TestImportProject : public TestFixture { TestImporter importer; ASSERT_EQUALS(true, importer.importCompileCommands(istr)); ASSERT_EQUALS(1, importer.fileSettings.size()); - ASSERT_EQUALS("C:/bar.c", importer.fileSettings.cbegin()->filename); + ASSERT_EQUALS("C:/bar.c", importer.fileSettings.cbegin()->filename()); #else constexpr char json[] = R"([{ "directory": "/foo", @@ -151,7 +151,7 @@ class TestImportProject : public TestFixture { TestImporter importer; ASSERT_EQUALS(true, importer.importCompileCommands(istr)); ASSERT_EQUALS(1, importer.fileSettings.size()); - ASSERT_EQUALS("/bar.c", importer.fileSettings.cbegin()->filename); + ASSERT_EQUALS("/bar.c", importer.fileSettings.cbegin()->filename()); #endif } @@ -166,7 +166,7 @@ class TestImportProject : public TestFixture { TestImporter importer; ASSERT_EQUALS(true, importer.importCompileCommands(istr)); ASSERT_EQUALS(1, importer.fileSettings.size()); - ASSERT_EQUALS("/tmp/src.c", importer.fileSettings.cbegin()->filename); + ASSERT_EQUALS("/tmp/src.c", importer.fileSettings.cbegin()->filename()); } void importCompileCommands4() const { @@ -328,7 +328,7 @@ class TestImportProject : public TestFixture { TestImporter importer; ASSERT_EQUALS(true, importer.importCompileCommands(istr)); ASSERT_EQUALS(1, importer.fileSettings.size()); - ASSERT_EQUALS("/tmp/src.c", importer.fileSettings.cbegin()->filename); + ASSERT_EQUALS("/tmp/src.c", importer.fileSettings.cbegin()->filename()); } void importCompileCommandsNoCommandSection() const { @@ -372,8 +372,8 @@ class TestImportProject : public TestFixture { void ignorePaths() const { FileSettings fs1, fs2; - fs1.filename = "foo/bar"; - fs2.filename = "qwe/rty"; + fs1.path = PathWithDetails{"foo/bar"}; + fs2.path = PathWithDetails{"qwe/rty"}; TestImporter project; project.fileSettings = {std::move(fs1), std::move(fs2)}; @@ -382,7 +382,7 @@ class TestImportProject : public TestFixture { project.ignorePaths({"foo/*"}); ASSERT_EQUALS(1, project.fileSettings.size()); - ASSERT_EQUALS("qwe/rty", project.fileSettings.front().filename); + ASSERT_EQUALS("qwe/rty", project.fileSettings.front().filename()); project.ignorePaths({ "*e/r*" }); ASSERT_EQUALS(0, project.fileSettings.size()); diff --git a/test/testprocessexecutor.cpp b/test/testprocessexecutor.cpp index 51caf8024054..4740f94bd6b7 100644 --- a/test/testprocessexecutor.cpp +++ b/test/testprocessexecutor.cpp @@ -75,7 +75,7 @@ class TestProcessExecutorBase : public TestFixture { filelist.emplace_back(f_s, data.size()); if (useFS) { FileSettings fs; - fs.filename = std::move(f_s); + fs.path = PathWithDetails{std::move(f_s)}; fileSettings.emplace_back(std::move(fs)); } } @@ -86,7 +86,7 @@ class TestProcessExecutorBase : public TestFixture { filelist.emplace_back(f, data.size()); if (useFS) { FileSettings fs; - fs.filename = f; + fs.path = PathWithDetails{f}; fileSettings.emplace_back(std::move(fs)); } } diff --git a/test/testrunner.vcxproj b/test/testrunner.vcxproj index 06cbbd96667a..ca0cb73244f7 100755 --- a/test/testrunner.vcxproj +++ b/test/testrunner.vcxproj @@ -63,6 +63,7 @@ + diff --git a/test/testsingleexecutor.cpp b/test/testsingleexecutor.cpp index 2de91fccf2fc..68d467a09141 100644 --- a/test/testsingleexecutor.cpp +++ b/test/testsingleexecutor.cpp @@ -80,7 +80,7 @@ class TestSingleExecutorBase : public TestFixture { filelist.emplace_back(f_s, data.size()); if (useFS) { FileSettings fs; - fs.filename = std::move(f_s); + fs.path = PathWithDetails{std::move(f_s)}; fileSettings.emplace_back(std::move(fs)); } } @@ -91,7 +91,7 @@ class TestSingleExecutorBase : public TestFixture { filelist.emplace_back(f, data.size()); if (useFS) { FileSettings fs; - fs.filename = f; + fs.path = PathWithDetails{f}; fileSettings.emplace_back(std::move(fs)); } } diff --git a/test/testsuppressions.cpp b/test/testsuppressions.cpp index 9eb7adb08ded..14638aac7805 100644 --- a/test/testsuppressions.cpp +++ b/test/testsuppressions.cpp @@ -234,7 +234,7 @@ class TestSuppressions : public TestFixture { filelist.emplace_back(i->first, i->second.size()); if (useFS) { FileSettings fs; - fs.filename = i->first; + fs.path = PathWithDetails{i->first}; fileSettings.emplace_back(std::move(fs)); } } @@ -283,7 +283,7 @@ class TestSuppressions : public TestFixture { filelist.emplace_back("test.cpp", strlen(code)); if (useFS) { FileSettings fs; - fs.filename = "test.cpp"; + fs.path = PathWithDetails{"test.cpp"}; fileSettings.emplace_back(std::move(fs)); } @@ -329,7 +329,7 @@ class TestSuppressions : public TestFixture { filelist.emplace_back("test.cpp", strlen(code)); if (useFS) { FileSettings fs; - fs.filename = "test.cpp"; + fs.path = PathWithDetails{"test.cpp"}; fileSettings.emplace_back(std::move(fs)); } diff --git a/test/testthreadexecutor.cpp b/test/testthreadexecutor.cpp index 3c191aacfea7..2d4c5b38b9aa 100644 --- a/test/testthreadexecutor.cpp +++ b/test/testthreadexecutor.cpp @@ -75,7 +75,7 @@ class TestThreadExecutorBase : public TestFixture { filelist.emplace_back(f_s, data.size()); if (useFS) { FileSettings fs; - fs.filename = std::move(f_s); + fs.path = PathWithDetails{std::move(f_s)}; fileSettings.emplace_back(std::move(fs)); } } @@ -86,7 +86,7 @@ class TestThreadExecutorBase : public TestFixture { filelist.emplace_back(f, data.size()); if (useFS) { FileSettings fs; - fs.filename = f; + fs.path = PathWithDetails{f}; fileSettings.emplace_back(std::move(fs)); } }