Skip to content
Snippets Groups Projects
Commit 5fa559ea authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny: Committed by Johannes Junggeburth
Browse files

Fix safety tests

Until you build the GeoModel tree, the caches are not created yet; however, the low-level methods can access the DB directly. So, the existance of a table should be verified at the DB level, not at cache level; otherwise the test fails when calling methods before building the GeoModel tree.
parent 6f5acd99
No related branches found
No related tags found
1 merge request!327New schema for the GeoModel SQLite database and updated I/O
...@@ -525,9 +525,9 @@ std::vector<std::vector<std::string>> GMDBManager::getTableFromNodeType_String( ...@@ -525,9 +525,9 @@ std::vector<std::vector<std::string>> GMDBManager::getTableFromNodeType_String(
else else
{ {
// if (!checkTable(tableName)) // if (!checkTable(tableName))
if (!checkTableFromCache(tableName)) if (!checkTableFromDB(tableName))
{ {
THROW_EXCEPTION("ERROR!!! Table name '" << tableName << "' does not exist in cache! (It has not been loaded from the DB)"); THROW_EXCEPTION("ERROR!!! Table name '" << tableName << "' does not exist in the DB!");
} }
out = getTableRecords_String(tableName); out = getTableRecords_String(tableName);
} }
...@@ -555,9 +555,9 @@ DBRowsList GMDBManager::getTableFromNodeType_VecVecData( ...@@ -555,9 +555,9 @@ DBRowsList GMDBManager::getTableFromNodeType_VecVecData(
} }
else else
{ {
if (!checkTableFromCache(tableName)) if (!checkTableFromDB(tableName))
{ {
THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in cache! (It has not been loaded from the DB)"); THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in the DB!");
} }
out = getTableRecords_VecVecData(tableName); out = getTableRecords_VecVecData(tableName);
} }
...@@ -585,9 +585,9 @@ DBRowsList GMDBManager::getTableFromTableName_VecVecData( ...@@ -585,9 +585,9 @@ DBRowsList GMDBManager::getTableFromTableName_VecVecData(
} }
else else
{ {
if (!checkTableFromCache(tableName)) if (!checkTableFromDB(tableName))
{ {
THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in cache! (It has not been loaded from the DB)"); THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in the DB!");
} }
out = getTableRecords_VecVecData(tableName); out = getTableRecords_VecVecData(tableName);
} }
...@@ -613,9 +613,9 @@ DBRowEntry GMDBManager::getTableFromTableName_VecData( ...@@ -613,9 +613,9 @@ DBRowEntry GMDBManager::getTableFromTableName_VecData(
} }
else else
{ {
if (!checkTableFromCache(tableName)) if (!checkTableFromDB(tableName))
{ {
THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in cache! (It has not been loaded from the DB)"); THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in the DB!");
} }
out = getTableRecords_VecData(tableName); out = getTableRecords_VecData(tableName);
} }
...@@ -1371,7 +1371,7 @@ DBRowsList GMDBManager::getPublishedFPVTable( ...@@ -1371,7 +1371,7 @@ DBRowsList GMDBManager::getPublishedFPVTable(
} }
if (!checkTableFromCache(tableName)) if (!checkTableFromCache(tableName))
{ {
THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in cache! (It has not been loaded from the DB)"); THROW_EXCEPTION("ERROR!!! Table name '" + tableName + "' does not exist in the DB!");
} }
return getTableRecords_VecVecData(tableName); return getTableRecords_VecVecData(tableName);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment