test: made tests run again.
* added call to SqliteStorage::init() in storage tests. * made Storage::getIdForNodeWithNameHierarchy(...) return the correct node id again.
This commit is contained in:
@@ -140,7 +140,9 @@ void UndoRedoController::handleMessage(MessageRefresh* message)
|
||||
|
||||
if (requiresActivateFallbackToken())
|
||||
{
|
||||
Id nodeId = m_storageAccess->getIdForNodeWithNameHierarchy(NameHierarchy("main"));
|
||||
NameHierarchy mainNameHierarchy;
|
||||
mainNameHierarchy.push(std::make_shared<NameElement>("main", "int main()"));
|
||||
Id nodeId = m_storageAccess->getIdForNodeWithNameHierarchy(mainNameHierarchy);
|
||||
if (!nodeId)
|
||||
{
|
||||
nodeId = m_storageAccess->getIdForFirstNode();
|
||||
|
||||
@@ -761,15 +761,7 @@ Id Storage::onCommentParsed(const ParseLocation& location)
|
||||
|
||||
Id Storage::getIdForNodeWithNameHierarchy(const NameHierarchy& nameHierarchy) const
|
||||
{
|
||||
// return m_sqliteStorage.getNodeBySerializedName(NameHierarchy::serialize(nameHierarchy)).id;
|
||||
|
||||
const SearchNode* node = m_tokenIndex.getNode(nameHierarchy);
|
||||
if (node)
|
||||
{
|
||||
return node->getFirstTokenId();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return m_sqliteStorage.getNodeBySerializedName(NameHierarchy::serialize(nameHierarchy)).id;
|
||||
}
|
||||
|
||||
Id Storage::getIdForEdge(
|
||||
|
||||
@@ -14,6 +14,7 @@ public:
|
||||
int nodeCount = -1;
|
||||
{
|
||||
SqliteStorage storage(databasePath);
|
||||
storage.init();
|
||||
storage.beginTransaction();
|
||||
storage.addNode(0, "a", false);
|
||||
storage.commitTransaction();
|
||||
@@ -30,6 +31,7 @@ public:
|
||||
int nodeCount = -1;
|
||||
{
|
||||
SqliteStorage storage(databasePath);
|
||||
storage.init();
|
||||
storage.beginTransaction();
|
||||
int nodeId = storage.addNode(0, "a", false);
|
||||
storage.removeElement(nodeId);
|
||||
@@ -47,6 +49,7 @@ public:
|
||||
int edgeCount = -1;
|
||||
{
|
||||
SqliteStorage storage(databasePath);
|
||||
storage.init();
|
||||
storage.beginTransaction();
|
||||
int sourceNodeId = storage.addNode(0, "a", false);
|
||||
int targetNodeId = storage.addNode(0, "b", false);
|
||||
@@ -65,6 +68,7 @@ public:
|
||||
int edgeCount = -1;
|
||||
{
|
||||
SqliteStorage storage(databasePath);
|
||||
storage.init();
|
||||
storage.beginTransaction();
|
||||
int sourceNodeId = storage.addNode(0, "a", false);
|
||||
int targetNodeId = storage.addNode(0, "b", false);
|
||||
|
||||
@@ -651,12 +651,12 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
ParseLocation validLocation(Id locationId = 0) const // id is not used as id ..... who programs this? ebsi? :P
|
||||
ParseLocation validLocation(Id locationId = 0) const
|
||||
{
|
||||
return ParseLocation(m_filePath, 1, locationId, 1, locationId);
|
||||
}
|
||||
|
||||
bool isValidLocation(TokenLocation* location, Id locationId) const // remove this one
|
||||
bool isValidLocation(TokenLocation* location, Id locationId) const
|
||||
{
|
||||
return
|
||||
location->getFilePath() == m_filePath &&
|
||||
|
||||
Reference in New Issue
Block a user