mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Add unit tests for MapDatabase implementations
This commit is contained in:
@@ -30,8 +30,7 @@ void Database_Dummy::loadBlock(const v3s16 &pos, std::string *block)
|
||||
|
||||
bool Database_Dummy::deleteBlock(const v3s16 &pos)
|
||||
{
|
||||
m_database.erase(getBlockAsInteger(pos));
|
||||
return true;
|
||||
return m_database.erase(getBlockAsInteger(pos)) > 0;
|
||||
}
|
||||
|
||||
void Database_Dummy::listAllLoadableBlocks(std::vector<v3s16> &dst)
|
||||
|
@@ -316,6 +316,7 @@ void MapDatabaseSQLite3::loadBlock(const v3s16 &pos, std::string *block)
|
||||
bindPos(m_stmt_read, pos);
|
||||
|
||||
if (sqlite3_step(m_stmt_read) != SQLITE_ROW) {
|
||||
block->clear();
|
||||
sqlite3_reset(m_stmt_read);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user