build: Fixed enum forward declarations and filepath checks in SonarGraphProjectTestSuite

This commit is contained in:
Eberhard Graether
2018-05-22 13:02:27 +02:00
parent 7b735cfd17
commit 59f32e9942
493 changed files with 11809 additions and 11325 deletions
+4 -3
View File
@@ -5,12 +5,13 @@
#include <set>
#include <vector>
#include "settings/LanguageType.h"
#include "settings/SourceGroupStatusType.h"
#include "settings/SourceGroupType.h"
class IndexerCommand;
class FilePath;
class SourceGroupSettings;
enum LanguageType;
enum SourceGroupStatusType;
enum SourceGroupType;
class SourceGroup
{
@@ -5,6 +5,8 @@
#include <memory>
#include <vector>
#include "settings/LanguageType.h"
// xsdCppModule
// xsdCppManualModule -> basePathForIncludes(0, n), sourceFileExtensions(0, n), moduleCompilerOptions(0, n)
// xsdCmakeJsonModule -> rootPathWithFiles(0, n)
@@ -17,7 +19,6 @@ class FilePath;
class IndexerCommand;
class SourceGroupSettings;
class TextAccess;
enum LanguageType;
namespace Sonargraph
{
@@ -37,7 +38,7 @@ namespace Sonargraph
std::set<FilePath> filterToContainedFilePaths(const std::set<FilePath>& filePaths) const;
std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(
std::shared_ptr<const SourceGroupSettings> sourceGroupSettings,
std::shared_ptr<const SourceGroupSettings> sourceGroupSettings,
std::shared_ptr<const ApplicationSettings> appSettings) const;
private:
@@ -12,7 +12,6 @@ class ApplicationSettings;
class IndexerCommand;
class SourceGroupSettings;
class TiXmlElement;
enum LanguageType;
namespace Sonargraph
{
@@ -5,13 +5,13 @@
#include <string>
#include <vector>
#include "settings/LanguageType.h"
#include "utility/file/FilePathFilter.h"
class ApplicationSettings;
class IndexerCommand;
class SourceGroupSettings;
class TiXmlElement;
enum LanguageType;
namespace Sonargraph
{
+4 -6
View File
@@ -15,9 +15,8 @@ namespace utility
{
std::vector<const TiXmlElement*> elements;
const TiXmlElement* child = parentElement->FirstChildElement(elementName.c_str());
for (child; child; child = child->NextSiblingElement(elementName.c_str()))
for (const TiXmlElement* child = parentElement->FirstChildElement(elementName.c_str());
child; child = child->NextSiblingElement(elementName.c_str()))
{
elements.push_back(child);
}
@@ -29,9 +28,8 @@ namespace utility
{
std::vector<const TiXmlElement*> elements;
const TiXmlElement* child = parentElement->FirstChildElement();
for (child; child; child = child->NextSiblingElement())
for (const TiXmlElement* child = parentElement->FirstChildElement();
child; child = child->NextSiblingElement())
{
const char* value = child->Attribute(attributeName.c_str());
if (value != nullptr && value == attributeValue)
+9 -9
View File
@@ -41,7 +41,7 @@ public:
TS_ASSERT_EQUALS(REFRESH_ALL_FILES, refreshInfo.mode);
TS_ASSERT_EQUALS(0, refreshInfo.nonIndexedFilesToClear.size());
TS_ASSERT_EQUALS(0, refreshInfo.filesToClear.size());
TS_ASSERT_EQUALS(1, refreshInfo.filesToIndex.size());
TS_ASSERT_EQUALS(1, refreshInfo.filesToIndex.size());
TS_ASSERT(utility::containsElement<FilePath>(
utility::toVector(refreshInfo.filesToIndex), sourceFilePath
@@ -163,7 +163,7 @@ public:
TS_ASSERT_EQUALS(0, refreshInfo.nonIndexedFilesToClear.size());
TS_ASSERT_EQUALS(1, refreshInfo.filesToClear.size());
TS_ASSERT_EQUALS(1, refreshInfo.filesToIndex.size());
TS_ASSERT(utility::containsElement<FilePath>(
utility::toVector(refreshInfo.filesToClear), outdatedSourceFilePath
));
@@ -212,9 +212,9 @@ public:
const FilePath outdatedSourceFilePath = m_sourceFolder.getConcatenated(L"outdated_file.cpp");
std::vector<std::shared_ptr<SourceGroup>> sourceGroups;
sourceGroups.push_back(std::shared_ptr<SourceGroupTest>(new SourceGroupTest({
upToDateSourceFilePath,
outdatedSourceFilePath
sourceGroups.push_back(std::shared_ptr<SourceGroupTest>(new SourceGroupTest({
upToDateSourceFilePath,
outdatedSourceFilePath
})));
std::shared_ptr<PersistentStorage> storage = std::make_shared<PersistentStorage>(
@@ -238,7 +238,7 @@ public:
TS_ASSERT_EQUALS(0, refreshInfo.nonIndexedFilesToClear.size());
TS_ASSERT_EQUALS(2, refreshInfo.filesToClear.size());
TS_ASSERT_EQUALS(2, refreshInfo.filesToIndex.size());
TS_ASSERT(utility::containsElement<FilePath>(
utility::toVector(refreshInfo.filesToClear), upToDateSourceFilePath
));
@@ -476,12 +476,12 @@ private:
}
private:
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings()
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override
{
return m_sourceGroupSettings;
}
virtual std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const
std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const override
{
return m_sourceGroupSettings;
}
@@ -511,7 +511,7 @@ private:
{
FileSystem::createDirectory(filePath.getParentDirectory());
std::ofstream file;
file.open(filePath.wstr());
file.open(filePath.str());
file << "This is some file content.\n";
file.close();
}
+4 -4
View File
@@ -78,7 +78,7 @@ public:
void generateAndCompareExpectedOutputForSonargraphProject(
std::wstring projectName,
std::shared_ptr<const SourceGroupSettings> sourceGroupSettings,
std::shared_ptr<const SourceGroupSettings> sourceGroupSettings,
std::shared_ptr<const ApplicationSettings> applicationSettings)
{
const FilePath projectDataRoot = FilePath(L"data/SonargraphProjectTestSuite/" + projectName).makeAbsolute();
@@ -110,7 +110,7 @@ public:
std::shared_ptr<TextAccess> generateExpectedOutputForSonargraphProject(
std::wstring projectName,
std::shared_ptr<const SourceGroupSettings> sourceGroupSettings,
std::shared_ptr<const SourceGroupSettings> sourceGroupSettings,
std::shared_ptr<const ApplicationSettings> applicationSettings)
{
const FilePath projectDataRoot = FilePath(L"data/SonargraphProjectTestSuite/" + projectName).makeAbsolute();
@@ -142,7 +142,7 @@ public:
{
return indexerCommandJavaToString(indexerCommandJava, baseDirectory);
}
return L"Unsupported indexer command type: " + indexerCommand->getIndexerCommandType();
return L"Unsupported indexer command type: " + utility::decodeFromUtf8(indexerCommandTypeToString(indexerCommand->getIndexerCommandType()));
}
return L"No IndexerCommand provided.";
}
@@ -170,7 +170,7 @@ public:
}
return result;
}
std::wstring indexerCommandJavaToString(std::shared_ptr<const IndexerCommandJava> indexerCommand, const FilePath& baseDirectory)
{
std::wstring result;