mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-02 01:41:05 +02:00
parent
200a890434
commit
27e7e532cc
@ -59,15 +59,17 @@ Utility::TypeMap Utility::_types;
|
|||||||
Poco::Mutex Utility::_mutex;
|
Poco::Mutex Utility::_mutex;
|
||||||
|
|
||||||
|
|
||||||
Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex(sqlite3_db_mutex(pDB))
|
Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex((pDB) ? sqlite3_db_mutex(pDB) : 0)
|
||||||
{
|
{
|
||||||
sqlite3_mutex_enter(_pMutex);
|
if (_pMutex)
|
||||||
|
sqlite3_mutex_enter(_pMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Utility::SQLiteMutex::~SQLiteMutex()
|
Utility::SQLiteMutex::~SQLiteMutex()
|
||||||
{
|
{
|
||||||
sqlite3_mutex_leave(_pMutex);
|
if (_pMutex)
|
||||||
|
sqlite3_mutex_leave(_pMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ using Poco::Data::Column;
|
|||||||
using Poco::Data::Row;
|
using Poco::Data::Row;
|
||||||
using Poco::Data::SQLChannel;
|
using Poco::Data::SQLChannel;
|
||||||
using Poco::Data::LimitException;
|
using Poco::Data::LimitException;
|
||||||
|
using Poco::Data::ConnectionFailedException;
|
||||||
using Poco::Data::CLOB;
|
using Poco::Data::CLOB;
|
||||||
using Poco::Data::Date;
|
using Poco::Data::Date;
|
||||||
using Poco::Data::Time;
|
using Poco::Data::Time;
|
||||||
@ -3362,6 +3363,19 @@ void SQLiteTest::testFTS3()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SQLiteTest::testIllegalFilePath()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Session tmp (Poco::Data::SQLite::Connector::KEY, "\\/some\\/illegal\\/path\\/dummy.db", 1);
|
||||||
|
fail("must fail");
|
||||||
|
}
|
||||||
|
catch (ConnectionFailedException&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SQLiteTest::setUp()
|
void SQLiteTest::setUp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -3462,6 +3476,7 @@ CppUnit::Test* SQLiteTest::suite()
|
|||||||
CppUnit_addTest(pSuite, SQLiteTest, testTransaction);
|
CppUnit_addTest(pSuite, SQLiteTest, testTransaction);
|
||||||
CppUnit_addTest(pSuite, SQLiteTest, testTransactor);
|
CppUnit_addTest(pSuite, SQLiteTest, testTransactor);
|
||||||
CppUnit_addTest(pSuite, SQLiteTest, testFTS3);
|
CppUnit_addTest(pSuite, SQLiteTest, testFTS3);
|
||||||
|
CppUnit_addTest(pSuite, SQLiteTest, testIllegalFilePath);
|
||||||
|
|
||||||
return pSuite;
|
return pSuite;
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,8 @@ public:
|
|||||||
|
|
||||||
void testFTS3();
|
void testFTS3();
|
||||||
|
|
||||||
|
void testIllegalFilePath();
|
||||||
|
|
||||||
void setUp();
|
void setUp();
|
||||||
void tearDown();
|
void tearDown();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user