mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-10-08 06:37:11 +02:00
Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
This commit is contained in:
1 parent
e0e34b4030
commit
4a6bfc086c
6219 files changed
+1209835
-454916
No files matched your search
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Driver.cpp
|
||||
//
|
||||
// Console-based test driver for Poco SQLite.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "CppUnit/TestRunner.h"
|
||||
#include "SQLiteTestSuite.h"
|
||||
|
||||
|
||||
CppUnitMain(SQLiteTestSuite)
|
||||
+3483
File diff suppressed because it is too large.
Load diff
+165
@@ -0,0 +1,165 @@
|
||||
//
|
||||
// SQLiteTest.h
|
||||
//
|
||||
// Definition of the SQLiteTest class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef SQLiteTest_INCLUDED
|
||||
#define SQLiteTest_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/SQLite/SQLite.h"
|
||||
#include "CppUnit/TestCase.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
class Session;
|
||||
|
||||
} }
|
||||
|
||||
|
||||
class SQLiteTest: public CppUnit::TestCase
|
||||
{
|
||||
public:
|
||||
SQLiteTest(const std::string& name);
|
||||
~SQLiteTest();
|
||||
|
||||
void testBinding();
|
||||
void testZeroRows();
|
||||
void testSimpleAccess();
|
||||
void testInMemory();
|
||||
void testNullCharPointer();
|
||||
void testInsertCharPointer();
|
||||
void testInsertCharPointer2();
|
||||
void testComplexType();
|
||||
void testSimpleAccessVector();
|
||||
void testComplexTypeVector();
|
||||
void testSharedPtrComplexTypeVector();
|
||||
void testInsertVector();
|
||||
void testInsertEmptyVector();
|
||||
void testAffectedRows();
|
||||
void testInsertSingleBulk();
|
||||
void testInsertSingleBulkVec();
|
||||
|
||||
void testLimit();
|
||||
void testLimitOnce();
|
||||
void testLimitPrepare();
|
||||
void testLimitZero();
|
||||
void testPrepare();
|
||||
|
||||
void testSetSimple();
|
||||
void testSetComplex();
|
||||
void testSetComplexUnique();
|
||||
void testMultiSetSimple();
|
||||
void testMultiSetComplex();
|
||||
void testMapComplex();
|
||||
void testMapComplexUnique();
|
||||
void testMultiMapComplex();
|
||||
void testSelectIntoSingle();
|
||||
void testSelectIntoSingleStep();
|
||||
void testSelectIntoSingleFail();
|
||||
void testLowerLimitOk();
|
||||
void testLowerLimitFail();
|
||||
void testCombinedLimits();
|
||||
void testCombinedIllegalLimits();
|
||||
void testRange();
|
||||
void testIllegalRange();
|
||||
void testSingleSelect();
|
||||
void testEmptyDB();
|
||||
|
||||
void testCLOB();
|
||||
|
||||
void testTuple1();
|
||||
void testTupleVector1();
|
||||
void testTuple2();
|
||||
void testTupleVector2();
|
||||
void testTuple3();
|
||||
void testTupleVector3();
|
||||
void testTuple4();
|
||||
void testTupleVector4();
|
||||
void testTuple5();
|
||||
void testTupleVector5();
|
||||
void testTuple6();
|
||||
void testTupleVector6();
|
||||
void testTuple7();
|
||||
void testTupleVector7();
|
||||
void testTuple8();
|
||||
void testTupleVector8();
|
||||
void testTuple9();
|
||||
void testTupleVector9();
|
||||
void testTuple10();
|
||||
void testTupleVector10();
|
||||
|
||||
void testDateTime();
|
||||
|
||||
void testInternalExtraction();
|
||||
void testPrimaryKeyConstraint();
|
||||
void testNullable();
|
||||
void testNulls();
|
||||
void testRowIterator();
|
||||
void testAsync();
|
||||
|
||||
void testAny();
|
||||
void testDynamicAny();
|
||||
void testPair();
|
||||
|
||||
void testSQLChannel();
|
||||
void testSQLLogger();
|
||||
|
||||
void testExternalBindingAndExtraction();
|
||||
void testBindingCount();
|
||||
void testMultipleResults();
|
||||
|
||||
void testReconnect();
|
||||
|
||||
void testThreadModes();
|
||||
|
||||
void testUpdateCallback();
|
||||
void testCommitCallback();
|
||||
void testRollbackCallback();
|
||||
void testNotifier();
|
||||
|
||||
void testSessionTransaction();
|
||||
void testTransaction();
|
||||
void testTransactor();
|
||||
|
||||
void testFTS3();
|
||||
|
||||
void testIllegalFilePath();
|
||||
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
static void sqliteUpdateCallbackFn(void*, int, const char*, const char*, Poco::Int64);
|
||||
static int sqliteCommitCallbackFn(void*);
|
||||
static void sqliteRollbackCallbackFn(void*);
|
||||
|
||||
void onInsert(const void* pSender);
|
||||
void onUpdate(const void* pSender);
|
||||
void onDelete(const void* pSender);
|
||||
void onCommit(const void* pSender);
|
||||
void onRollback(const void* pSender);
|
||||
|
||||
static CppUnit::Test* suite();
|
||||
|
||||
private:
|
||||
void setTransactionIsolation(Poco::Data::Session& session, Poco::UInt32 ti);
|
||||
|
||||
static int _insertCounter;
|
||||
static int _updateCounter;
|
||||
static int _deleteCounter;
|
||||
|
||||
int _commitCounter;
|
||||
int _rollbackCounter;
|
||||
};
|
||||
|
||||
|
||||
#endif // SQLiteTest_INCLUDED
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// SQLiteTestSuite.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "SQLiteTestSuite.h"
|
||||
#include "SQLiteTest.h"
|
||||
|
||||
|
||||
CppUnit::Test* SQLiteTestSuite::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SQLiteTestSuite");
|
||||
|
||||
pSuite->addTest(SQLiteTest::suite());
|
||||
|
||||
return pSuite;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// SQLiteTestSuite.h
|
||||
//
|
||||
// Definition of the SQLiteTestSuite class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef SQLiteTestSuite_INCLUDED
|
||||
#define SQLiteTestSuite_INCLUDED
|
||||
|
||||
|
||||
#include "CppUnit/TestSuite.h"
|
||||
|
||||
|
||||
class SQLiteTestSuite
|
||||
{
|
||||
public:
|
||||
static CppUnit::Test* suite();
|
||||
};
|
||||
|
||||
|
||||
#endif // SQLiteTestSuite_INCLUDED
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// WinCEDriver.cpp
|
||||
//
|
||||
// Console-based test driver for Windows CE.
|
||||
//
|
||||
// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "CppUnit/TestRunner.h"
|
||||
#include "SQLiteTestSuite.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
int wmain(int argc, wchar_t* argv[])
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
char buffer[1024];
|
||||
std::wcstombs(buffer, argv[i], sizeof(buffer));
|
||||
args.push_back(std::string(buffer));
|
||||
}
|
||||
CppUnit::TestRunner runner;
|
||||
runner.addTest("SQLiteTestSuite", SQLiteTestSuite::suite());
|
||||
return runner.run(args) ? 0 : 1;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// WinDriver.cpp
|
||||
//
|
||||
// Windows test driver for Poco SQLite.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "WinTestRunner/WinTestRunner.h"
|
||||
#include "SQLiteTestSuite.h"
|
||||
|
||||
|
||||
class TestDriver: public CppUnit::WinTestRunnerApp
|
||||
{
|
||||
void TestMain()
|
||||
{
|
||||
CppUnit::WinTestRunner runner;
|
||||
runner.addTest(SQLiteTestSuite::suite());
|
||||
runner.run();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
TestDriver theDriver;
|
||||
Reference in new issue
Block a user