test: Fixed tests
This commit is contained in:
@@ -1954,7 +1954,7 @@ public:
|
||||
);
|
||||
|
||||
TS_ASSERT_EQUALS(client->templateSpecializations.size(), 1);
|
||||
TS_ASSERT_EQUALS(client->templateSpecializations[0], "class A<int> -> A<typename T> <2:7 2:7>");
|
||||
TS_ASSERT_EQUALS(client->templateSpecializations[0], "class A<int> -> A<typename T> <7:8 7:8>");
|
||||
}
|
||||
|
||||
void test_cxx_parser_finds_class_inheritance_from_implicit_template_class_specialization()
|
||||
@@ -2706,16 +2706,16 @@ private:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Id onFileParsed(const std::string& filePath)
|
||||
virtual Id onFileParsed(const FileInfo& fileInfo)
|
||||
{
|
||||
files.push_back(filePath);
|
||||
files.push_back(fileInfo.path.str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual Id onFileIncludeParsed(
|
||||
const ParseLocation& location, const std::string& filePath, const std::string& includedPath)
|
||||
const ParseLocation& location, const FileInfo& fileInfo, const FileInfo& includedFileInfo)
|
||||
{
|
||||
includes.push_back(filePath + " -> " + includedPath);
|
||||
includes.push_back(fileInfo.path.str() + " -> " + includedFileInfo.path.str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
FileManager fm;
|
||||
fm.setPaths(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
|
||||
TS_ASSERT_EQUALS(fm.getAddedFilePaths().size(), 4);
|
||||
}
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
|
||||
FileManager fm;
|
||||
fm.setPaths(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
|
||||
TS_ASSERT_EQUALS(fm.getAddedFilePaths().size(), 0);
|
||||
}
|
||||
@@ -70,14 +70,14 @@ public:
|
||||
|
||||
FileManager fm;
|
||||
fm.setPaths(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
|
||||
std::fstream fileStream;
|
||||
fileStream.open("./data/FileManagerTestSuite/include/c.h");
|
||||
fileStream << "update";
|
||||
fileStream.close();
|
||||
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
|
||||
TS_ASSERT_EQUALS(fm.getAddedFilePaths().size(), 0);
|
||||
TS_ASSERT_EQUALS(fm.getUpdatedFilePaths().size(), 1);
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
FileManager fm;
|
||||
fm.setPaths(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
|
||||
TS_ASSERT_EQUALS(fm.getAddedFilePaths().size(), 2);
|
||||
TS_ASSERT_EQUALS(fm.getUpdatedFilePaths().size(), 0);
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
sourcePaths[0] = "./data/FileManagerTestSuite/src/d.c";
|
||||
|
||||
fm.setPaths(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
||||
fm.fetchFilePaths();
|
||||
fm.fetchFilePaths(std::vector<FileInfo>());
|
||||
|
||||
TS_ASSERT_EQUALS(fm.getAddedFilePaths().size(), 1);
|
||||
TS_ASSERT_EQUALS(fm.getUpdatedFilePaths().size(), 0);
|
||||
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
|
||||
storage.onMethodOverrideParsed(validLocation(4), a, b);
|
||||
|
||||
TS_ASSERT(storage.getIdForEdgeWithName(Edge::getTypeString(Edge::EDGE_OVERRIDE) + ":A::isMethod->B::isMethod") != 0);
|
||||
TS_ASSERT(storage.getIdForEdgeWithName(Edge::getTypeString(Edge::EDGE_OVERRIDE) + ":B::isMethod->A::isMethod") != 0);
|
||||
}
|
||||
|
||||
void test_storage_saves_call()
|
||||
@@ -549,7 +549,7 @@ public:
|
||||
{
|
||||
TestStorage storage;
|
||||
|
||||
Id id = storage.onFileParsed("file.h");
|
||||
Id id = storage.onFileParsed(FileInfo("file.h"));
|
||||
|
||||
TS_ASSERT_EQUALS(storage.getNameForNodeWithId(id), "file.h");
|
||||
TS_ASSERT_EQUALS(storage.getNodeTypeForNodeWithId(id), Node::NODE_FILE);
|
||||
@@ -559,9 +559,9 @@ public:
|
||||
{
|
||||
TestStorage storage;
|
||||
|
||||
storage.onFileParsed("file.h");
|
||||
storage.onFileParsed("file.cpp");
|
||||
Id id = storage.onFileIncludeParsed(validLocation(7), "file.cpp", "file.h");
|
||||
storage.onFileParsed(FileInfo("file.h"));
|
||||
storage.onFileParsed(FileInfo("file.cpp"));
|
||||
Id id = storage.onFileIncludeParsed(validLocation(7), FileInfo("file.cpp"), FileInfo("file.h"));
|
||||
|
||||
TS_ASSERT(storage.getIdForEdgeWithName(Edge::getTypeString(Edge::EDGE_INCLUDE) + ":file.cpp->file.h") != 0);
|
||||
|
||||
@@ -601,6 +601,12 @@ private:
|
||||
: public Storage
|
||||
{
|
||||
public:
|
||||
TestStorage()
|
||||
: Storage("data/test.sqlite")
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
TokenLocationCollection getLocationCollectionForTokenId(Id id) const
|
||||
{
|
||||
std::vector<Id> tokenIds;
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
#include "data/parser/cxx/CxxParser.h"
|
||||
#include "TestFileManager.h"
|
||||
|
||||
TestStorage::TestStorage()
|
||||
: Storage("data/test.sqlite")
|
||||
{
|
||||
}
|
||||
|
||||
void TestStorage::parseCxxCode(std::string code)
|
||||
{
|
||||
clear();
|
||||
|
||||
@@ -7,6 +7,7 @@ class TestStorage
|
||||
: public Storage
|
||||
{
|
||||
public:
|
||||
TestStorage();
|
||||
void parseCxxCode(std::string code);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user