MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getAddonFilePath

Method getAddonFilePath

gui/test/projectfile/testprojectfile.cpp:125–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void TestProjectFile::getAddonFilePath() const
126{
127 QTemporaryDir tempdir;
128 QVERIFY(tempdir.isValid());
129 const QString filepath(tempdir.path() + "/addon.py");
130
131 QFile file(filepath);
132 QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text));
133 file.close();
134
135 // Relative path to addon
136 QCOMPARE(ProjectFile::getAddonFilePath(tempdir.path(), "addon"), filepath);
137 QCOMPARE(ProjectFile::getAddonFilePath(tempdir.path(), "not exist"), QString());
138
139 // Absolute path to addon
140 QCOMPARE(ProjectFile::getAddonFilePath("/not/exist", filepath), filepath);
141 QCOMPARE(ProjectFile::getAddonFilePath(tempdir.path(), filepath), filepath);
142}
143
144void TestProjectFile::getSearchPaths() const
145{

Callers

nothing calls this directly

Calls 3

QStringClass · 0.50
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected