forked from qt-creator/qt-creator
Sqlite: Move result count to class declaration
It move the magic number of column results to the sql statement and improves the mock a little bit. Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -27,34 +27,9 @@
|
||||
|
||||
#include "sqlitedatabasemock.h"
|
||||
|
||||
SqliteReadStatementMock::SqliteReadStatementMock(Utils::SmallStringView sqlStatement,
|
||||
SqliteDatabaseMock &databaseMock)
|
||||
SqliteReadStatementMockBase::SqliteReadStatementMockBase(Utils::SmallStringView sqlStatement,
|
||||
SqliteDatabaseMock &databaseMock)
|
||||
: sqlStatement(sqlStatement)
|
||||
{
|
||||
databaseMock.prepare(sqlStatement);
|
||||
}
|
||||
|
||||
template<>
|
||||
std::vector<Utils::SmallString> SqliteReadStatementMock::values<Utils::SmallString>(std::size_t reserveSize)
|
||||
{
|
||||
return valuesReturnStringVector(reserveSize);
|
||||
}
|
||||
|
||||
template<>
|
||||
std::vector<long long> SqliteReadStatementMock::values<long long>(std::size_t reserveSize)
|
||||
{
|
||||
return valuesReturnRowIds(reserveSize);
|
||||
}
|
||||
|
||||
template<>
|
||||
Utils::optional<long long> SqliteReadStatementMock::value<long long>()
|
||||
{
|
||||
return valueReturnLongLong();
|
||||
}
|
||||
|
||||
template<>
|
||||
Utils::optional<Sqlite::ByteArrayBlob> SqliteReadStatementMock::value<Sqlite::ByteArrayBlob>(
|
||||
const Utils::SmallStringView &name, const long long &blob)
|
||||
{
|
||||
return valueReturnBlob(name, blob);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user