mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-23 15:42:50 +01:00
chore(SQLite): fix enum names case for #3018
This commit is contained in:
parent
5c29df0860
commit
e25a8b3ec7
Data/SQLite
@ -68,10 +68,11 @@ namespace SQLite {
|
||||
|
||||
extern const std::string TRANSACTION_TYPE_PROPERTY_KEY;
|
||||
|
||||
enum class TransactionType {
|
||||
deferred,
|
||||
exclusive,
|
||||
immediate
|
||||
enum class TransactionType
|
||||
{
|
||||
DEFERRED,
|
||||
EXCLUSIVE,
|
||||
IMMEDIATE
|
||||
};
|
||||
|
||||
} } } // namespace Poco::Data::SQLite
|
||||
|
@ -52,7 +52,7 @@ SessionImpl::SessionImpl(const std::string& fileName, std::size_t loginTimeout):
|
||||
_pDB(0),
|
||||
_connected(false),
|
||||
_isTransaction(false),
|
||||
_transactionType(TransactionType::deferred)
|
||||
_transactionType(TransactionType::DEFERRED)
|
||||
{
|
||||
open();
|
||||
setConnectionTimeout(loginTimeout);
|
||||
@ -91,13 +91,13 @@ void SessionImpl::begin()
|
||||
SQLiteStatementImpl tmp(*this, _pDB);
|
||||
switch (_transactionType)
|
||||
{
|
||||
case TransactionType::deferred:
|
||||
case TransactionType::DEFERRED:
|
||||
tmp.add(DEFERRED_BEGIN_TRANSACTION);
|
||||
break;
|
||||
case TransactionType::exclusive:
|
||||
case TransactionType::EXCLUSIVE:
|
||||
tmp.add(EXCLUSIVE_BEGIN_TRANSACTION);
|
||||
break;
|
||||
case TransactionType::immediate:
|
||||
case TransactionType::IMMEDIATE:
|
||||
tmp.add(IMMEDIATE_BEGIN_TRANSACTION);
|
||||
break;
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ void SQLiteTest::testInsertCharPointer()
|
||||
|
||||
pc = (const char*) std::calloc(9, sizeof(char));
|
||||
poco_check_ptr (pc);
|
||||
std::strncpy((char*) pc, "lastname", 8);
|
||||
std::strncpy((char*) pc, "lastname", 9);
|
||||
Statement stmt = (tmp << "INSERT INTO PERSON VALUES(:ln, :fn, :ad, :age)",
|
||||
bind(pc),
|
||||
bind("firstname"),
|
||||
@ -3205,7 +3205,7 @@ void SQLiteTest::testTransaction()
|
||||
std::string result;
|
||||
|
||||
session.setTransactionIsolation(Session::TRANSACTION_READ_COMMITTED);
|
||||
session.setProperty(Poco::Data::SQLite::TRANSACTION_TYPE_PROPERTY_KEY, Poco::Data::SQLite::TransactionType::exclusive);
|
||||
session.setProperty(Poco::Data::SQLite::TRANSACTION_TYPE_PROPERTY_KEY, Poco::Data::SQLite::TransactionType::EXCLUSIVE);
|
||||
{
|
||||
Transaction trans(session);
|
||||
assertTrue (trans.isActive());
|
||||
@ -3227,7 +3227,7 @@ void SQLiteTest::testTransaction()
|
||||
session << "SELECT count(*) FROM Person", into(count), now;
|
||||
assertTrue (0 == count);
|
||||
assertTrue (!session.isTransaction());
|
||||
session.setProperty(Poco::Data::SQLite::TRANSACTION_TYPE_PROPERTY_KEY, Poco::Data::SQLite::TransactionType::immediate);
|
||||
session.setProperty(Poco::Data::SQLite::TRANSACTION_TYPE_PROPERTY_KEY, Poco::Data::SQLite::TransactionType::IMMEDIATE);
|
||||
{
|
||||
Transaction trans(session);
|
||||
session << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now;
|
||||
@ -3442,10 +3442,10 @@ void SQLiteTest::testTransactionTypeProperty()
|
||||
using namespace Poco::Data::SQLite;
|
||||
|
||||
Session tmp(Connector::KEY, "dummy.db");
|
||||
tmp.setProperty(TRANSACTION_TYPE_PROPERTY_KEY, TransactionType::exclusive);
|
||||
tmp.setProperty(TRANSACTION_TYPE_PROPERTY_KEY, TransactionType::EXCLUSIVE);
|
||||
Poco::Any property = tmp.getProperty(TRANSACTION_TYPE_PROPERTY_KEY);
|
||||
TransactionType value = Poco::RefAnyCast<TransactionType>(property);
|
||||
assertTrue(value == TransactionType::exclusive);
|
||||
assertTrue(value == TransactionType::EXCLUSIVE);
|
||||
} catch (Poco::Exception&) {}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user