1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-08-08 09:01:48 +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:
Sandu Liviu Catalin
2021-01-30 08:51:39 +02:00
parent e0e34b4030
commit 4a6bfc086c
6219 changed files with 1209835 additions and 454916 deletions

View File

@@ -0,0 +1,17 @@
//
// Driver.cpp
//
// Console-based test driver for Poco MongoDB.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "CppUnit/TestRunner.h"
#include "RedisTestSuite.h"
CppUnitMain(RedisTestSuite)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
//
// RedisTest.h
//
// Definition of the RedisTest class.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef RedisTest_INCLUDED
#define RedisTest_INCLUDED
#include "Poco/Redis/Redis.h"
#include "Poco/Redis/Client.h"
#include "CppUnit/TestCase.h"
class RedisTest: public CppUnit::TestCase
{
public:
RedisTest(const std::string& name);
virtual ~RedisTest();
void testAPPEND();
void testBLPOP();
void testBRPOP();
void testDECR();
void testECHO();
void testError();
void testEVAL();
void testHDEL();
void testHEXISTS();
void testHGETALL();
void testHINCRBY();
void testHKEYS();
void testHMGET();
void testHMSET();
void testHSET();
void testHSTRLEN();
void testHVALS();
void testINCR();
void testINCRBY();
void testLINDEX();
void testLINSERT();
void testLPOP();
void testLREM();
void testLSET();
void testLTRIM();
void testMULTI();
void testMSET();
void testMSETWithMap();
void testPING();
void testPipeliningWithSendCommands();
void testPipeliningWithWriteCommand();
void testPubSub();
void testSADD();
void testSCARD();
void testSDIFF();
void testSDIFFSTORE();
void testSET();
void testSINTER();
void testSINTERSTORE();
void testSISMEMBER();
void testSMEMBERS();
void testSMOVE();
void testSPOP();
void testSRANDMEMBER();
void testSREM();
void testSUNION();
void testSUNIONSTORE();
void testSTRLEN();
void testRENAME();
void testRENAMENX();
void testRPOP();
void testRPOPLPUSH();
void testRPUSH();
void testPool();
void setUp();
void tearDown();
static CppUnit::Test* suite();
private:
void delKey(const std::string& key);
std::string _host;
unsigned _port;
static bool _connected;
static Poco::Redis::Client _redis;
};
#endif // RedisTest_INCLUDED

View File

@@ -0,0 +1,22 @@
//
// RedisTestSuite.cpp
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "RedisTestSuite.h"
#include "RedisTest.h"
CppUnit::Test* RedisTestSuite::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RedisTestSuite");
pSuite->addTest(RedisTest::suite());
return pSuite;
}

View File

@@ -0,0 +1,27 @@
//
// RedisTestSuite.h
//
// Definition of the RedisTestSuite class.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef RedisTestSuite_INCLUDED
#define RedisTestSuite_INCLUDED
#include "CppUnit/TestSuite.h"
class RedisTestSuite
{
public:
static CppUnit::Test* suite();
};
#endif // RedisTestSuite_INCLUDED

View File

@@ -0,0 +1,30 @@
//
// WinCEDriver.cpp
//
// Console-based test driver for Windows CE.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "CppUnit/TestRunner.h"
#include "RedisTestSuite.h"
#include <cstdlib>
int _tmain(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("RedisTestSuite", RedisTestSuite::suite());
return runner.run(args) ? 0 : 1;
}

View File

@@ -0,0 +1,28 @@
//
// WinDriver.cpp
//
// Windows test driver for Poco MongoDB.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "WinTestRunner/WinTestRunner.h"
#include "RedisTestSuite.h"
class TestDriver: public CppUnit::WinTestRunnerApp
{
void TestMain()
{
CppUnit::WinTestRunner runner;
runner.addTest(RedisTestSuite::suite());
runner.run();
}
};
TestDriver theDriver;